includes/common.php
changeset 2 0931d60f5bdb
parent 1 fe660c52c48f
child 3 2b2084ca1e60
equal deleted inserted replaced
1:fe660c52c48f 2:0931d60f5bdb
    34 global $_starttime;
    34 global $_starttime;
    35 $_starttime = microtime_float();
    35 $_starttime = microtime_float();
    36 
    36 
    37 error_reporting(E_ALL);
    37 error_reporting(E_ALL);
    38 
    38 
       
    39 // Determine directory (special case for development servers)
       
    40 if ( strpos(__FILE__, '/enano-clean/') && file_exists('.enanodev') )
       
    41 {
       
    42   $filename = str_replace('/enano-clean', '', __FILE__);
       
    43 }
       
    44 else
       
    45 {
       
    46   $filename = __FILE__;
       
    47 }
       
    48 
    39 if(!defined('ENANO_ROOT')) // ENANO_ROOT is sometimes defined by plugins like AjIM that need the constant before the Enano API is initialized
    49 if(!defined('ENANO_ROOT')) // ENANO_ROOT is sometimes defined by plugins like AjIM that need the constant before the Enano API is initialized
    40   define('ENANO_ROOT', dirname(dirname(__FILE__)));
    50   define('ENANO_ROOT', dirname(dirname($filename)));
    41 
    51 
    42 if(defined('ENANO_DEBUG') && version_compare(PHP_VERSION, '5.0.0') < 0)
    52 if(defined('ENANO_DEBUG') && version_compare(PHP_VERSION, '5.0.0') < 0)
    43 {
    53 {
    44   die(__FILE__.':'.__LINE__.': The debugConsole requires PHP 5.x.x or greater. Please comment out the ENANO_DEBUG constant in your index.php.');
    54   die(__FILE__.':'.__LINE__.': The debugConsole requires PHP 5.x.x or greater. Please comment out the ENANO_DEBUG constant in your index.php.');
    45 }
    55 }