Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by seddass

  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
  13. Thanks, Alan! I have read the requirements but I wasn't sure if nginx is 100% apache compatible. Thanks anyway. Also.. I have read about the satisfaction guarantee and I have no doubts that this module worth every $. I will buy it asap.
  14. Ryan, the tests results are fantastic. Does ProCache supports nginx? I guess that the rewrite rules can be modified accordingly. is there anything Apache specific?
  15. I mean urlSegments, sorry. You understood me correctly. I was thinking if we could use a two session variables like "editablePage" and "redirectAfterSave" and to check if they exists before opening the AdminBar and after page save. I am not sure about any other way except session variables, probably you will have a better idea? About the example context.... Lets assume we are storing our products pages in Home >> Products as children. Also... we have categories stored in Home >> Categories and each Product page has a few Categories attached. If we are browsing the www.example.com/categories/category_name/product_name/ we will see the product details page but actually if we open AdminBar we will edit www.example.com/categories/category_name/ if "/product_name/" is urlSegment1. I am not sure if it is the best example, it is not the real one, but I am sure you understood me correctly. What do you think? Should we use session variables or there is another way to pass php variables internally?
  16. Does AdminBar support editing of pages different than currently visible in the browser? In other words.. If the visible page exist elsewhere in the PW but it is included and rendered based on a one or more segments.. is it possible to pass the real page->id to the AdminBar for editing instead of the page->id of the page with segments? Of course.. it will be great if after Save it returns to the initially displayed page with segments. Is it possible and/or easy to implement? Thanks!
  17. Thanks Ryan! I would like to remind about the second part of my post, about using PW with other than allowed (a-z-.) characters in the URLs. It seems that Google prioritize such sites compared to their competitors. Do you think it will be possible in some of the PW future releases and if it will worth the effort?
  18. Thanks MadeMyDay, the most of the cyrillic characters are already there by default. Meanwhile I have found that the PageName input field replacement was NOT enabled by default in $sanitizer->pageName(). I have modified the Pages->setupNew() method to enable it and this allowed me to use "Create new" feature with not (a-z) characters.
  19. Hi all, I am trying to create a tags functionality for hotel features, like "pool, sauna, etc", and the new tags to be created automatically when entered for the first time. The specific is that tags titles should to be with cyrillic characters. I was hoping that PageAutocomplete will be ideal for tags system, but it doesn't support searching with cyrillic chars on keypress Unfortunately "Create new" feature in Page input field doesn't support saving the items with cyrillic characters in their title, because it cant replace them automatically to their (a-z) equivalents for the "name" field. 1. Is there an easy way to use the PageName character replacement feature when using "Create new" in Page input field? Dont you think it will be great if sanitizer->name support such replacement internally? 2. And something related.. Someday I will ask if PW will support not (a-z) characters in URLs. I know that there are standarts and the cyrillic chars are not included in allowed chars. However... when searching for something in cyrillic, many of the Google results contain cyr characters in their URL. Probably we should to be competitive in SEO point of view and to be allowed to use the not a-z characters in the URL? The same for other specific chars in German and other languages. What do you think? Thanks
  20. I am wandering to find out if it is easy something like: "..., sort=template, ..." or "..., sort=template.name, ..." for sorting the pages by their template name in selectors result. When it will be useful: 1. My clients were asking to display the professors first, then doctors, then students in the paginated staff list. 2. Other clients requested to display products pages first in the site search results. I know I could use two search selectors and to concatenate their PageArrays but it will be more complicated with the pagination. I could use a dropdown with "search in products", "search in site" too.
  21. I mean.. when the clients are entering values from products list table.. it will be great if they could duplicate the existing row with fields and to change only a few values (like size & price) of them. Just a suggestion. It will e an easy way for entering price tables. thanks a
  • Create New...