Skip to content

Instantly share code, notes, and snippets.

@sasezaki
Created February 22, 2009 16:04
Show Gist options
  • Save sasezaki/68505 to your computer and use it in GitHub Desktop.
Save sasezaki/68505 to your computer and use it in GitHub Desktop.
<?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