Advertisement
rfv123

Simple Application bootstrap file

Feb 10th, 2016
561
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.45 KB | None | 0 0
  1. <?php
  2. /*
  3.  * file: __bootstrap__.php
  4.  * place this file in `document root` as __bootstrap__.php
  5.  
  6.  * As the first line in any script executed from the internet put:
  7.  * include_once $_SERVER['DOCUMENT_ROOT'] .'/__bootstrap__.php';
  8.  */
  9.  
  10. /* ---------------------------------------------------------------------------
  11.  * 'APP_HOME_ROOT' is a defined constant that has the complete path to the
  12.  *                 directory that holds the complete application
  13.  *                
  14.  *  All the other directory paths used are defined from this.
  15.  *  
  16.  *  It makes it very easy for me to move from windows to Linux.
  17.  *          
  18.  *  Assume in root directory.
  19.  *
  20.  *  My version is run from a fixed directory under the 'application home directory'.
  21.  *
  22.  *  see: https://www.binpress.com/tutorial/php-bootstrapping-crash-course/146
  23.  */
  24.  
  25.  
  26. define('APP_HOME_ROOT', __DIR__ .'/'); // access all files based on this... simplifies moving to linux later
  27.  
  28. // Directory Constants so easy to move between o/s
  29. define('APP_VENDOR_ROOT',     APP_HOME_ROOT .'vendor/');
  30.  
  31. // used by testing setup
  32. // define('APP_BOOTSTRAP_ROOT',  APP_HOME_ROOT .'__bootstrap__/');
  33.  
  34. // this is always true
  35. define('LIVE_HOME_ROOT',      APP_HOME_ROOT);
  36.  
  37. // this is always true
  38. define('DEV_HOME_ROOT',       APP_HOME_ROOT);
  39.  
  40. // this is always true
  41. define('DEVTEST_HOME_ROOT',   APP_HOME_ROOT .'tests/');
  42.  
  43. // true for now
  44. define('SYSTEST_HOME_ROOT',   APP_HOME_ROOT .'tests/');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement