* @return mixed */ protected function resolveService($id) { if (empty($this->services[$id]) && !class_exists($id)) { throw new ServiceNotFoundException("Service '{$id}' not found"); } $service = $this->services[$id] ?? new Service($id); $instance = $service->resolveInstance($this); * * @return mixed */ protected function resolveService($id) { return Hook::call([$id, 'app.resolve'], fn($id) => parent::resolveService($id), $id, $this); } /** * Resolves a loader instance. */ }; } if ($kind === static::AFTER) { return function (...$arguments) use ($method, $callback) { $callback($result = $method(...$arguments), ...$arguments); return $result; }; } if ($hooks = $this->hooks[$name] ?? null) { $callback = $this->build($callback, $hooks); } } return $callback(...$arguments); } /** * Add "wrap" hook for given name. */ * @param string|string[] $name * @return mixed */ public static function call($name, callable $callback, ...$arguments) { return static::getCollection()->call($name, $callback, ...$arguments); } /** * Add "wrap" hook for given name. */ * * @return mixed */ protected function resolveService($id) { return Hook::call([$id, 'app.resolve'], fn($id) => parent::resolveService($id), $id, $this); } /** * Resolves a loader instance. */ return $this->instances[$id] = $this->resolving[$id]; } $this->resolving[$id] = true; $instance = $this->resolveService($id); if ($this->isShared($id)) { $this->instances[$id] = $instance; } /** * @inheritdoc */ public function get($id) { return $this->resolve($id); } /** * Sets a service instance. * $callback = [$this->getAlias($service), $method]; } elseif (str_contains($callback, '@')) { [$service, $method] = explode('@', $callback, 2); $callback = [$this->get($service), $method]; } elseif ($this->has($callback) || class_exists($callback)) { $callback = $this->get($callback); } } * * @return mixed */ public function call($callback, array $parameters = [], $resolve = true) { if (!($callable = $this->callback($callback))) { throw BadFunctionCallException::create($callback); } if ($resolve) { $resolver = new ParameterResolver($this); string $method, ...$params ): void { $this->dispatcher->addListener( $event, fn(...$arguments) => $container->call( $method[0] === '@' ? $class . $method : [$class, $method], $arguments, ), ...$params, ); if (version_compare(JVERSION, '4.0', '>=')) { return $this->joomla ->getDispatcher() ->addListener( $event, fn($event) => $listener($this->prepareArguments($event)), $priority, ); } if (empty($this->listeners[$event])) { if ($event->isStopped()) { return $event; } $listener($event); } } return $event; } ExceptionHandler::handleException($event->getError()); } // Trigger the onBeforeRespond event. $this->getDispatcher()->dispatch('onBeforeRespond'); // Send the application response. $this->respond(); // Trigger the onAfterRespond event.// Set the application as global app\Joomla\CMS\Factory::$application = $app;// Execute the application.$app->execute(); * define() is used rather than "const" to not error for PHP 5.2 and lower */define('_JEXEC', 1);// Run the application - All executable code should be triggered through this filerequire_once dirname(__FILE__) . '/includes/app.php';|
ServiceNotFoundException
|
|---|
YOOtheme\Container\ServiceNotFoundException:
Service 'YOOtheme\Theme\Joomla\Listener\AddJsonMimeType' not found
at /homepages/41/d1019315596/htdocs/web/templates/yootheme/packages/container/src/Container.php:339
at YOOtheme\Container->resolveService()
(/homepages/41/d1019315596/htdocs/web/templates/yootheme/packages/application/src/Application.php:146)
at YOOtheme\Application->YOOtheme\{closure}()
(/homepages/41/d1019315596/htdocs/web/templates/yootheme/packages/utils/src/HookCollection.php:124)
at YOOtheme\HookCollection->YOOtheme\{closure}()
(/homepages/41/d1019315596/htdocs/web/templates/yootheme/packages/utils/src/HookCollection.php:30)
at YOOtheme\HookCollection->call()
(/homepages/41/d1019315596/htdocs/web/templates/yootheme/packages/utils/src/Hook.php:17)
at YOOtheme\Hook::call()
(/homepages/41/d1019315596/htdocs/web/templates/yootheme/packages/application/src/Application.php:146)
at YOOtheme\Application->resolveService()
(/homepages/41/d1019315596/htdocs/web/templates/yootheme/packages/container/src/Container.php:315)
at YOOtheme\Container->resolve()
(/homepages/41/d1019315596/htdocs/web/templates/yootheme/packages/container/src/Container.php:91)
at YOOtheme\Container->get()
(/homepages/41/d1019315596/htdocs/web/templates/yootheme/packages/container/src/Container.php:230)
at YOOtheme\Container->callback()
(/homepages/41/d1019315596/htdocs/web/templates/yootheme/packages/container/src/Container.php:252)
at YOOtheme\Container->call()
(/homepages/41/d1019315596/htdocs/web/templates/yootheme/packages/application/src/Application/EventLoader.php:58)
at YOOtheme\Application\EventLoader->YOOtheme\Application\{closure}()
(/homepages/41/d1019315596/htdocs/web/templates/yootheme/packages/platform-joomla/src/Dispatcher.php:51)
at YOOtheme\Joomla\Dispatcher->YOOtheme\Joomla\{closure}()
(/homepages/41/d1019315596/htdocs/web/libraries/vendor/joomla/event/src/Dispatcher.php:486)
at Joomla\Event\Dispatcher->dispatch()
(/homepages/41/d1019315596/htdocs/web/libraries/src/Application/CMSApplication.php:326)
at Joomla\CMS\Application\CMSApplication->execute()
(/homepages/41/d1019315596/htdocs/web/includes/app.php:61)
at require_once('/homepages/41/d1019315596/htdocs/web/includes/app.php')
(/homepages/41/d1019315596/htdocs/web/index.php:32)
|