{"id":18,"date":"2014-08-24T03:21:33","date_gmt":"2014-08-24T03:21:33","guid":{"rendered":"https:\/\/www.tech.shinynewthings.com\/?p=18"},"modified":"2014-08-24T03:21:33","modified_gmt":"2014-08-24T03:21:33","slug":"project-configuration-files","status":"publish","type":"post","link":"https:\/\/www.tech.shinynewthings.com\/?p=18","title":{"rendered":"Project Configuration files"},"content":{"rendered":"<p>At the root of any good app is a set of good configuration files. This is the path configuration file from the minimalistic PHP framework I created for my freelance work. It is one of the first files loaded and is used to set the primary paths that are used throughout the code base.<br \/>\n<code><br \/>\n&lt;?php<br \/>\n\/\/ UNCOMMENT FOR DEVELOPMENT<br \/>\n\/\/error_reporting(E_ALL);<\/p>\n<p>\/\/ PATH DEFINITIONS<br \/>\n\/\/ TELL PHP THE DIRECTOR SEPARATOR FOR WINDOWS == \\ UNIX == \/<br \/>\ndefined('DS') ? null : define('DS', DIRECTORY_SEPARATOR);<\/p>\n<p>\/\/ UNCOMMENT THE LINE BELOW TO GET THE CORRECT WORKING DIRECTORY PATH<br \/>\n\/\/echo getcwd();<\/p>\n<p>\/\/PATH TO THE SITE ROOT<br \/>\ndefined('SITE_ROOT') ? null : define('SITE_ROOT',str_replace(\"system\", \"\", getcwd()));<\/p>\n<p>\/\/PATH TO SYSTEM FILES<br \/>\ndefined('SYSTEM_PATH') ? null : define('SYSTEM_PATH', SITE_ROOT.DS.'system'.DS);<br \/>\ndefined('SYSTEM_INCLUDES_PATH') ? null : define('SYSTEM_INCLUDES_PATH', SITE_ROOT.DS.'system'.DS.'includes'.DS);<br \/>\ndefined('SYSTEM_CLASSES_PATH') ? null : define('SYSTEM_CLASSES_PATH', SITE_ROOT.DS.'system'.DS.'classes'.DS);<\/p>\n<p>\/\/ PATH TO APP FILES<br \/>\ndefined('APP_PATH') ? null : define('APP_PATH', SITE_ROOT.DS.'app'.DS);<br \/>\ndefined('APP_IMAGES_PATH') ? null : define('APP_IMAGES_PATH', SITE_ROOT.DS.'app'.DS.'images'.DS);<br \/>\ndefined('INCLUDES_PATH') ? null : define('INCLUDES_PATH', SITE_ROOT.DS.'app'.DS.'includes'.DS);<br \/>\ndefined('CLASSES_PATH') ? null : define('CLASSES_PATH', SITE_ROOT.DS.'app'.DS.'classes'.DS);<br \/>\ndefined('CONTROLLERS_PATH') ? null : define('CONTROLLERS_PATH', SITE_ROOT.DS.'app'.DS.'controllers'.DS);<br \/>\ndefined('MODELS_PATH') ? null : define('MODELS_PATH', SITE_ROOT.DS.'app'.DS.'models'.DS);<br \/>\ndefined('VIEWS_PATH') ? null : define('VIEWS_PATH', SITE_ROOT.DS.'app'.DS.'views'.DS);<br \/>\ndefined('JS_PATH') ? null : define('JS_PATH', SITE_ROOT.DS.DS.'app'.'js'.DS);<br \/>\ndefined('CSS_PATH') ? null : define('CSS_PATH', SITE_ROOT.DS.'app'.DS.'css'.DS);<\/p>\n<p>?&gt;<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>At the root of any good app is a set of good configuration files. This is the path configuration file from the minimalistic PHP framework I created for my freelance work. It is one of the first files loaded and is used to set the primary paths that are used throughout the code base. &lt;?php [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-18","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts\/18","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18"}],"version-history":[{"count":6,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts\/18\/revisions"}],"predecessor-version":[{"id":24,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts\/18\/revisions\/24"}],"wp:attachment":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}