ここ数日、私は頭がおかしくなりそうで、他に何をしたらいいのかわからないので、あなたの助けが本当に必要です。私はすべてを試しました。
問題は次のとおりです。ファイルが 2 つあります。site.php
とlogs.php
。
の内容は次のlogs.php
とおりです。
class Logs {
function __construct() {
}
}
ここで、'site.php' の冒頭で楽しい部分が始まります。
require_once("database.php");
require_once("logs.php");
class Site {
private $db;
private $logs;
function __construct() {
$this->logs = new Logs(); ### this is the error line
$this->db = new MySQLDatabase();
}
}
それらはすべて同じディレクトリにあります。クラスが見つからないのはなぜですか?