Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,586
    Plugin Contributions
    30

    Default Auto update of SESSION_WRITE_DIRECTORY not always working

    While chasing my tail investigating an unrelated issue I noticed this constant was not being updated.

    I had several development copies of my shop (in addition to the real one) installed on the same server including one in a subdirectory, and was exporting/importing the databases between them.

    This code checks for the existence of the cache directory as defined by the db constant:
    PHP Code:
    if (!file_exists(SESSION_WRITE_DIRECTORY) || !is_writable(SESSION_WRITE_DIRECTORY)) { 
    since in my case, this directory did exist and was writeable (albeit elsewhere on the server), the constant never got updated to the correct path inside the directory structure of that particular instance of the shop.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  2. #2
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Auto update of SESSION_WRITE_DIRECTORY not always working

    Quote Originally Posted by torvista View Post
    While chasing my tail investigating an unrelated issue I noticed this constant was not being updated.

    I had several development copies of my shop (in addition to the real one) installed on the same server including one in a subdirectory, and was exporting/importing the databases between them.

    This code checks for the existence of the cache directory as defined by the db constant:
    PHP Code:
    if (!file_exists(SESSION_WRITE_DIRECTORY) || !is_writable(SESSION_WRITE_DIRECTORY)) { 
    since in my case, this directory did exist and was writeable (albeit elsewhere on the server), the constant never got updated to the correct path inside the directory structure of that particular instance of the shop.
    Forgive me for not being able to look up the variable that is assigned in the configure.php file(s), but I'm assuming that it is of a different name, and that the suggestion is that the database provided path be compared with the path of the configure.php file(s) and if not equivalent to update, that comparison anded with the above or group...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,586
    Plugin Contributions
    30

    Default Re: Auto update of SESSION_WRITE_DIRECTORY not always working

    Forgive me for not being able to look up the variable that is assigned in the configure.php file(s),

    DIR_FS_SQL_CACHE

    but I'm assuming that it is of a different name, and that the suggestion is that the database provided path be compared with the path of the configure.php file(s) and if not equivalent to update, that comparison anded with the above or group...
    Well summarised! This is what the manually-run fix-cache_key.php did, prior to 1.53.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  4. #4
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Auto update of SESSION_WRITE_DIRECTORY not always working

    Quote Originally Posted by torvista View Post

    DIR_FS_SQL_CACHE

    Well summarised! This is what the manually-run fix-cache_key.php did, prior to 1.53.
    After (and really while) making the above suggestion was thinking about the overall scheme of things. There is a condition that wouldn't be met if the change is made as much as isn't met right now. Scenarios run like this. If nothing is changed, the key works fine for stores that are duplicated away from the production store's cache directory if the duplicate site (not really suggested in any of the FAQs for making a "backup" of a site) is located elsewhere in the host's path but uses the original database. If the change is made to what it was/suggested, then it would almost be paramount (I think) for two stores not to share the same database as "confusion" is likely to ensue. Don't know if an additional switch would be needed in the admin to control this "functionality", or if it would need to be something coded in a file as a result of the sharing/not sharing the database. Sorry, started going down a rabbit hole and now want to get out. :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,586
    Plugin Contributions
    30

    Default Re: Auto update of SESSION_WRITE_DIRECTORY not always working

    It just seems to me that any installation fileset should be self-contained.
    If you have multiple shops on the same server, whether duplicates/backups or different shops entirely, this will not auto-update to the "correct" location in the relevant fileset if the folder in SESSION_WRITE_DIRECTORY already exists anywhere else, which seems incorrect to me.

    I'll let the the great and the good argue the toss/go down the rabbit hole, I was just pointing out the anomaly.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  6. #6
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Auto update of SESSION_WRITE_DIRECTORY not always working

    Quote Originally Posted by torvista View Post
    It just seems to me that any installation fileset should be self-contained.
    If you have multiple shops on the same server, whether duplicates/backups or different shops entirely, this will not auto-update to the "correct" location in the relevant fileset if the folder in SESSION_WRITE_DIRECTORY already exists anywhere else, which seems incorrect to me.

    I'll let the the great and the good argue the toss/go down the rabbit hole, I was just pointing out the anomaly.
    Seemed like a good find to me. Wondering if this section of code didn't get updated upon earlier determination of how to "properly" restore the setting, or if there was a true background reason for it.

    Being community oriented, I merely wanted to point out some "issues" that possibly could occur nd may need to be documented or otherwise handled.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. v151 template overrides not always working?
    By kevinman4404 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 19 Jan 2014, 12:22 AM
  2. v139g 5 currencies on site not always working
    By irishshopper in forum General Questions
    Replies: 1
    Last Post: 24 Aug 2013, 02:27 AM
  3. AustPost Letter rates not working - always $52
    By brianosc in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 23 Jan 2008, 02:52 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR