| 5 | | # include path for your php libs (PEAR etc) |
| 6 | | define("PHP_LIB_ROOT", "/usr/local/lib/php"); |
| 7 | | define("TRAX_ROOT", dirname(dirname(__FILE__)) . "/"); |
| 8 | | define("TRAX_PUBLIC", dirname(dirname(dirname(__FILE__)))."/public"); |
| | 6 | |
| | 7 | /** |
| | 8 | * Location of the PEAR library on this system |
| | 9 | * |
| | 10 | * Set automatically by the Pear installer when you install Trax with |
| | 11 | * the <b>pear install</b> command. If you are prevented from using |
| | 12 | * <b>pear install</b>, change "@PHP-DIR@" by hand to the full filesystem |
| | 13 | * path of the location where you installed the Pear modules needed |
| | 14 | * by Trax. |
| | 15 | */ |
| | 16 | define("PHP_LIB_ROOT", "@PHP-DIR@"); |
| | 17 | |
| | 18 | /** |
| | 19 | * Location of the directories constructed by the <b>trax</b> |
| | 20 | * command. |
| | 21 | */ |
| | 22 | define("TRAX_ROOT", dirname(dirname(__FILE__)) . "/"); |
| | 23 | |
| | 24 | /** |
| | 25 | * Location of the directory exposed to the public by Apache. |
| | 26 | * |
| | 27 | * The <b>trax</b> command generates this as <i>TRAX_ROOT</i>/public/ |
| | 28 | * but you will probably want to move the files in public/ to somewhere under |
| | 29 | * {@link http://httpd.apache.org/docs/2.0/ Apache} |
| | 30 | * {@link http://httpd.apache.org/docs/2.0/mod/core.html#documentroot DocumentRoot}. |
| | 31 | * Change the second argument to the full filesystem path to the |
| | 32 | * directory that holds the files generated in public/ |
| | 33 | */ |
| | 34 | define("TRAX_PUBLIC", dirname(dirname(dirname(__FILE__)))."/public"); |
| | 35 | |
| | 36 | /** |
| | 37 | * Part of URL between domain name and Trax application |
| | 38 | * |
| | 39 | * That part of the browser's URL after the domain name and before |
| | 40 | * the location described by <i>TRAX_PUBLIC</i>. If |
| | 41 | * <i>TRAX_PUBLIC</i> is the same as |
| | 42 | * {@link http://httpd.apache.org/docs/2.0/ Apache} |
| | 43 | * {@link http://httpd.apache.org/docs/2.0/mod/core.html#documentroot DocumentRoot}, |
| | 44 | * then TRAX_URL_PREFIX is null. |
| | 45 | */ |
| 32 | | "vendor" => "vendor" ); |
| 33 | | |
| 34 | | if (substr(PHP_OS, 0, 3) == 'WIN') { |
| 35 | | # Windows |
| 36 | | define("TRAX_PATH_SEPERATOR", ";"); |
| 37 | | } else { |
| 38 | | # Unix |
| 39 | | define("TRAX_PATH_SEPERATOR", ":"); |
| 40 | | } |
| 41 | | |
| 42 | | # Set which file to log php errors to for this application |
| 43 | | # As well in your application you can do error_log("whatever") and it will go to this log file. |
| 44 | | ini_set("log_errors", "On"); |
| 45 | | ini_set("error_log", TRAX_ROOT.$GLOBALS['TRAX_INCLUDES']['log']."/".TRAX_MODE.".log"); |
| 46 | | |
| | 84 | "vendor" => "vendor" ); // FIXME: generated by trax cmd |
| | 85 | |
| | 86 | /** |
| | 87 | * Set how errors are to be logged |
| | 88 | * |
| | 89 | * The 'log_errors' |
| | 90 | * {@link http://www.php.net/manual/en/ref.errorfunc.php PHP configuration setting} |
| | 91 | * determines whether PHP error messages should be sent to the |
| | 92 | * {@link http://httpd.apache.org/docs/2.0/ Apache} |
| | 93 | * {@link http://httpd.apache.org/docs/2.0/logs.html#errorlog error log} |
| | 94 | * (log_errors false) or to the log file defined in the 'error_log' |
| | 95 | * setting (log_errors true). Trax uses a different log file for |
| | 96 | * each of the three modes defined in TRAX_MODE. |
| | 97 | * |
| | 98 | * In your application you can write a message to this log file with |
| | 99 | * the call <b>error_log("</b><i>text of message</i><b>")</b>. |
| | 100 | */ |
| | 101 | ini_set("log_errors", true); |
| | 102 | ini_set("error_log", |
| | 103 | TRAX_ROOT.$GLOBALS['TRAX_INCLUDES']['log']."/".TRAX_MODE.".log"); |
| | 104 | |
| | 105 | /** |
| | 106 | * Whether to generate debugging messages and send errors to the browser |
| | 107 | * |
| | 108 | * The 'display_errors' |
| | 109 | * {@link http://www.php.net/manual/en/ref.errorfunc.php PHP configuration setting} |
| | 110 | * determines whether error messages should be sent to the browser. |
| | 111 | * It should be false for production systems. DEBUG is a define that |
| | 112 | * you can test for your own purposes. |
| | 113 | */ |
| 57 | | # Load databse settings |
| 58 | | $GLOBALS['TRAX_DB_SETTINGS'] = parse_ini_file(TRAX_ROOT.$GLOBALS['TRAX_INCLUDES']['config']."/database.ini",true); |
| 59 | | |
| 60 | | # Should we use local copy of the Trax libs in vendor/trax or |
| 61 | | # the server Trax libs in the php libs dir defined in PHP_LIB_ROOT |
| | 122 | /** |
| | 123 | * Load database settings from config/database.ini |
| | 124 | */ |
| | 125 | $GLOBALS['TRAX_DB_SETTINGS'] = |
| | 126 | parse_ini_file(TRAX_ROOT.$GLOBALS['TRAX_INCLUDES']['config'] |
| | 127 | ."/database.ini",true); |
| | 128 | /** |
| | 129 | * Define location of the Trax PHP modules |
| | 130 | * |
| | 131 | * Should we use local copy of the Trax libs in vendor/trax or |
| | 132 | * the server Trax libs in the php libs dir defined in PHP_LIB_ROOT |
| | 133 | */ |
| 73 | | ".".TRAX_PATH_SEPERATOR. # current directory |
| 74 | | TRAX_LIB_ROOT.TRAX_PATH_SEPERATOR. # trax libs (vendor/trax or server trax libs) |
| 75 | | PHP_LIB_ROOT.TRAX_PATH_SEPERATOR. # php libs dir (ex: /usr/local/lib/php) |
| 76 | | TRAX_ROOT.$GLOBALS['TRAX_INCLUDES']['lib'].TRAX_PATH_SEPERATOR. # app specific libs extra libs to include |
| | 145 | ".".PATH_SEPARATOR. # current directory |
| | 146 | TRAX_LIB_ROOT.PATH_SEPARATOR. # trax libs (vendor/trax or server trax libs) |
| | 147 | PHP_LIB_ROOT.PATH_SEPARATOR. # php libs dir (ex: /usr/local/lib/php) |
| | 148 | TRAX_ROOT.$GLOBALS['TRAX_INCLUDES']['lib'].PATH_SEPARATOR. # app specific libs extra libs to include |