{"action":"created","issue":{"url":"https://api.github.com/repos/jacob-grahn/platform-racing-2-server/issues/484","repository_url":"https://api.github.com/repos/jacob-grahn/platform-racing-2-server","labels_url":"https://api.github.com/repos/jacob-grahn/platform-racing-2-server/issues/484/labels{/name}","comments_url":"https://api.github.com/repos/jacob-grahn/platform-racing-2-server/issues/484/comments","events_url":"https://api.github.com/repos/jacob-grahn/platform-racing-2-server/issues/484/events","html_url":"https://github.com/jacob-grahn/platform-racing-2-server/pull/484","id":322682161,"number":484,"title":"Organipocalypse pt. 3","user":{"login":"bls1999","id":5680237,"avatar_url":"https://avatars1.githubusercontent.com/u/5680237?v=4","gravatar_id":"","url":"https://api.github.com/users/bls1999","html_url":"https://github.com/bls1999","followers_url":"https://api.github.com/users/bls1999/followers","following_url":"https://api.github.com/users/bls1999/following{/other_user}","gists_url":"https://api.github.com/users/bls1999/gists{/gist_id}","starred_url":"https://api.github.com/users/bls1999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bls1999/subscriptions","organizations_url":"https://api.github.com/users/bls1999/orgs","repos_url":"https://api.github.com/users/bls1999/repos","events_url":"https://api.github.com/users/bls1999/events{/privacy}","received_events_url":"https://api.github.com/users/bls1999/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-14T06:00:36Z","updated_at":"2018-05-14T15:06:17Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/jacob-grahn/platform-racing-2-server/pulls/484","html_url":"https://github.com/jacob-grahn/platform-racing-2-server/pull/484","diff_url":"https://github.com/jacob-grahn/platform-racing-2-server/pull/484.diff","patch_url":"https://github.com/jacob-grahn/platform-racing-2-server/pull/484.patch"},"body":"Alright... this is the big one.\r\n\r\nFirst thing's first... **_This pull REQUIRES a server configuration edit._**\r\nWithout this change, EVERY FILE in platform-racing-2-server will break.\r\n\r\nThe goal is to tell nginx to load config.php every time a php command or client request is made.\r\nAdd the following line within the \"location ~ \\.php$\" block of your server configuration:\r\n\r\n```\r\nfastcgi_param PHP_VALUE \"auto_prepend_file=/full/path/to/this/file/config.php\";\r\n```\r\n\r\nReplace \"/full/path/to/this/file\" with the full path to config.php (this file).\r\n\r\nFor more information, see these resources:\r\nhttps://stackoverflow.com/questions/26192274/replacement-for-php-htaccess-values-in-nginx\r\nhttps://stackoverflow.com/questions/14884439/automatically-load-a-config-php-file-for-all-pages-before-anything-else\r\n\r\nIn doing this, we can load scripts without requiring them right off the bat. We now also have some useful user-defined constants that we can use instead of using `__DIR__` all the time. A super special added bonus we get by doing this is easier path/organization changes (i.e. we want to move `queries` back to `http_server`; we simply move the folder and change the path's constant).\r\n\r\n___\r\n\r\n*_Changes!_*\r\n\r\nCommon:\r\n - Convert all `require_once` calls to use the constants\r\n - CRON directory moved here\r\n - Queries directory moved here\r\n - s3_connect.php moved here\r\n - Socket management moved into folder within common called /manage_socket/\r\n\r\nSocket Server:\r\n - Condense all process functions into two files:\r\n    - process_fns.php\r\n    - vault_fns.php\r\n - Client functions; either:\r\n    - Move into `/fns/client/`, or\r\n    - Condense into `/fns/client/client_misc_fns.php`\r\n - Add new process functions (`process_message_player`, `process_activate_happy_hour`)\r\n - Add new socket management functions (`restart_server`, `restart_servers`, `check_servers`)\r\n - Rework existing socket management functions (improve outputs, consolidate multiple socket-related cron jobs to functions inside the normal cron folder)\r\n - Add /priors for lazy mods (looking at @a7x3 on this one). I tested and it seems to load the data almost immediately, so I don't think we need to worry about the server slowing down.\r\n\r\nHTTP Server:\r\n - Completely rework/organize the fns directory\r\n - Move all files that contain functions from `/www/` to `/fns/`\r\n - Add `die()` at the end of all scripts to make sure the file is good and dead at the end of execution\r\n\r\nTo-Do:\r\n - Improve socket server responses when using `talk_to_server`, outputs, etc.\r\n - [Possibly] arrange the PR2 class files into folders (haven't decided on this one yet; do you have a preference?)\r\n - I had another good idea but of course I have forgotten it. Oh well; if it was a prolific idea, it should come back to me at some point. `¯\\_(ツ)_/¯`\r\n\r\nPersonally, I see the organipocalypse as an ongoing effort to keep the repo organized. I will technically be finished with the organipocalypse at some point; However, it's up to us (the contributors) to keep the repo organized so we don't need another organipocalypse.\r\n\r\nFinally, @jacob-grahn, If anything I've done makes you uneasy, let me know what I can do to change it. I don't want to twist your arm here; it's your code so you should decide how it's structured."},"comment":{"url":"https://api.github.com/repos/jacob-grahn/platform-racing-2-server/issues/comments/388850881","html_url":"https://github.com/jacob-grahn/platform-racing-2-server/pull/484#issuecomment-388850881","issue_url":"https://api.github.com/repos/jacob-grahn/platform-racing-2-server/issues/484","id":388850881,"user":{"login":"jacob-grahn","id":4753008,"avatar_url":"https://avatars1.githubusercontent.com/u/4753008?v=4","gravatar_id":"","url":"https://api.github.com/users/jacob-grahn","html_url":"https://github.com/jacob-grahn","followers_url":"https://api.github.com/users/jacob-grahn/followers","following_url":"https://api.github.com/users/jacob-grahn/following{/other_user}","gists_url":"https://api.github.com/users/jacob-grahn/gists{/gist_id}","starred_url":"https://api.github.com/users/jacob-grahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacob-grahn/subscriptions","organizations_url":"https://api.github.com/users/jacob-grahn/orgs","repos_url":"https://api.github.com/users/jacob-grahn/repos","events_url":"https://api.github.com/users/jacob-grahn/events{/privacy}","received_events_url":"https://api.github.com/users/jacob-grahn/received_events","type":"User","site_admin":false},"created_at":"2018-05-14T15:06:17Z","updated_at":"2018-05-14T15:06:17Z","author_association":"OWNER","body":"Cool, I'll do some homework on this one. :smile: "}}
{"actor":{"display_login":"jacob-grahn"}}