} public static function addIncludePath (&$path) { //JPATH_THEMES $template_path = str_replace('\\', '/', T4PATH_TPL); for($i = count($path)-1; $i >= 0; $i--) { $p = str_replace('\\', '/', $path[$i]); if (strpos($p, $template_path) === 0) { $file = substr($p, strlen($template_path)); // add base path theme after template path /** * Implement event to allow select layout from base theme inside plugin. * These events are fireed by overriding Core Joomla lib: FileLayout, HtmlView, ModuleHelper */ public function onLayoutIncludePaths (&$path) { \T4\Helper\Path::addIncludePath($path); } public function onHtmlViewAddPath ($type, &$path) { \T4\Helper\Path::addIncludePath($path); } public function onGetLayoutPath($path, $layout) } // Convert to indexed array for unpacking. $arguments = array_values($arguments); $result = $this->{$methodName}(...$arguments); // Ignore null results if ($result === null) { return; } foreach ($this->listeners[$event->getName()] as $listener) { if ($event->isStopped()) { return $event; } $listener($event); } } return $event; } $event = new $className($eventName, $args); } else { throw new \InvalidArgumentException('The arguments must either be an event or an array'); } $result = $dispatcher->dispatch($eventName, $event); // @todo - There are still test cases where the result isn't defined, temporarily leave the isset check in place return !isset($result['result']) || \is_null($result['result']) ? [] : $result['result']; }} public function getDefaultIncludePaths() { $path = parent::getDefaultIncludePaths(); //Trigger event, then can alter include paths \Joomla\CMS\Factory::getApplication()->triggerEvent('onLayoutIncludePaths', array(&$path)); return $path; } public function getSuffixes() * @since 3.5 */ public function getIncludePaths() { if (empty($this->includePaths)) { $this->includePaths = $this->getDefaultIncludePaths(); } return $this->includePaths; } * @since 3.0 */ protected function getPath() { $layoutId = $this->getLayoutId(); $includePaths = $this->getIncludePaths(); $suffixes = $this->getSuffixes(); $this->addDebugMessage('<strong>Layout:</strong> ' . $this->layoutId); if (!$layoutId) { if (\is_array($displayData)) { $displayData = array_merge($this->data, $displayData); } // Check possible overrides, and build the full path to layout file $path = $this->getPath(); if ($this->isDebugEnabled()) { echo '<pre>' . $this->renderDebugMessages() . '</pre>'; } // Make sure we send null to FileLayout if no path set $basePath = empty($basePath) ? null : $basePath; $layout = new FileLayout($layoutFile, $basePath, $options); return $layout->render($displayData); }} // Fill the attributes with the file and alt text $attribs['src'] = $file; $attribs['alt'] = $alt; // Render the layout with the attributes return LayoutHelper::render('joomla.html.image', $attribs); } /** * Write a `<link>` element to load a CSS file * foreach ($args as &$arg) { $temp[] = &$arg; } return \call_user_func_array($function, $temp); } /** * Write a `<a>` element * throw new \InvalidArgumentException(\sprintf('%s::%s not found.', $className, $func), 500); } static::register($key, $toCall); return static::call($toCall, $methodArgs); } /** * Registers a function to be called with a specific key *$this->addHeadLink(HTMLHelper::_('image', 'favicon.ico', '', [], true, 1), 'alternate icon', 'rel', ['type' => 'image/vnd.microsoft.icon']);$this->addHeadLink(HTMLHelper::_('image', 'joomla-favicon-pinned.svg', '', [], true, 1), 'mask-icon', 'rel', ['color' => '#000']);// Logo file or site title paramif ($this->params->get('logoFile')) { $logo = HTMLHelper::_('image', Uri::root(false) . htmlspecialchars($this->params->get('logoFile'), ENT_QUOTES), $sitename, ['loading' => 'eager', 'decoding' => 'async'], false, 0);} elseif ($this->params->get('siteTitle')) { $logo = '<span title="' . $sitename . '">' . htmlspecialchars($this->params->get('siteTitle'), ENT_COMPAT, 'UTF-8') . '</span>';} else { $logo = HTMLHelper::_('image', 'logo.svg', $sitename, ['class' => 'logo d-inline-block', 'loading' => 'eager', 'decoding' => 'async'], true, 0);} // Store the file path $this->_file = $directory . '/' . $filename; // Get the file content ob_start(); require $directory . '/' . $filename; $contents = ob_get_clean(); } return $contents; } $this->baseurl = Uri::base(true); $this->params = $params['params'] ?? new Registry(); $this->template = $template; // Load $this->_template = $this->_loadTemplate($baseDir, $file); return $this; } /** * * @since 1.7.0 */ public function parse($params = []) { return $this->_fetchTemplate($params)->_parseTemplate(); } /** * Outputs the template to the browser. * public function render($caching = false, $params = []) { $this->_caching = $caching; if (empty($this->_template)) { $this->parse($params); } if (\array_key_exists('csp_nonce', $params) && $params['csp_nonce'] !== null) { $this->cspNonce = $params['csp_nonce']; } $this->debug = $params['debug'] ?? false; $this->error = $this->_error; $params['file'] = 'error.php'; return parent::render($cache, $params); } /** * Render the backtrace * ob_end_clean(); } $this->getDocument()->setTitle(Text::_('Error') . ': ' . $error->getCode()); return $this->getDocument()->render( false, [ 'template' => $template->template, 'directory' => JPATH_THEMES, 'debug' => JDEBUG, 'subject' => $app, 'document' => $renderer->getDocument(), ]) ); $data = $renderer->render($error); // If nothing was rendered, just use the message from the Exception if (empty($data)) { $data = $error->getMessage(); } * @since 3.10.0 */ public static function handleException(\Throwable $error) { static::logException($error); static::render($error); } /** * Render the error page based on an exception. * ); // Trigger the onError event. $this->dispatchEvent('onError', $event); ExceptionHandler::handleException($event->getError()); } // Trigger the onBeforeRespond event. $this->dispatchEvent( 'onBeforeRespond',// Set the application as global app\Joomla\CMS\Factory::$application = $app;// Execute the application.$app->execute(); // ... die
die();
}
// Run the application - All executable code should be triggered through this file
require_once __DIR__ . '/includes/app.php';
$this->processParseRules($uri, self::PROCESS_AFTER); // Check if all parts of the URL have been parsed. // Otherwise we have an invalid URL if (\strlen($uri->getPath()) > 0) { throw new RouteNotFoundException(Text::_('JERROR_PAGE_NOT_FOUND')); } if ($setVars) { $this->setVars($uri->getQuery(true)); // Get the full request URI. $uri = clone Uri::getInstance(); // It is not possible to inject the SiteRouter as it requires a SiteApplication // and we would end in an infinite loop $result = $this->getContainer()->get(SiteRouter::class)->parse($uri, true); $active = $this->getMenu()->getActive(); if ( $active !== null // Mark afterInitialise in the profiler. JDEBUG ? $this->profiler->mark('afterInitialise') : null; // Route the application $this->route(); // Mark afterRoute in the profiler. JDEBUG ? $this->profiler->mark('afterRoute') : null; if (!$this->isHandlingMultiFactorAuthentication()) { // Mark beforeExecute in the profiler. JDEBUG ? $this->profiler->mark('beforeExecute event dispatched') : null; // Perform application routines. $this->doExecute(); // If we have an application document object, render it. if ($this->document instanceof \Joomla\CMS\Document\Document) { // Render the application output. $this->render();// Set the application as global app\Joomla\CMS\Factory::$application = $app;// Execute the application.$app->execute(); // ... die
die();
}
// Run the application - All executable code should be triggered through this file
require_once __DIR__ . '/includes/app.php';
|
[2/2]
Error
|
|---|
Error:
Undefined constant "T4\Helper\T4PATH_TPL"
at /homepages/12/d293528877/htdocs/Siteblproduction joomla4/plugins/system/t4/src/t4/Helper/Path.php:98
at T4\Helper\Path::addIncludePath()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/plugins/system/t4/t4.php:312)
at PlgSystemT4->onLayoutIncludePaths()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/Plugin/CMSPlugin.php:386)
at Joomla\CMS\Plugin\CMSPlugin->{closure:Joomla\CMS\Plugin\CMSPlugin::registerLegacyListener():370}()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/vendor/joomla/event/src/Dispatcher.php:454)
at Joomla\Event\Dispatcher->dispatch()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/Application/EventAware.php:111)
at Joomla\CMS\Application\WebApplication->triggerEvent()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/plugins/system/t4/src/joomla/src/Layout/FileLayout.php:24)
at Joomla\CMS\Layout\FileLayout->getDefaultIncludePaths()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/administrator/cache/t4core/FileLayout.php:283)
at Joomla\CMS\Layout\_JFileLayout->getIncludePaths()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/administrator/cache/t4core/FileLayout.php:144)
at Joomla\CMS\Layout\_JFileLayout->getPath()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/administrator/cache/t4core/FileLayout.php:116)
at Joomla\CMS\Layout\_JFileLayout->render()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/Layout/LayoutHelper.php:76)
at Joomla\CMS\Layout\LayoutHelper::render()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/HTML/HTMLHelper.php:777)
at Joomla\CMS\HTML\HTMLHelper::image()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/HTML/HTMLHelper.php:307)
at Joomla\CMS\HTML\HTMLHelper::call()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/HTML/HTMLHelper.php:195)
at Joomla\CMS\HTML\HTMLHelper::_()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/templates/cassiopeia/error.php:120)
at require('/homepages/12/d293528877/htdocs/Siteblproduction joomla4/templates/cassiopeia/error.php')
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/Document/HtmlDocument.php:734)
at Joomla\CMS\Document\HtmlDocument->_loadTemplate()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/Document/HtmlDocument.php:791)
at Joomla\CMS\Document\HtmlDocument->_fetchTemplate()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/Document/HtmlDocument.php:625)
at Joomla\CMS\Document\HtmlDocument->parse()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/Document/HtmlDocument.php:643)
at Joomla\CMS\Document\HtmlDocument->render()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/Document/ErrorDocument.php:139)
at Joomla\CMS\Document\ErrorDocument->render()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/Error/Renderer/HtmlRenderer.php:70)
at Joomla\CMS\Error\Renderer\HtmlRenderer->render()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/Exception/ExceptionHandler.php:142)
at Joomla\CMS\Exception\ExceptionHandler::render()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/Exception/ExceptionHandler.php:76)
at Joomla\CMS\Exception\ExceptionHandler::handleException()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/Application/CMSApplication.php:350)
at Joomla\CMS\Application\CMSApplication->execute()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/includes/app.php:58)
at require_once('/homepages/12/d293528877/htdocs/Siteblproduction joomla4/includes/app.php')
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/index.php:51)
|
|
[1/2]
RouteNotFoundException
|
|---|
Joomla\CMS\Router\Exception\RouteNotFoundException:
Page introuvable
at /homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/Router/Router.php:166
at Joomla\CMS\Router\Router->parse()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/Application/SiteApplication.php:607)
at Joomla\CMS\Application\SiteApplication->route()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/Application/SiteApplication.php:244)
at Joomla\CMS\Application\SiteApplication->doExecute()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/libraries/src/Application/CMSApplication.php:320)
at Joomla\CMS\Application\CMSApplication->execute()
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/includes/app.php:58)
at require_once('/homepages/12/d293528877/htdocs/Siteblproduction joomla4/includes/app.php')
(/homepages/12/d293528877/htdocs/Siteblproduction joomla4/index.php:51)
|