Ejemplo n.º 1
0
 /**
  * Check for php version, assing properties and determine whether to show errors or not 
  * @param string / directory for log error file(s)
  * @param array / file(s) for E and Exceptions
  * @param array / key-value displayMessage => false 
  * @return boolean
  */
 public static function settings($dir, $files, $settings = null)
 {
     defined('DS') ? true : define('DS', DIRECTORY_SEPARATOR);
     $phpVersion = substr(PHP_VERSION, 0, 1);
     if ($phpVersion < 5) {
         print 'Error! Track library needs php5 and above';
         return false;
     }
     if (!is_array($files)) {
         print 'Files param should be an array with at least one file where to write' . "\n";
         return false;
     }
     if (isset($settings['displayMessage'])) {
         self::$showErrors = $settings['displayMessage'];
     } else {
         self::$showErrors = true;
     }
     if (self::resolveLogDir($dir)) {
         self::$files = $files;
         self::setHandlers();
         return true;
     }
     return false;
 }