|
|
@ -13,6 +13,7 @@ |
|
|
|
*/ |
|
|
|
|
|
|
|
use WpsMcloud\Actions; |
|
|
|
use WpsMcloud\Exceptions\VendorAutoloadException; |
|
|
|
use WpsMcloud\Pages; |
|
|
|
use WpsMcloud\Logger; |
|
|
|
|
|
|
@ -30,10 +31,23 @@ add_action('admin_menu', fn () => add_submenu_page( |
|
|
|
// $ilabClassLoader = new Composer\Autoload\ClassLoader();
|
|
|
|
// $ilabLoader->unregister();
|
|
|
|
|
|
|
|
include 'vendor/autoload.php'; |
|
|
|
$localVendorAutoloadPath = 'vendor/autoload.php'; |
|
|
|
$projectVendorAutoloadPath = ABSPATH . 'vendor/autoload.php'; |
|
|
|
|
|
|
|
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__); |
|
|
|
$dotenv->load(); |
|
|
|
if (file_exists($localVendorAutoloadPath)) { |
|
|
|
include $localVendorAutoloadPath; |
|
|
|
} elseif (file_exists($projectVendorAutoloadPath)) { |
|
|
|
include $projectVendorAutoloadPath; |
|
|
|
} else { |
|
|
|
throw new VendorAutoloadException('Unable to find appropriate composer autoloader'); |
|
|
|
} |
|
|
|
|
|
|
|
$dotEnvFile = __DIR__ . '/.env'; |
|
|
|
|
|
|
|
if (file_exists($dotEnvFile)) { |
|
|
|
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__); |
|
|
|
$dotenv->load(); |
|
|
|
} |
|
|
|
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
|
|
$logger = new Logger(); |
|
|
|