Created
February 22, 2009 16:04
-
-
Save sasezaki/68505 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define ("XOOPS_ROOT_PATH", '/var/www/xoops/html'); | |
require_once 'Zend/Loader/Autoloader/Interface.php'; | |
class Zoops_Autoloader implements Zend_Loader_Autoloader_Interface | |
{ | |
const CLASS_PATH = '/class/%s.php'; | |
const XCUBE_PATH = '/core/%s.class.php'; | |
const LEGACY_PATH = '/modules/legacy/class/%s.class.php'; | |
protected $_baseDir; | |
public function __construct($baseDir) | |
{ | |
$this->_baseDir = $baseDir; | |
} | |
public function autoload($class) | |
{ | |
if (strncasecmp($class, 'XCube', 5) === 0) { | |
return include($this->_baseDir .sprintf(self::XCUBE_PATH, $class)); | |
} | |
if (strncasecmp(strtolower($class), 'xoops', 5) === 0) { | |
return include($this->_baseDir .sprintf(self::CLASS_PATH, strtolower($class))); | |
} | |
if ((strncasecmp($class, 'Legacy', 5) === 0) && substr($class, -8) === 'Debugger') { | |
return include($this->_baseDir .sprintf(self::LEGACY_PATH, 'Legacy_Debugger')); | |
} | |
return false; | |
} | |
} | |
require_once 'Zend/Loader/Autoloader.php'; | |
$loader = new Zoops_AutoLoader(XOOPS_ROOT_PATH); | |
Zend_Loader_Autoloader::getInstance()->pushAutoloader($loader); | |
$x = new XoopsLists(); | |
//XCube_Root::getSingleton(); | |
$legacyDebugger = new Legacy_SmartyDebugger(); | |
$legacyDebugger->prepare(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment