私は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);
}
}
そして、Gold_MySQL.classを含むファイル_controller/MySQL.phpがあります。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には小文字のファイルはありません。