__DIR__ . '/class/', 'Insallah' => __DIR__ . '/class/Insallah/', 'DarksLight2' => __DIR__ . '/class/DarksLight2/', ]; $parts = explode('\\', $classname); $namespace = array_shift($parts); $classFile = array_pop($parts) . '.php'; if (!array_key_exists($namespace, $classMap)) { return; } $path = implode(DIRECTORY_SEPARATOR, $parts); $file = $classMap[$namespace] . $path . DIRECTORY_SEPARATOR . $classFile; if (!file_exists($file) && !class_exists($classname)) { return; } require_once $file; }); /** * Нужно перенести в другое местечко, но пока так */ try { $training_manager = TrainingManager::getInstance(User::start()->info['id']); $training_manager->createDatabaseRecord(); $training_manager->register([ new FirstStep(), ]); } catch (TrainingException $e) { }