{"action":"closed","issue":{"url":"https://api.github.com/repos/plainmade/unmark/issues/89","labels_url":"https://api.github.com/repos/plainmade/unmark/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/plainmade/unmark/issues/89/comments","events_url":"https://api.github.com/repos/plainmade/unmark/issues/89/events","html_url":"https://github.com/plainmade/unmark/issues/89","id":56002943,"number":89,"title":"environment constant logic","user":{"login":"williamknauss","id":2041571,"avatar_url":"https://avatars.githubusercontent.com/u/2041571?v=3","gravatar_id":"","url":"https://api.github.com/users/williamknauss","html_url":"https://github.com/williamknauss","followers_url":"https://api.github.com/users/williamknauss/followers","following_url":"https://api.github.com/users/williamknauss/following{/other_user}","gists_url":"https://api.github.com/users/williamknauss/gists{/gist_id}","starred_url":"https://api.github.com/users/williamknauss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamknauss/subscriptions","organizations_url":"https://api.github.com/users/williamknauss/orgs","repos_url":"https://api.github.com/users/williamknauss/repos","events_url":"https://api.github.com/users/williamknauss/events{/privacy}","received_events_url":"https://api.github.com/users/williamknauss/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/plainmade/unmark/labels/logic","name":"logic","color":"eb6420"},{"url":"https://api.github.com/repos/plainmade/unmark/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":{"login":"cdevroe","id":19237,"avatar_url":"https://avatars.githubusercontent.com/u/19237?v=3","gravatar_id":"","url":"https://api.github.com/users/cdevroe","html_url":"https://github.com/cdevroe","followers_url":"https://api.github.com/users/cdevroe/followers","following_url":"https://api.github.com/users/cdevroe/following{/other_user}","gists_url":"https://api.github.com/users/cdevroe/gists{/gist_id}","starred_url":"https://api.github.com/users/cdevroe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdevroe/subscriptions","organizations_url":"https://api.github.com/users/cdevroe/orgs","repos_url":"https://api.github.com/users/cdevroe/repos","events_url":"https://api.github.com/users/cdevroe/events{/privacy}","received_events_url":"https://api.github.com/users/cdevroe/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/plainmade/unmark/milestones/8","labels_url":"https://api.github.com/repos/plainmade/unmark/milestones/8/labels","id":967612,"number":8,"title":"1.6.3","description":"Slated to be more set up issue fixes.","creator":{"login":"cdevroe","id":19237,"avatar_url":"https://avatars.githubusercontent.com/u/19237?v=3","gravatar_id":"","url":"https://api.github.com/users/cdevroe","html_url":"https://github.com/cdevroe","followers_url":"https://api.github.com/users/cdevroe/followers","following_url":"https://api.github.com/users/cdevroe/following{/other_user}","gists_url":"https://api.github.com/users/cdevroe/gists{/gist_id}","starred_url":"https://api.github.com/users/cdevroe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdevroe/subscriptions","organizations_url":"https://api.github.com/users/cdevroe/orgs","repos_url":"https://api.github.com/users/cdevroe/repos","events_url":"https://api.github.com/users/cdevroe/events{/privacy}","received_events_url":"https://api.github.com/users/cdevroe/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":3,"state":"open","created_at":"2015-02-05T19:33:51Z","updated_at":"2015-02-18T20:03:34Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-01-30T07:25:55Z","updated_at":"2015-02-18T20:03:34Z","closed_at":"2015-02-18T20:03:34Z","body":"If I could create labels I would put \"logic\" on this issue.\r\n\r\nI would say the logic to determine the \"ENVIRONMENT\" is well a bit jumbled.\r\n\r\nFirst you check to see if an application configuration file exists (environment.php), then you check UNMARK_ENV_CONFIG_GLOBAL constant (path), and if ENVIRONMENT is still not set you default it to \"production\".\r\n\r\nWould it be to bold to suggest to drop all of the logic and replace it with something simpler, maybe something along these lines:\r\n```php\r\nif (isset($_SERVER['UNMARK_ENV_PATH'])) {\r\n    if (is_readable($_SERVER['UNMARK_ENV_PATH'])) {\r\n        include_once($_SERVER['UNMARK_ENV_PATH']);\r\n    }\r\n}\r\n\r\n\r\nif (!defined('ENVIRONMENT')) {\r\n   define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'production');\r\n}\r\n```\r\n\r\nA solution like this would provide cleaner code and still grant the flexibility of having 1 configuration file shared among many different installs. (In direct reference to /etc/unmark/environment.php)\r\n\r\nThoughts, ideas, feedback?\r\n"}}