diff --git a/src/PackageRegistrator.php b/src/PackageRegistrator.php index a3145d4..f7dfcfb 100644 --- a/src/PackageRegistrator.php +++ b/src/PackageRegistrator.php @@ -54,7 +54,7 @@ public function __construct(?string $rootDir = null, ?string $tempDir = null) $tempDir = (new TempDirResolver($rootDirResolver))->get(); } } - if (Debugger::$logDirectory === null) { + if (class_exists(Debugger::class) === true && Debugger::$logDirectory === null) { FileSystem::createDir($rootDir . '/log'); try { Debugger::enable(false, $rootDir . '/log'); @@ -76,7 +76,9 @@ public function __construct(?string $rootDir = null, ?string $tempDir = null) try { self::$packageDescriptorEntity = $storage->load(); } catch (PackageDescriptorException $e) { - Debugger::log($e, 'critical'); + if (class_exists(Debugger::class) === true) { + Debugger::log($e, 'critical'); + } if (PHP_SAPI === 'cli') { ConsoleHelpers::terminalRenderError($e->getMessage()); } else {