<?php namespace Core\Lib\Drive\Log; class File { }
file 空的跟着老师视频做的
<?php namespace Core\Lib; class Log { static $class; static public function init() { //确定存储方式 $drive = Conf::get('DRIVE','log'); $class = '\core\lib\drive\log\\'.$drive; self::$class = new $class; } }
看就几遍视频买找到问题出在哪,
use core\lib\conf; 你这是没有引用吧,我今天也出现这个问题
<?php namespace Core\Lib; class Log { static $class; static public function init(){ //确定存储方式 $drive = Conf::get('DRIVE', 'log'); $class = '\core\lib\drive\log\\'.$drive; self::$class = new $class; } static public function log($name, $file = 'log') { self::$class->log($name, $file); } }
Fatal error: Class '\core\lib\drive\log\file' not found in D:\WWW\mvc\Core\Lib\Log.php on line 9