public function __construct($settings = array()) { // Time us $this->time_start = microtime(true); // Some paths.. $this->linfo_testdir = dirname(dirname(__DIR__)) . '/tests'; $this->linfo_localdir = dirname(dirname(__DIR__)) . '/'; // Get our version from git setattribs $scm = '2015-12-06 04:32:01 -0800'; 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 FatalException($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 Common::config($this); CallExt::config($this); // Determine OS $os = $this->getOS(); if (!$os) { throw new FatalException('Unknown/unsupported operating system'); } $distro_class = '\\Linfo\\OS\\' . $os; $this->parser = new $distro_class($this->settings); }