-1
    <?php
/**
* This class is sort of factory class that is responsible for loading
* classes, it check if this class is not defined then it includes the file
* So developer don't need to worry about including that file
* @author Haafiz
*/
class load{

    public static $app_path= APP_PATH;
    public static $model_path=MODEL_PATH;


    /*
    * @param string $model_name <>Name of class(model) that is required to instantiate/load</p>
    * @param bool $continue_on_error  this decide whether to have fatal error or continue on error loading
    * $return object 
    */
    public static function model($model_name,$conitnue_on_error=0){
        if(!class_exists($model_name)){
            $model_filename= strtolower($model_name).".php";
            try{
                include self::$model_path.$model_filename;
            }
            catch(Exception $e){
                if(!$continue_on_error){
                die($e);
                }
            }
            $model=new $model_name();
            return $model;
        }       
    }
}

?>

上記のコードでは、次のエラーに直面する必要があります。他のスレッドで、問題は の使用にあると言う人もいますが&、私はそれを使用していません。では、私の場合、実際に問題とは何ですか?すべてがすべてを正しく行っているようです。他のいくつかのスレッドを見ましたが、解決策が見つかりませんでした。ですから、他の人がそれで何かを理解してくれたらお願いします。ありがとう

4

1 に答える 1

0

80行目php/PEAR/Config.phpは実際に参照を使用しています。

   function Config()
    {
        $this->container =& new Config_Container('section', 'root');
    } // end constructor

この問題と PEAR パッケージの更新については、この質問を参照してください。

于 2012-05-03T19:20:47.970 に答える