Jump to content

salmiak

Members
  • Posts

    30
  • Joined

  • Last visited

Everything posted by salmiak

  1. Because I'm using the LoginRegisterPro module, users use their email to log in. So I'm wondering, for authentication, should i make an endpoint that returns the username for a given email address and use that to authenticate or is there a better way to solve this that doesn't use an extra request.
  2. I'm working making a module integrating monolog into processwire now. When hooking into WireLog I can intercept most logs. Except for fatal errors. These dont go through WireLog but are sent from WireShutdown to FileLog directly. I don't really know if there is a way to intercept these without hacking the core. Does anyone have an idea?
  3. @BitPoet I'm quite interested in this as we have lots of problems with performance for file logs. Did you make any progress since you posted this?
  4. What are the differences between using the including and bootstrapping and multi-instance approach for using ProcessWire in an external script? Obviously multi-instance would let you use more than one installation and in my environment multi-instance seems to perform (much) better under load. Why would I choose one over the other?
  5. Added namespace but sadly it doesn't change the result. [EDIT] I solved it by restoring a backup. Still kinda strange...
  6. All of a sudden Bootstrapping processwire doesn't work anymore. This morning it was working fine but now it isn't. I made the following file to test. <?php // Bootstrap ProcessWire include("../index.php"); echo 'success'; When I open this in the browser (debug mode on) I get a 'connection reset' timeout. When I start it from the command line I get a bunch of notices and warnings regarding the session that don't show if I disable sessions. (I read in another topic these are normal) After that the process just hangs indefinitely somewhere in the boot process. The website seems to function normally otherwise. There are no related errors in the logs. Where to go from here.
  7. Ok I sort of found out what was the reason is and that that was also causing some other problem I've been trying to figure out. My site is hosted on an NFS volume and because of some delays between the server and the nfs volume things go wrong under load. If the load is somewhat bigger it causes my website to stop responding at all. Leaving the database full of sleeping processes. My fix for now is immidiatly returning from afterPageView(HookEvent $e) in the LazyCron.module. This obviously solves both problems. But I like to solve it in a better way: Does the core need LazyCron? And is there some way I can make LazyCron use the database instead of the filesystem?
  8. I tried setting it to: $this->set('lockSeconds', 1); // max number of seconds to wait to obtain DB row lock $this->set('retrySeconds', 1); // seconds after which to retry on a lock fail And after a load test with https://github.com/rakyll/hey It seems to improve things from handeling max 10 requests per second (continiously) to about 35. A few questions:. What would be the downside of this? Why is it this high in the first place?
  9. I have a site with user login using the LoginRegisterPro module. Where I host an embedded youtube livestream (weekly). On that page I track the users activity using AJAX storing the time they spend on the page and what they vote for in a live poll(also using AJAX). Often it works without issue (mostly around 150 users) But when we go over about 200-300 concurrent users things started to slow down and I got hundereds of these errors: Error: Exception: Unable to obtain lock for session (retry in 30s) (in /path/to/wire/modules/Session/SessionHandlerDB/SessionHandlerDB.module line 96) After a while the site stopped responding. What can I do to solve this?
  10. Thanks! I can work around it for now. Issue opened: https://github.com/processwire/processwire-issues/issues/1247
  11. I'm trying to get the last url segment with the new API and when I try to access the last segment I get the one second to last. For example in the url: https://domain.com/page/seg1/seg2/seg3/seg4/ $input->urlSegment(-1) and $input->urlSegmentLast return "seg3" $input->urlSegment(-2) returns "seg2" $input->urlSegment(-3) returns "seg1" as expected: $input->urlSegment(1) returns "seg1" $input->urlSegment(4) returns "seg4" I tried the following $input->urlSegment(0) returns "seg1" $input->urlSegment(-0) returns "seg1" What's going wrong here? I'm using ProcessWire: 3.0.165
  12. Ok it's a different error now in tracy logs: PHP Warning: file_put_contents(): Exclusive locks are not supported for this stream
  13. @ryan In this version if you try to access an unpublished page that is selected in a page reference field like this: $page->page_ref_field; It returns false. In 3.0.153 it returns the (unpublished) page object. I don't know if this is expected behavior but it will break some things in my site. EDIT: Found the issue: This behaviour was changed in 3.0.155 -> https://github.com/processwire/processwire-issues/issues/1159
  14. Setting a custom placeholder (or a default value) would be useful for my site too.
  15. This could be useful: https://github.com/spatie/calendar-links
  16. I often get this error: Unable to write lock file: /site/assets/cache/LazyCronLock.cache In tracy logs: PHP Warning: file_put_contents(/path/to/site/assets/cache/LazyCron.cache): failed to open stream: Access denied in /path/to/wire/modules/LazyCron.module:209 I tried to give the site/assets/cache folder 777 permissions but this doesn't solve it.
  17. Ok so I changed it to something like: $rf = $p->repeater_field->get("fieldA=$user"); $rf->of(false); if($rf) { $p->a_page_reference_field->add($user); $p->of(false); $p->save(); } And now there is no exception. I seems strange to me that its neccesary to set of(false) on the repeater item/page when I'm not changing it.
  18. What I'm trying to do in my template is the following. Get a specific page ($p) then(simplified): if($p->repeater_field->has("fieldA=$user")) { $p->a_page_reference_field->add($user); $p->of(false); $p->save(); } The code seems to work but it gives an exception: Can’t save page 9885: path for repeater page: Call $page->of(false); before getting/setting values that will be modified and saved. [fieldA] (in /wire/core/PagesEditor.php line 438) Can someone help me?
  19. I'm trying to add a (required) unique text field to my registration form using the LoginRegister module. (Like e-mail and user name) I tried using FieldtypeTextUnique but of course its's not that simple. That just adds the user with an empty field if it exists already. I figure I have to hook a function somewhere or something but don't know how to go about that.
  20. Thanks that solved the logout issue. The IP issue is still a question mark though.
  21. I'm being immediately logged out of the admin. This is my session log. (I just removed my site URL) 2018-10-10 11:24:46 ? ? User 'admin' - Error: Session fingerprint changed (IP address or useragent) (IP: 213.211.155.96) 2018-10-10 11:24:54 admin [site URL] Successful login for 'admin' 2018-10-10 11:24:57 ? ? User 'admin' - Error: Session fingerprint changed (IP address or useragent) (IP: 0.0.0.0) 2018-10-10 11:32:59 admin [site URL] Successful login for 'admin' The one ip is correct but why does my IP change to 0.0.0.0? That seems weird.
  22. I'm getting timed out errors when I try to install modules or check for updates. I'm fairly certain the problem is that the host that i'm on uses a proxy for external http requests. Is there a setting somewhere like the following in wordpress? (I'm already prettty sure there isn't) define('WP_PROXY_HOST', 'proxy.domain.com'); define('WP_PROXY_PORT', '8080'); I tried adding : 'proxy' => 'tcp://proxy.domain.com:8080', 'request_fulluri' => true to the $options in the send() function in WireHttp. This makes the update check work but the download still fails. Any help?
×
×
  • Create New...