PHPonTrax
[ class tree: PHPonTrax ] [ index: PHPonTrax ] [ all elements ]

Source for file boot.php

Documentation is available at boot.php

  1. <?php
  2. /**
  3.  *  @package PHPonTrax
  4.  *
  5.  *   Don't change this file. Configuration is done in
  6.  *   config/environment.php and config/environments/*.php
  7.  */
  8.  
  9. # Determine Trax environment 
  10. if(!defined('TRAX_ENV')) {
  11.     # Sets environment from the Apache Vhost (SetEnv TRAX_ENV development)
  12.     # or change the string to manually set it. (development | test | production)
  13.     define('TRAX_ENV'$_SERVER['TRAX_ENV'$_SERVER['TRAX_ENV'"development");
  14.  
  15. # Determine the path to this applications trax folder 
  16. if(!defined('TRAX_ROOT')) {
  17.     define("TRAX_ROOT"dirname(dirname(__FILE__)));    
  18. }
  19.  
  20. # Determine where your system php libs path
  21. if(!defined('PHP_LIB_ROOT')) {
  22.     $php_dir trim(exec('pear config-get php_dir'));
  23.     if(is_dir($php_dir)) {
  24.         define('PHP_LIB_ROOT',  $php_dir);    
  25.     else {
  26.         define('PHP_LIB_ROOT',  '/usr/local/lib/php');    
  27.     
  28.     unset($php_dir);       
  29. }
  30.  
  31. # Should we use local copy of the Trax libs in vendor/trax or
  32. # the server Trax libs in the php libs dir defined in PHP_LIB_ROOT
  33. if(is_dir(TRAX_ROOT."/vendor/trax")) {
  34.     define("TRAX_LIB_ROOT"TRAX_ROOT."/vendor/trax");
  35. elseif(is_dir(PHP_LIB_ROOT."/PHPonTrax/vendor/trax")) {
  36.     define("TRAX_LIB_ROOT"PHP_LIB_ROOT."/PHPonTrax/vendor/trax");           
  37. else {
  38.     echo "Can't determine where your Trax Libs are located.";
  39.     exit;    
  40. }
  41.  
  42. # Set up Trax environment, framework, and default configuration
  43. include_once(TRAX_LIB_ROOT."/trax.php");
  44.  
  45. ?>

Documentation generated on Mon, 21 May 2007 22:28:10 -0600 by phpDocumentor 1.3.2