15 lines
513 B
PHP
15 lines
513 B
PHP
<?php
|
|
// When symlinked into Kimai's var/plugins/, the vendor autoload is two levels up
|
|
$autoloadPaths = [
|
|
__DIR__ . '/../dev/kimai/vendor/autoload.php', // Running from plugin root
|
|
__DIR__ . '/../../../vendor/autoload.php', // Running from inside var/plugins/
|
|
];
|
|
|
|
foreach ($autoloadPaths as $path) {
|
|
if (file_exists($path)) {
|
|
require_once $path;
|
|
return;
|
|
}
|
|
}
|
|
|
|
throw new RuntimeException('Cannot find Kimai vendor/autoload.php. Run composer install in dev/kimai/ first.');
|