{"action":"created","issue":{"url":"https://api.github.com/repos/gikeymarcia/Collector/issues/110","labels_url":"https://api.github.com/repos/gikeymarcia/Collector/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/gikeymarcia/Collector/issues/110/comments","events_url":"https://api.github.com/repos/gikeymarcia/Collector/issues/110/events","html_url":"https://github.com/gikeymarcia/Collector/issues/110","id":94874665,"number":110,"title":"Settings as INIs","user":{"login":"adamblake","id":6201730,"avatar_url":"https://avatars.githubusercontent.com/u/6201730?v=3","gravatar_id":"","url":"https://api.github.com/users/adamblake","html_url":"https://github.com/adamblake","followers_url":"https://api.github.com/users/adamblake/followers","following_url":"https://api.github.com/users/adamblake/following{/other_user}","gists_url":"https://api.github.com/users/adamblake/gists{/gist_id}","starred_url":"https://api.github.com/users/adamblake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamblake/subscriptions","organizations_url":"https://api.github.com/users/adamblake/orgs","repos_url":"https://api.github.com/users/adamblake/repos","events_url":"https://api.github.com/users/adamblake/events{/privacy}","received_events_url":"https://api.github.com/users/adamblake/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gikeymarcia/Collector/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"adamblake","id":6201730,"avatar_url":"https://avatars.githubusercontent.com/u/6201730?v=3","gravatar_id":"","url":"https://api.github.com/users/adamblake","html_url":"https://github.com/adamblake","followers_url":"https://api.github.com/users/adamblake/followers","following_url":"https://api.github.com/users/adamblake/following{/other_user}","gists_url":"https://api.github.com/users/adamblake/gists{/gist_id}","starred_url":"https://api.github.com/users/adamblake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamblake/subscriptions","organizations_url":"https://api.github.com/users/adamblake/orgs","repos_url":"https://api.github.com/users/adamblake/repos","events_url":"https://api.github.com/users/adamblake/events{/privacy}","received_events_url":"https://api.github.com/users/adamblake/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/gikeymarcia/Collector/milestones/1","html_url":"https://github.com/gikeymarcia/Collector/milestones/Collector%202.0","labels_url":"https://api.github.com/repos/gikeymarcia/Collector/milestones/1/labels","id":972990,"number":1,"title":"Collector 2.0","description":"Big release with lots of new features/bugfixes.  Will require some re-education, will likely break compatibility with lots of old stuff.","creator":{"login":"gikeymarcia","id":1952096,"avatar_url":"https://avatars.githubusercontent.com/u/1952096?v=3","gravatar_id":"","url":"https://api.github.com/users/gikeymarcia","html_url":"https://github.com/gikeymarcia","followers_url":"https://api.github.com/users/gikeymarcia/followers","following_url":"https://api.github.com/users/gikeymarcia/following{/other_user}","gists_url":"https://api.github.com/users/gikeymarcia/gists{/gist_id}","starred_url":"https://api.github.com/users/gikeymarcia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gikeymarcia/subscriptions","organizations_url":"https://api.github.com/users/gikeymarcia/orgs","repos_url":"https://api.github.com/users/gikeymarcia/repos","events_url":"https://api.github.com/users/gikeymarcia/events{/privacy}","received_events_url":"https://api.github.com/users/gikeymarcia/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":13,"state":"open","created_at":"2015-02-10T02:51:32Z","updated_at":"2015-07-14T08:31:37Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-07-14T06:04:33Z","updated_at":"2015-07-15T23:58:43Z","closed_at":null,"body":"Settings are currently read as multiple global variables and are set in a PHP file. The file itself would be more readable as an INI, and we can clear up the global namespace clutter by reading them in as one array or class."},"comment":{"url":"https://api.github.com/repos/gikeymarcia/Collector/issues/comments/121779598","html_url":"https://github.com/gikeymarcia/Collector/issues/110#issuecomment-121779598","issue_url":"https://api.github.com/repos/gikeymarcia/Collector/issues/110","id":121779598,"user":{"login":"adamblake","id":6201730,"avatar_url":"https://avatars.githubusercontent.com/u/6201730?v=3","gravatar_id":"","url":"https://api.github.com/users/adamblake","html_url":"https://github.com/adamblake","followers_url":"https://api.github.com/users/adamblake/followers","following_url":"https://api.github.com/users/adamblake/following{/other_user}","gists_url":"https://api.github.com/users/adamblake/gists{/gist_id}","starred_url":"https://api.github.com/users/adamblake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamblake/subscriptions","organizations_url":"https://api.github.com/users/adamblake/orgs","repos_url":"https://api.github.com/users/adamblake/repos","events_url":"https://api.github.com/users/adamblake/events{/privacy}","received_events_url":"https://api.github.com/users/adamblake/received_events","type":"User","site_admin":false},"created_at":"2015-07-15T23:58:42Z","updated_at":"2015-07-15T23:58:42Z","body":"So I've been thinking and rethinking and rethinking again how to handle FileLocations and I was wondering what you guys think about this method of accessing what I'm calling 'named routes':\r\n\r\nGiven INI settings:\r\n```\r\n; This section sets the names of the main folders used in Collector\r\n; The values should be values or relative paths from the root directory\r\n[root_directories]\r\ndata_folder = Data\r\ncode_folder = Code\r\nexpt_folder = Experiment\r\ntool_folder = Tools\r\n\r\n; This section sets the subfolder and file locations in the expt_folder\r\n; The values should be values or relative paths from the expt_folder directory\r\n[expt]\r\nineligibile = Ineligible\r\nstim_files  = ../Stimuli \r\nproc_files  = Procedure\r\n\r\n\r\netc., etc., etc.\r\n```\r\n\r\nThe PHP:\r\n```\r\n$_paths->expt;                 // returns \"path/to/Experiment\"\r\n$_paths->expt->stim_files;  // returns \"path/to/Experiment/../Stimuli\r\n```\r\nThis allows for non-unique filenames and directories as long as they are not at the root level, but you do have to remember where the file or directory is relative to the ```root_directories```. It's also possible to add a unique named route: ```$_paths->add('unique_name', 'path/to/wherever');``` "}}