diff --git a/docs/en/development/autoloader.md b/docs/en/development/autoloader.md index db5eabb8c..045cc587e 100644 --- a/docs/en/development/autoloader.md +++ b/docs/en/development/autoloader.md @@ -31,10 +31,6 @@ shipped — the deploy path has no Composer and never runs `composer install`. T is **no class-map cache** (no `optimize-autoloader`): a class miss is a plain path lookup, not a directory rescan. -> The legacy `XC_Autoloader` scanner (token-scanning, igbinary `tmp/cache/autoload_map` -> cache, `registerDirectories()`) has been **removed**. There is nothing to warm, -> clear, or invalidate. - ## Adding a new class Create the file at the path its namespace maps to — that is all; Composer resolves it on demand: diff --git a/docs/ru/development/autoloader.md b/docs/ru/development/autoloader.md index add23390e..3d27d166a 100644 --- a/docs/ru/development/autoloader.md +++ b/docs/ru/development/autoloader.md @@ -31,10 +31,6 @@ XcVm\Public\Controllers\Admin\UserController -> src/Public/Controllers/Admin/Use запускается. **Кэша карты классов нет** (без `optimize-autoloader`): промах по классу — это обычный поиск по пути, а не пересканирование каталогов. -> Легаси-сканер `XC_Autoloader` (сканирование токенов, igbinary-кэш -> `tmp/cache/autoload_map`, `registerDirectories()`) **удалён**. Прогревать, -> очищать или инвалидировать больше нечего. - ## Добавление нового класса Создайте файл по пути, на который отображается его namespace — и всё; Composer разрешит его по требованию: diff --git a/src/bootstrap.php b/src/bootstrap.php index 8e7baf2ab..96b36c986 100644 --- a/src/bootstrap.php +++ b/src/bootstrap.php @@ -111,8 +111,7 @@ if (!defined('MAIN_HOME')) { define('MAIN_HOME', __DIR__ . '/'); } -// Composer PSR-4 autoloader — resolves every XcVm\* class. The legacy -// XC_Autoloader fallback scanner has been retired and removed; modules load via +// Composer PSR-4 autoloader — resolves every XcVm\* class; modules load via // ModuleLoader's PSR-4 resolver. require_once __DIR__ . '/vendor/autoload.php'; // After this: MAIN_HOME is defined and the Composer autoloader is registered. diff --git a/tests/Unit/AutoloadOrderTest.php b/tests/Unit/AutoloadOrderTest.php deleted file mode 100644 index e2fd6150f..000000000 --- a/tests/Unit/AutoloadOrderTest.php +++ /dev/null @@ -1,77 +0,0 @@ -assertTrue($hasComposer, 'Composer ClassLoader must be registered.'); - } - - public function testComposerResolvesNamespacedClassFromEveryLayer(): void { - $samples = [ - 'XcVm\\Core\\Config\\SettingsManager', - 'XcVm\\Domain\\User\\UserRepository', - 'XcVm\\Infrastructure\\Redis\\RedisManager', - 'XcVm\\Streaming\\Codec\\FfmpegPaths', - 'XcVm\\Cli\\CommandRegistry', - 'XcVm\\Public\\Controllers\\Admin\\UserController', - ]; - foreach ($samples as $fqcn) { - $this->assertTrue( - class_exists($fqcn) || interface_exists($fqcn), - "Composer must autoload {$fqcn}." - ); - } - } - - public function testLegacyScannerIsNotRegistered(): void { - foreach (spl_autoload_functions() as $fn) { - if (is_array($fn)) { - $target = is_object($fn[0]) ? get_class($fn[0]) : (string) $fn[0]; - $this->assertNotSame( - 'XC_Autoloader', - $target, - 'The retired XC_Autoloader scanner must not be registered.' - ); - } - } - $this->addToAssertionCount(1); - } - - public function testLegacyAutoloaderIsRemoved(): void { - $this->assertFalse( - class_exists('XC_Autoloader'), - 'The legacy XC_Autoloader class has been removed entirely.' - ); - $this->assertFileDoesNotExist( - MAIN_HOME . 'autoload.php', - 'src/autoload.php must be deleted.' - ); - } - - public function testNoClassMapCacheIsWritten(): void { - $cache = MAIN_HOME . 'tmp/cache/autoload_map'; - if (is_file($cache)) { - @unlink($cache); - } - // Trigger an autoload; resolution is live (Composer) with no cache file. - $this->assertTrue(class_exists('XcVm\\Core\\Logging\\Logger')); - $this->assertFileDoesNotExist($cache, 'The igbinary class-map cache must be gone.'); - } -}