Esempio n. 1
0
 public function __construct($settings = array())
 {
     // Time us
     $this->time_start = microtime(true);
     // Get our version from git setattribs
     $scm = '2015-09-15 02:16:11 -0700';
     list($this->version) = strpos($scm, '$') !== false ? array('git') : explode(' ', $scm);
     // Run through dependencies / sanity checking
     if (!extension_loaded('pcre') && !function_exists('preg_match') && !function_exists('preg_match_all')) {
         throw new LinfoFatalException($this->app_name . ' needs the `pcre\' extension to be loaded. http://us2.php.net/manual/en/book.pcre.php');
     }
     // Warnings usually displayed to browser happen if date.timezone isn't set in php 5.3+
     if (!ini_get('date.timezone')) {
         @ini_set('date.timezone', 'Etc/UTC');
     }
     // Load our settings/language
     $this->loadSettings($settings);
     $this->loadLanguage();
     // Some classes need our vars; config them
     LinfoCommon::config($this);
     CallExt::config($this);
     // Determine OS
     $os = $this->getOS();
     if (!$os) {
         throw new LinfoFatalException('Unknown/unsupported operating system');
     }
     $distro_class = 'OS_' . $os;
     $this->parser = new $distro_class($this->settings);
 }