fix(cluster): inclusion de ClusterManager et autoloader PSR-4 automatique dans api.php et index.php
This commit is contained in:
1 parent
521f21dc9c
commit
93f842a363
7 files changed
+27
No files matched your search
@@ -12,6 +12,17 @@ require_once __DIR__ . '/../src/BackupManager.php';
|
||||
require_once __DIR__ . '/../src/FirewallManager.php';
|
||||
require_once __DIR__ . '/../src/PhonebookManager.php';
|
||||
require_once __DIR__ . '/../src/CdrManager.php';
|
||||
require_once __DIR__ . '/../src/ClusterManager.php';
|
||||
|
||||
// Autoloader PSR-4 automatique pour toutes les classes du namespace App
|
||||
spl_autoload_register(function (string $class): void {
|
||||
if (str_starts_with($class, 'App\\')) {
|
||||
$file = __DIR__ . '/../src/' . str_replace('\\', '/', substr($class, 4)) . '.php';
|
||||
if (file_exists($file)) {
|
||||
require_once $file;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
use App\Database;
|
||||
use App\Auth;
|
||||
@@ -24,6 +35,7 @@ use App\BackupManager;
|
||||
use App\FirewallManager;
|
||||
use App\PhonebookManager;
|
||||
use App\CdrManager;
|
||||
use App\ClusterManager;
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
|
||||
@@ -4,6 +4,16 @@ declare(strict_types=1);
|
||||
require_once __DIR__ . '/../src/Database.php';
|
||||
require_once __DIR__ . '/../src/Auth.php';
|
||||
|
||||
// Autoloader PSR-4 automatique pour toutes les classes du namespace App
|
||||
spl_autoload_register(function (string $class): void {
|
||||
if (str_starts_with($class, 'App\\')) {
|
||||
$file = __DIR__ . '/../src/' . str_replace('\\', '/', substr($class, 4)) . '.php';
|
||||
if (file_exists($file)) {
|
||||
require_once $file;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
use App\Database;
|
||||
use App\Auth;
|
||||
|
||||
|
||||
Reference in new issue
Block a user