Jump to content

seddass

Members
  • Posts

    69
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

4,514 profile views

seddass's Achievements

Full Member

Full Member (4/6)

21

Reputation

  1. I just created an issue because of Fatal error: Maximum function nesting level of '1000' reached,
  2. @Hosted Power The 'session_handler_redis.php' will change your session handler. By changing the default session handler you may store your session data in files, in database, redis, memcache, etc. You can use it in any PHP project, with any CMS or framework. Include it at the beginning of your index.php or header.php, before your session_start(); Of course, you may have to tweak the port and/or socket path. Make sure you have "php_redis" extension installed for greater performance. You may need to edit the file if you don't have igbinary_serializer extension installed. I am busy too and hopefully, one rainy weekend I will focus on converting it as PW module with Karl_T. Meanwhile, you have a working solution and despite it's not as a module yet, it is reliable and you can use it with ProcessWire. Enjoy!
  3. @Karl_T Glad to save your time. If we join forces we can create a great Redis Sess Handler for PW. Hope @netcarver will help too. If it's just occasionally, I would try with strings using TTL (or PTTL) to get their expire time and to sort all the keys in php array. BTW never played with TTL till now. It has to be tested with a lot of sessions. The next feature will be to provide connection support for local socket and to multiple Redis servers with priority and auth. My experience with Redis started when I find out session_id() took 12 seconds because of many sess files.
  4. @Karl_T It's great of what you have done. I can feel your excitement about using Redis. Haven't had the chance to dig deeper into your code but of what I saw, you are not using session lock. Forgive me if I am wrong. I was using phpredis (the php extension) as a global session handler replacement in php.ini , but it lacks support for session lock. I was having trouble because of this and I wrote my own solution attached here. I just prepend it. When using session with files - the files system have lock on write. When using SessionDB - the database has a row or table lock depending on the table engine. Memcache have lock implemented and it's suitable for replacement in php.ini. Of what I saw in the phpredis code, there is no lock and have to be implemented externally. My issue because of this here. This guy here explained more about the session lock and session fixation. Here is the related issue/feature request at GitHub/phpredis. Magento's dev opinion here . Also many recommend igbinary as a php serializer of the session data before to be stored in Redis. Of course, it is not installed by default on a shared hosting. Just as a reminder, there were many ways to decrease the memory usage. Some prefer using "strings" instead of "hashes" as a datatype if not using millions of sessions and shortened keys for memory optimization. Also, just saw a cron job deleting the expired keys. Redis have native key removal for the expired keys and there is no reason for garbage collector or a cron job to delete the old keys. Sorry if I am wrong about your code. I am keen to test it in the morning. Hope this helps. Peace! session_handler_redis.php test_serializers.php
  5. I don't have good memories with sendy.co. It covers the basics needs in affordable price but it is not reliable enough. Just my two cents.
  6. Repeating "I can't" wouldn't help. It will be great if you change your mindset and look for some javascript errors in the browser console or in the code. Don't just copy/paste "everyone's snippets" but try to understand what they are doing. I can confirm that this module is working and used by hundreds. This is all I can say based on your "I can't". Peace!
  7. I have the same error on a site without Languages support enabled. Unable to save to 'field_title' for page that doesn't exist in pages table /projects/app/wire/core/Fieldtype.php == Line: 503 I have a link that sends ajax request to create a page. When I click 2-3 times fast on this link and several ajax requests are fired to the backend I see the error above. The code for creating the page follows: $title = 'item-' . time() . wire('user')->id; $newPage = new Page(); $newPage->template = 'mytemplate'; $newPage->parent = $parentPage; $newPage->name = $title; $newPage->title = $title; $newPage->save(); Still investigating..
  8. Hi all, Hope for a helpful hint and thank you in advance. I am trying to create a form in the frontend with custom markup for the form and the fields. Its all fine, except that I cant find out 1. how to remove the empty "<option></option>" choice and 2. I was wandering if there is a smarter way of making one of the options "selected" in page field using select inputfield. Here is my code: $newPage = new Page(); $newPage->template = 'my_weather'; $field = $fields->get('temp_units'); $inputfield = $field->getInputfield($newPage); $select = $inputfield->getInputfield(); $options = $select->getOptions(); foreach ($options as $key => $val){ $select->removeOption($key); } foreach ($options as $key => $val){ $attr = ($val == 'kg') ? array('selected' => 'selected') : null; $select->addOption($key, $val, $attr); } echo $select->render(); Of course, I could skip render() and output my markup with the options above instead, but it is a quite large form and I prefer to know if this is the right way of getting things done with the API. Thanks!
  9. strtotime() helped and it is fine in PW2.3 too. Thanks, Ryan. In short: $today = date("Y-m-d H:i"); isnt working in PW 2.3 $today = strtotime(date("Y-m-d H:i")); is working in PW 2.3 as datetime selector Anyway.. below is the code All i was trying is to collect the next 3 events that are stored in repeater field in many pages. In other words.. January -> multiple events in one repeater field Feb > multiple events in one repeater field. ... $eventsParent = $pages->get('template=events_parent'); $eventsPages = $eventsParent->children; $events = new PageArray(); foreach ($eventsPages as $eventPage): $events->import($eventPage->event_repeater_field); endforeach; $today = date("Y-m-d H:i"); // good in PW2.2, not working as selector in PW2.3 // $today = strtotime(date("Y-m-d H:i")); // working as expected in PW 2.3 $rows = $events->find("event_datetime>=$today, limit=3"); Thanks again!
  10. nginx doesnt have support to .htaccess files and all of the rewrite rules are stored in (virtual) host config updated manually. The apache rewrite rules have different syntax so they should to be converted to nginx style. I will send my version of the nginx rewrite rules by email. I believe that it will be easy to implement that ProCache will suggest the necessary rewrite riles for nginx too. Just a suggestion.
  11. I will post it here hoping that it is my mistake and it shouldn't be reported as PW issue. I have pages with field "event_datetime" with value similar to: 2013-02-09 19:00 2013-02-10 11:00 2013-02-12 19:00 2013-02-14 19:00 2013-02-15 19:00 2013-02-16 11:00 and code $today = "2013-02-11 21:34"; $rows = $events->find("event_datetime>=$today, limit=3"); in PW2.2.x echo count($rows) will output: 3 in PW2.3 count($rows) is 0 Is it related to the new changes in the Selectors or I have to use another way to do it properly? Thanks in advance.
  12. I bought it too and it seems that the control panel saves the rewrite rules in .htaccess file. It is not supported in nginx so I should to configure in nginx.conf each time I use the control panel but once configured.. it should work in nginx too. Hopefully even faster
×
×
  • Create New...