Exemplo n.º 1
0
 function checkPhpExtensions()
 {
     $ok = true;
     if (!version_compare($this->buildProperties['PHP_VERSION_TARGET'], phpversion(), '<=')) {
         $this->error('php.bad.version');
         $notice = $this->messages->get('php.version.required') . $this->buildProperties['PHP_VERSION_TARGET'];
         $notice .= '. ' . $this->messages->get('php.version.current') . phpversion();
         $this->reporter->showNotice($notice);
         $ok = false;
     }
     if (!class_exists('DOMDocument', false)) {
         $this->error('extension.dom');
         $ok = false;
     }
     if (!class_exists('DirectoryIterator', false)) {
         $this->error('extension.spl');
         $ok = false;
     }
     $funcs = array('simplexml_load_file' => 'simplexml', 'preg_match' => 'pcre', 'session_start' => 'session', 'token_get_all' => 'tokenizer', 'iconv_set_encoding' => 'iconv');
     foreach ($funcs as $f => $name) {
         if (!function_exists($f)) {
             $this->error('extension.' . $name);
             $ok = false;
         }
     }
     if ($this->buildProperties['ENABLE_PHP_FILTER'] == '1' && !extension_loaded('filter')) {
         $this->error('extension.filter');
         $ok = false;
     }
     if ($this->buildProperties['ENABLE_PHP_JSON'] == '1' && !extension_loaded('json')) {
         $this->error('extension.json');
         $ok = false;
     }
     /*if($this->buildProperties['ENABLE_PHP_XMLRPC'] == '1' && !extension_loaded ('xmlrpc')) {
           $this->error('extension.xmlrpc');
           $ok=false;
       }*/
     if ($this->buildProperties['ENABLE_PHP_JELIX'] == '1' && !extension_loaded('jelix')) {
         $this->error('extension.jelix');
         $ok = false;
     }
     if ($this->buildProperties['WITH_BYTECODE_CACHE'] != 'auto' && $this->buildProperties['WITH_BYTECODE_CACHE'] != '') {
         if (!extension_loaded('apc') && !extension_loaded('eaccelerator') && !extension_loaded('xcache')) {
             $this->error('extension.opcode.cache');
             $ok = false;
         }
     }
     if ($ok) {
         $this->ok('extensions.required.ok');
     }
     return $ok;
 }
Exemplo n.º 2
0
 function loadBuildFile()
 {
     if (!file_exists(JELIX_LIB_PATH . 'BUILD')) {
         throw new Exception($this->messages->get('build.not.found'));
     } else {
         $this->buildProperties = parse_ini_file(JELIX_LIB_PATH . 'BUILD');
     }
 }