Beispiel #1
0
 /**
  * Calls all init functions of the WCF class.
  */
 public function __construct()
 {
     // add autoload directory
     self::$autoloadDirectories['wcf'] = WCF_DIR . 'lib/';
     // define tmp directory
     if (!defined('TMP_DIR')) {
         define('TMP_DIR', FileUtil::getTempFolder());
     }
     // register additional autoloaders
     require_once WCF_DIR . 'lib/system/api/phpline/phpline.phar';
     require_once WCF_DIR . 'lib/system/api/zend/Loader/StandardAutoloader.php';
     $zendLoader = new ZendLoader(array(ZendLoader::AUTOREGISTER_ZF => true));
     $zendLoader->register();
     $argv = new ArgvParser(array('packageID=i' => ''));
     $argv->setOption(ArgvParser::CONFIG_FREEFORM_FLAGS, true);
     $argv->parse();
     define('PACKAGE_ID', $argv->packageID ?: 1);
     // disable benchmark
     define('ENABLE_BENCHMARK', 0);
     // start initialization
     $this->initDB();
     $this->loadOptions();
     $this->initSession();
     $this->initLanguage();
     $this->initTPL();
     $this->initCoreObjects();
     $this->initApplications();
     // the destructor registered in core.functions.php will only call the destructor of the parent class
     register_shutdown_function(array('wcf\\system\\CLIWCF', 'destruct'));
     $this->initArgv();
     $this->initPHPLine();
     $this->initAuth();
     $this->checkForUpdates();
     $this->initCommands();
 }