我有index.php
<?php
include('_controller/Autoloader.php');
Gold_Autoloader::init();
$mysql = new Gold_MySQL();
_controller/Autoloader.php
<?php
class Gold_Autoloader
{
public static $loader;
public static function init()
{
if (self::$loader == NULL)
self::$loader = new self();
return self::$loader;
}
public function __construct()
{
spl_autoload_register(array($this, 'controller'));
spl_autoload_register(array($this, 'resources'));
}
public function resources($className)
{
$className = preg_replace('#Gold_#', '', $className);
$className = preg_replace('#_#', DIRECTORY_SEPARATOR, $className);
set_include_path(PROJECT_ROOT . '_resources');
spl_autoload_extensions('.php');
spl_autoload($className);
}
public function controller($className)
{
$className = preg_replace('#Gold_#', '', $className);
$className = preg_replace('#_#', DIRECTORY_SEPARATOR, $className);
set_include_path(PROJECT_ROOT . '_controller');
spl_autoload_extensions('.php');
spl_autoload($className);
}
}
我有文件_controller/MySQL.php和 Gold_MySQL.class。在 Windows 系统上,此代码正在运行,包括 MySQL.php,但在托管此代码时不起作用((
[Thu Jan 27 12:55:57 2011] [error] PHP Fatal error: Class 'Gold_MySQL' not found in /home/u91167/youd0main.com/www/index_.php on line 5
编辑
如何使 Unix 可以查看任何文件?Zend 没有小写字母的文件。