{"action":"created","issue":{"url":"https://api.github.com/repos/zencart/zencart/issues/1228","repository_url":"https://api.github.com/repos/zencart/zencart","labels_url":"https://api.github.com/repos/zencart/zencart/issues/1228/labels{/name}","comments_url":"https://api.github.com/repos/zencart/zencart/issues/1228/comments","events_url":"https://api.github.com/repos/zencart/zencart/issues/1228/events","html_url":"https://github.com/zencart/zencart/issues/1228","id":173284069,"number":1228,"title":"Unpredictable auto_loader load order due to operating system differences","user":{"login":"lat9","id":2685585,"avatar_url":"https://avatars.githubusercontent.com/u/2685585?v=3","gravatar_id":"","url":"https://api.github.com/users/lat9","html_url":"https://github.com/lat9","followers_url":"https://api.github.com/users/lat9/followers","following_url":"https://api.github.com/users/lat9/following{/other_user}","gists_url":"https://api.github.com/users/lat9/gists{/gist_id}","starred_url":"https://api.github.com/users/lat9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lat9/subscriptions","organizations_url":"https://api.github.com/users/lat9/orgs","repos_url":"https://api.github.com/users/lat9/repos","events_url":"https://api.github.com/users/lat9/events{/privacy}","received_events_url":"https://api.github.com/users/lat9/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-25T19:05:02Z","updated_at":"2016-08-25T19:33:41Z","closed_at":null,"body":"Since `/includes/initsystem.php` makes use of the PHP `dir` function to load the files present in the /includes/auto_loaders directory, there's no guarantee that the file named aaa.php loads before aaa_other.php, which can result in unwanted results.\r\n\r\nPer the PHP documentation for the dir function: `The order in which directory entries are returned by the read method is system-dependent. `\r\n\r\nIf, on some Linux systems, the file aaa_other.php was copied to the server **before** aaa.php, the aaa_other.php file will load first.\r\n\r\nIt would be \"a good thing\" from a support-ability/development standpoint if the load-order was predictable, as it would be if the module used the PHP `glob` function which returns the files in ascending alpha sort-order."},"comment":{"url":"https://api.github.com/repos/zencart/zencart/issues/comments/242510090","html_url":"https://github.com/zencart/zencart/issues/1228#issuecomment-242510090","issue_url":"https://api.github.com/repos/zencart/zencart/issues/1228","id":242510090,"user":{"login":"lat9","id":2685585,"avatar_url":"https://avatars.githubusercontent.com/u/2685585?v=3","gravatar_id":"","url":"https://api.github.com/users/lat9","html_url":"https://github.com/lat9","followers_url":"https://api.github.com/users/lat9/followers","following_url":"https://api.github.com/users/lat9/following{/other_user}","gists_url":"https://api.github.com/users/lat9/gists{/gist_id}","starred_url":"https://api.github.com/users/lat9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lat9/subscriptions","organizations_url":"https://api.github.com/users/lat9/orgs","repos_url":"https://api.github.com/users/lat9/repos","events_url":"https://api.github.com/users/lat9/events{/privacy}","received_events_url":"https://api.github.com/users/lat9/received_events","type":"User","site_admin":false},"created_at":"2016-08-25T19:33:41Z","updated_at":"2016-08-25T19:33:41Z","body":"I was tracking down a report where the \"Price/Weight\" add-on to my \"Products' Options' Stock Manager\" was not working.\r\n\r\nThe base plugin's auto_loader is named config.products_options_stock.php and the add-on's auto_loader is named config.products_options_stock_pw.php.  On Windoze systems (like my local testbed), those files load in that order; unfortunately, on the client's Unix system that was not the case.\r\n\r\nFWIW, the add-on's observer class (on load) makes an instance of the _presumed_ base plugin's observer for its use ... and wasn't working properly because the add-on's config was loaded before the base.  Both observers were being loaded at the same auto-load checkpoint since I'd ass-u-me'd that the distinction in the config-files' names would be enough.\r\n\r\nI'm preparing an update that causes the base plugin to be loaded one-tick earlier in the auto-load chain to work around the issue."}}
{"actor":{"display_login":"lat9"}}