diff --git a/.gitignore b/.gitignore index c9080af50b..d430f2cc79 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ internal_data/captcha/**/ internal_data/log/ internal_data/sitemap/*.xml internal_data/triggers/ +library/config.local.php ### Archives ### *.log diff --git a/common.php b/common.php index 4177c0fecc..cf0bfb2ab5 100644 --- a/common.php +++ b/common.php @@ -20,8 +20,8 @@ require(BB_ROOT . 'library/config.php'); // Load Zend Framework -require(CLASS_DIR . 'zendLoader.php'); -ZendLoader::getInstance()->setupAutoloader(BB_ROOT . '/library'); +require_once(BB_ROOT . 'library/Zend/Loader/AutoloaderFactory.php'); +Zend\Loader\AutoloaderFactory::factory(array()); $server_protocol = ($bb_cfg['cookie_secure']) ? 'https://' : 'http://'; $server_port = (in_array($bb_cfg['server_port'], array(80, 443))) ? '' : ':' . $bb_cfg['server_port']; diff --git a/library/includes/classes/zendLoader.php b/library/includes/classes/zendLoader.php deleted file mode 100644 index dd4621957e..0000000000 --- a/library/includes/classes/zendLoader.php +++ /dev/null @@ -1,97 +0,0 @@ -_setup) - { - return; - } - - $this->_rootDir = $rootDir; - $this->_setupAutoloader(); - - $this->_setup = true; - } - - protected function _setupAutoloader() - { - if (@ini_get('open_basedir')) - { - set_include_path($this->_rootDir . PATH_SEPARATOR . '.'); - } - else - { - set_include_path($this->_rootDir . PATH_SEPARATOR . '.' . PATH_SEPARATOR . get_include_path()); - } - - spl_autoload_register(array($this, 'autoload')); - } - - public function autoload($class) - { - if (class_exists($class, false) || interface_exists($class, false)) - { - return true; - } - - if ($class == 'utf8_entity_decoder') - { - return true; - } - - $filename = $this->autoloaderClassToFile($class); - if (!$filename) - { - return false; - } - - if (file_exists($filename)) - { - include($filename); - return (class_exists($class, false) || interface_exists($class, false)); - } - - return false; - } - - public function autoloaderClassToFile($class) - { - if (preg_match('#[^a-zA-Z0-9_\\\\]#', $class)) - { - return false; - } - - return $this->_rootDir . '/' . str_replace(array('_', '\\'), '/', $class) . '.php'; - } - - public function getRootDir() - { - return $this->_rootDir; - } - - public static final function getInstance() - { - if (!self::$_instance) - { - self::$_instance = new self(); - } - - return self::$_instance; - } - - public static function setInstance(ZendLoader $loader = null) - { - self::$_instance = $loader; - } -} \ No newline at end of file