Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to autoload my classes, but I keep getting

Fatal error: Uncaught Error: Class "Database" not found in C:xampphtdocslogapp equire.php:9 Stack trace: #0 C:xampphtdocslogpublicinicheader.php(15): require_once() #1 C:xampphtdocslogindex.php(3): include('C:xampphtdocs...') #2 {main} thrown in C:xampphtdocslogapp equire.php on line 9

  spl_autoload_register(function($class){
(__FILE__) . DIRECTORY_SEPARATOR . str_replace('\', DIRECTORY_SEPARATOR , strtolower($class)) . '.php';});
 
$db = new Database();
$core = new Core();

The repo: https://github.com/Saboor-Hamedi/blog1.git

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
2.2k views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...