Update: 2026-07-05 18:07:23
This commit is contained in:
@@ -4,9 +4,28 @@ if (php_sapi_name() !== 'cli') {
|
||||
die("This script must be run from the command line (Terminal).\n");
|
||||
}
|
||||
|
||||
// Load core bootstrap (which handles .env, dependencies, database, etc.)
|
||||
require_once __DIR__ . '/../core/bootstrap.php';
|
||||
// Load .env for CLI
|
||||
$envPaths = [__DIR__ . '/../.env', __DIR__ . '/../../.env'];
|
||||
foreach ($envPaths as $envPath) {
|
||||
if (file_exists($envPath)) {
|
||||
$lines = file($envPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
foreach ($lines as $line) {
|
||||
$line = trim($line);
|
||||
if (empty($line) || strpos($line, '#') === 0) continue;
|
||||
$parts = explode('=', $line, 2);
|
||||
if (count($parts) === 2) {
|
||||
$key = trim($parts[0]);
|
||||
$val = trim(trim($parts[1]), "\"'");
|
||||
putenv("$key=$val");
|
||||
$_ENV[$key] = $val;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/../core/Services/SiroGeminiService.php';
|
||||
require_once __DIR__ . '/../core/Database/Database.php';
|
||||
|
||||
if (!file_exists(__DIR__ . '/madeline.php')) {
|
||||
die("Error: madeline.php not found. Please run telegram_setup.php first.\n");
|
||||
|
||||
Reference in New Issue
Block a user