2021-06-16 00:17:30 +08:00
|
|
|
<?php
|
|
|
|
|
|
2022-03-15 18:05:33 +08:00
|
|
|
declare(strict_types=1);
|
2021-06-16 00:17:30 +08:00
|
|
|
|
2022-05-04 17:43:15 +08:00
|
|
|
const _PHAR_STUB_ID = '__generated_id__';
|
|
|
|
|
|
2022-03-15 18:05:33 +08:00
|
|
|
function loader__generated_id__()
|
|
|
|
|
{
|
|
|
|
|
$obj = json_decode(file_get_contents(__DIR__ . '/zmplugin.json'), true);
|
2022-03-20 16:20:14 +08:00
|
|
|
foreach (($obj['hotload-psr-4'] ?? []) as $v) {
|
|
|
|
|
require_once Phar::running() . '/' . $v;
|
|
|
|
|
}
|
|
|
|
|
foreach (($obj['hotload-files'] ?? []) as $v) {
|
2022-03-15 18:05:33 +08:00
|
|
|
require_once Phar::running() . '/' . $v;
|
|
|
|
|
}
|
2021-06-16 00:17:30 +08:00
|
|
|
}
|
2022-05-04 17:43:15 +08:00
|
|
|
if ('__generate' . 'd_id__' === _PHAR_STUB_ID) {
|
|
|
|
|
echo 'Cannot execute this file directly!' . PHP_EOL;
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
2022-03-15 18:05:33 +08:00
|
|
|
return json_decode(file_get_contents(__DIR__ . '/zmplugin.json'), true) ?? ['zm_module' => false];
|