$head = (array)$file->content();
static::$instances[$outline] = new static(isset($head['atoms']) ? $head['atoms'] : [], $outline);
$file->free();
static::$instances[$outline]->init();
}
return static::$instances[$outline];
}
/**
* Atoms constructor.
* @param array $atoms
* @param string $name
*/
public function __construct(array $atoms = [], $name = null)
{
$this->name = $name;
$this->items = array_filter($atoms);
$this->inherit = file_exists('gantry-admin://blueprints/layout/inheritance/atom.yaml');
foreach ($this->items as &$item) {
if (!empty($item['id'])) {
$this->ids[$item['id']] = $item;
}
}
}
/**
* @return $this
*/
public function init()
{
foreach ($this->items as &$item) {
if (!empty($item['inherit']['outline']) && !empty($item['inherit']['atom'])) {
$inherited = static::instance($item['inherit']['outline']);
$test = $inherited->id($item['inherit']['atom']);
if (isset($test['attributes'])) {
$item['attributes'] = $test['attributes'];
} else {
Arguments
"Creation of dynamic property RocketTheme\Toolbox\StreamWrapper\ReadOnlyStream::$context is deprecated"
$head = (array)$file->content();
static::$instances[$outline] = new static(isset($head['atoms']) ? $head['atoms'] : [], $outline);
$file->free();
static::$instances[$outline]->init();
}
return static::$instances[$outline];
}
/**
* Atoms constructor.
* @param array $atoms
* @param string $name
*/
public function __construct(array $atoms = [], $name = null)
{
$this->name = $name;
$this->items = array_filter($atoms);
$this->inherit = file_exists('gantry-admin://blueprints/layout/inheritance/atom.yaml');
foreach ($this->items as &$item) {
if (!empty($item['id'])) {
$this->ids[$item['id']] = $item;
}
}
}
/**
* @return $this
*/
public function init()
{
foreach ($this->items as &$item) {
if (!empty($item['inherit']['outline']) && !empty($item['inherit']['atom'])) {
$inherited = static::instance($item['inherit']['outline']);
$test = $inherited->id($item['inherit']['atom']);
if (isset($test['attributes'])) {
$item['attributes'] = $test['attributes'];
} else {
Arguments
"gantry-admin://blueprints/layout/inheritance/atom.yaml"
// Locate all configuration files to be compiled.
$files = (new ConfigFileFinder)->locateFiles($paths);
$cache = $locator->findResource('gantry-cache://theme/compiled/config', true, true);
if (is_bool($cache)) {
throw new \RuntimeException('Who just removed Gantry 5 cache folder? Try reloading the page if it fixes the issue');
}
$compiled = new CompiledConfig($cache, $files, GANTRY5_ROOT);
$compiled->setBlueprints(static function() use ($container) {
return $container['blueprints'];
});
$config = $compiled->load($withDefaults);
// Set atom inheritance.
$atoms = $config->get('page.head.atoms');
if (is_array($atoms)) {
$config->set('page.head.atoms', (new Atoms($atoms))->init()->toArray());
}
// Set FA default in Joomla
if (class_exists(Version::class)) {
$config->def('page.fontawesome.default_version', Version::MAJOR_VERSION < 4 ? 'fa4' : 'fa5css');
} else {
$config->def('page.fontawesome.default_version', 'fa4');
}
return $config;
}
}
Arguments
array:1 [
0 => array:4 [
"type" => "frameworks"
"title" => "JavaScript Frameworks"
"attributes" => array:4 [
"enabled" => "1"
"jquery" => array:3 [
"enabled" => "1"
"ui_core" => "1"
"ui_sortable" => "0"
]
"bootstrap" => array:1 [
"enabled" => "0"
]
"mootools" => array:2 [
"enabled" => "0"
"more" => "0"
]
]
"id" => "frameworks-1582"
]
]
if ($force) {
unset($gantry['configuration']);
}
// Set default name only if configuration has not been set before.
if ($name === null && !isset($gantry['configuration'])) {
$name = 'default';
}
$outline = isset($gantry['configuration']) ? $gantry['configuration'] : null;
// Set configuration if given.
if ($name && $name !== $outline) {
if (\GANTRY_DEBUGGER) {
Debugger::addMessage("Using Gantry outline {$name}");
}
$gantry['configuration'] = $name;
unset($gantry['config']);
$gantry['config'] = ConfigServiceProvider::load($gantry, $name);
}
return $this;
}
/**
* Get current preset.
*
* @param bool $forced If true, return only forced preset or null.
* @return string|null $preset
*/
public function preset($forced = false)
{
$presets = $this->presets()->toArray();
$preset = $this->preset;
if (!$preset && !$forced) {
/** @var Config $config */
$config = static::gantry()['config'];
Arguments
Gantry\Framework\Gantry {#650}
"_error"
}
$gantry = include $className;
/** @var Theme $theme */
$theme = $gantry['theme'];
$app = Factory::getApplication();
$context = array(
'errorcode' => isset($this->error) ? $this->error->getCode() : null,
'error' => isset($this->error) ? $this->error->getMessage() : null,
'debug' => $app->get('debug_lang', '0') == '1' || $app->get('debug', '0') == '1',
'backtrace' => $this->debug ? $this->renderBacktrace() : null
);
// Reset used outline configuration.
unset($gantry['configuration']);
// Render the page.
echo $theme
->setLayout('_error', true)
->render('error.html.twig', $context);
Arguments
*
* @param string $directory The name of the template
* @param string $filename The actual filename
*
* @return string The contents of the template
*
* @since 1.7.0
*/
protected function _loadTemplate($directory, $filename)
{
$contents = '';
// Check to see if we have a valid template file
if (is_file($directory . '/' . $filename)) {
// Store the file path
$this->_file = $directory . '/' . $filename;
// Get the file content
ob_start();
require $directory . '/' . $filename;
$contents = ob_get_contents();
ob_end_clean();
}
return $contents;
}
/**
* Fetch the template, and initialise the params
*
* @param array $params Parameters to determine the template
*
* @return HtmlDocument instance of $this to allow chaining
*
* @since 1.7.0
*/
protected function _fetchTemplate($params = [])
{
// Check
$directory = $params['directory'] ?? 'templates';
Arguments
"/web/folkivan/folkivan.hu/templates/rt_clarity/error.php"
}
}
}
// Load the language file for the template
$lang = CmsFactory::getLanguage();
// 1.5 or core then 1.6
$lang->load('tpl_' . $template, JPATH_BASE)
|| ($inherits !== '' && $lang->load('tpl_' . $inherits, JPATH_BASE))
|| $lang->load('tpl_' . $template, $directory . '/' . $template)
|| ($inherits !== '' && $lang->load('tpl_' . $inherits, $directory . '/' . $inherits));
// Assign the variables
$this->baseurl = Uri::base(true);
$this->params = $params['params'] ?? new Registry();
$this->template = $template;
// Load
$this->_template = $this->_loadTemplate($baseDir, $file);
return $this;
}
/**
* Parse a document template
*
* @return HtmlDocument instance of $this to allow chaining
*
* @since 1.7.0
*/
protected function _parseTemplate()
{
$matches = [];
if (preg_match_all('#<jdoc:include\ type="([^"]+)"(.*)\/>#iU', $this->_template, $matches)) {
$messages = [];
$template_tags_first = [];
$template_tags_last = [];
Arguments
"/web/folkivan/folkivan.hu/templates/rt_clarity"
"error.php"
$options['title'] = $args[3] ?? null;
}
parent::$_buffer[$options['type']][$options['name']][$options['title']] = $content;
return $this;
}
/**
* Parses the template and populates the buffer
*
* @param array $params Parameters for fetching the template
*
* @return HtmlDocument instance of $this to allow chaining
*
* @since 1.7.0
*/
public function parse($params = [])
{
return $this->_fetchTemplate($params)->_parseTemplate();
}
/**
* Outputs the template to the browser.
*
* @param boolean $caching If true, cache the output
* @param array $params Associative array of attributes
*
* @return string The rendered data
*
* @since 1.7.0
*/
public function render($caching = false, $params = [])
{
$this->_caching = $caching;
if (empty($this->_template)) {
$this->parse($params);
}
Arguments
array:7 [
"template" => "rt_clarity"
"directory" => "/web/folkivan/folkivan.hu/templates"
"debug" => false
"csp_nonce" => null
"templateInherits" => ""
"params" => Joomla\Registry\Registry {#652}
"file" => "error.php"
]
{
return $this->_fetchTemplate($params)->_parseTemplate();
}
/**
* Outputs the template to the browser.
*
* @param boolean $caching If true, cache the output
* @param array $params Associative array of attributes
*
* @return string The rendered data
*
* @since 1.7.0
*/
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'];
}
$data = $this->_renderTemplate();
parent::render($caching, $params);
return $data;
}
/**
* Count the modules in the given position
*
* @param string $positionName The position to use
* @param boolean $withContentOnly Count only a modules which actually has a content
*
* @return integer Number of modules found
*
Arguments
array:7 [
"template" => "rt_clarity"
"directory" => "/web/folkivan/folkivan.hu/templates"
"debug" => false
"csp_nonce" => null
"templateInherits" => ""
"params" => Joomla\Registry\Registry {#652}
"file" => "error.php"
]
if ($status < 400 || $status > 599) {
$status = 500;
}
$errorReporting = CmsFactory::getApplication()->get('error_reporting');
if ($errorReporting === "development" || $errorReporting === "maximum") {
$status .= ' ' . str_replace("\n", ' ', $this->_error->getMessage());
}
CmsFactory::getApplication()->setHeader('status', $status);
// Set variables
$this->debug = $params['debug'] ?? false;
$this->error = $this->_error;
$params['file'] = 'error.php';
return parent::render($cache, $params);
}
/**
* Render the backtrace
*
* @return string The contents of the backtrace
*
* @since 1.7.0
*/
public function renderBacktrace()
{
// If no error object is set return null
if (!isset($this->_error)) {
return;
}
// The back trace
$backtrace = $this->_error->getTrace();
// Add the position of the actual file
Arguments
false
array:7 [
"template" => "rt_clarity"
"directory" => "/web/folkivan/folkivan.hu/templates"
"debug" => false
"csp_nonce" => null
"templateInherits" => ""
"params" => Joomla\Registry\Registry {#652}
"file" => "error.php"
]
// Push the error object into the document
$this->getDocument()->setError($error);
// Add registry file for the template asset
$wa = $this->getDocument()->getWebAssetManager()->getRegistry();
$wa->addTemplateRegistryFile($template->template, $app->getClientId());
if (!empty($template->parent)) {
$wa->addTemplateRegistryFile($template->parent, $app->getClientId());
}
if (ob_get_contents()) {
ob_end_clean();
}
$this->getDocument()->setTitle(Text::_('Error') . ': ' . $error->getCode());
return $this->getDocument()->render(
false,
[
'template' => $template->template,
'directory' => JPATH_THEMES,
'debug' => JDEBUG,
'csp_nonce' => $app->get('csp_nonce'),
'templateInherits' => $template->parent,
'params' => $template->params,
]
);
}
}
Arguments
false
array:7 [
"template" => "rt_clarity"
"directory" => "/web/folkivan/folkivan.hu/templates"
"debug" => false
"csp_nonce" => null
"templateInherits" => ""
"params" => Joomla\Registry\Registry {#652}
"file" => "error.php"
]
* Lastly, if all else fails, we default onto the HTML format to at least render something
*/
if (Factory::$document) {
$format = Factory::$document->getType();
} else {
$format = $app->input->getString('format', 'html');
}
try {
$renderer = AbstractRenderer::getRenderer($format);
} catch (\InvalidArgumentException $e) {
// Default to the HTML renderer
$renderer = AbstractRenderer::getRenderer('html');
}
// Reset the document object in the factory, this gives us a clean slate and lets everything render properly
Factory::$document = $renderer->getDocument();
Factory::getApplication()->loadDocument(Factory::$document);
$data = $renderer->render($error);
// If nothing was rendered, just use the message from the Exception
if (empty($data)) {
$data = $error->getMessage();
}
if ($isCli) {
echo $data;
} else {
/** @var CMSApplication $app */
// Do not allow cache
$app->allowCache(false);
$app->setBody($data);
}
// This return is needed to ensure the test suite does not trigger the non-Exception handling below
return;
} catch (\Throwable $errorRendererError) {
Arguments
Whoops\Exception\ErrorException {#668
#message: "Creation of dynamic property RocketTheme\Toolbox\StreamWrapper\ReadOnlyStream::$context is deprecated"
#code: 8192
#file: "/web/folkivan/folkivan.hu/libraries/gantry5/src/classes/Gantry/Framework/Atoms.php"
#line: 73
#severity: E_DEPRECATED
}
}
}
// Always return false, this will tell PHP to handle the error internally
return false;
}
/**
* Handles exceptions: logs errors and renders error page.
*
* @param \Exception|\Throwable $error An Exception or Throwable (PHP 7+) object for which to render the error page.
*
* @return void
*
* @since 3.10.0
*/
public static function handleException(\Throwable $error)
{
static::logException($error);
static::render($error);
}
/**
* Render the error page based on an exception.
*
* @param \Throwable $error An Exception or Throwable (PHP 7+) object for which to render the error page.
*
* @return void
*
* @since 3.0
*/
public static function render(\Throwable $error)
{
try {
$app = Factory::getApplication();
// Flag if we are on cli
$isCli = $app->isClient('cli');
// If site is offline and it's a 404 error, just go to index (to see offline message, instead of 404)
Arguments
Whoops\Exception\ErrorException {#668
#message: "Creation of dynamic property RocketTheme\Toolbox\StreamWrapper\ReadOnlyStream::$context is deprecated"
#code: 8192
#file: "/web/folkivan/folkivan.hu/libraries/gantry5/src/classes/Gantry/Framework/Atoms.php"
#line: 73
#severity: E_DEPRECATED
}
$this->compress();
// Trigger the onAfterCompress event.
$this->triggerEvent('onAfterCompress');
}
} catch (\Throwable $throwable) {
/** @var ErrorEvent $event */
$event = AbstractEvent::create(
'onError',
[
'subject' => $throwable,
'eventClass' => ErrorEvent::class,
'application' => $this,
]
);
// Trigger the onError event.
$this->triggerEvent('onError', $event);
ExceptionHandler::handleException($event->getError());
}
// Trigger the onBeforeRespond event.
$this->getDispatcher()->dispatch('onBeforeRespond');
// Send the application response.
$this->respond();
// Trigger the onAfterRespond event.
$this->getDispatcher()->dispatch('onAfterRespond');
}
/**
* Check if the user is required to reset their password.
*
* If the user is required to reset their password will be redirected to the page that manage the password reset.
*
* @param string $option The option that manage the password reset
* @param string $view The view that manage the password reset
* @param string $layout The layout of the view that manage the password reset
Arguments
Whoops\Exception\ErrorException {#668
#message: "Creation of dynamic property RocketTheme\Toolbox\StreamWrapper\ReadOnlyStream::$context is deprecated"
#code: 8192
#file: "/web/folkivan/folkivan.hu/libraries/gantry5/src/classes/Gantry/Framework/Atoms.php"
#line: 73
#severity: E_DEPRECATED
}
$head = (array)$file->content();
static::$instances[$outline] = new static(isset($head['atoms']) ? $head['atoms'] : [], $outline);
$file->free();
static::$instances[$outline]->init();
}
return static::$instances[$outline];
}
/**
* Atoms constructor.
* @param array $atoms
* @param string $name
*/
public function __construct(array $atoms = [], $name = null)
{
$this->name = $name;
$this->items = array_filter($atoms);
$this->inherit = file_exists('gantry-admin://blueprints/layout/inheritance/atom.yaml');
foreach ($this->items as &$item) {
if (!empty($item['id'])) {
$this->ids[$item['id']] = $item;
}
}
}
/**
* @return $this
*/
public function init()
{
foreach ($this->items as &$item) {
if (!empty($item['inherit']['outline']) && !empty($item['inherit']['atom'])) {
$inherited = static::instance($item['inherit']['outline']);
$test = $inherited->id($item['inherit']['atom']);
if (isset($test['attributes'])) {
$item['attributes'] = $test['attributes'];
} else {
Arguments
"Creation of dynamic property RocketTheme\Toolbox\StreamWrapper\ReadOnlyStream::$context is deprecated"
$head = (array)$file->content();
static::$instances[$outline] = new static(isset($head['atoms']) ? $head['atoms'] : [], $outline);
$file->free();
static::$instances[$outline]->init();
}
return static::$instances[$outline];
}
/**
* Atoms constructor.
* @param array $atoms
* @param string $name
*/
public function __construct(array $atoms = [], $name = null)
{
$this->name = $name;
$this->items = array_filter($atoms);
$this->inherit = file_exists('gantry-admin://blueprints/layout/inheritance/atom.yaml');
foreach ($this->items as &$item) {
if (!empty($item['id'])) {
$this->ids[$item['id']] = $item;
}
}
}
/**
* @return $this
*/
public function init()
{
foreach ($this->items as &$item) {
if (!empty($item['inherit']['outline']) && !empty($item['inherit']['atom'])) {
$inherited = static::instance($item['inherit']['outline']);
$test = $inherited->id($item['inherit']['atom']);
if (isset($test['attributes'])) {
$item['attributes'] = $test['attributes'];
} else {
Arguments
"gantry-admin://blueprints/layout/inheritance/atom.yaml"
// Locate all configuration files to be compiled.
$files = (new ConfigFileFinder)->locateFiles($paths);
$cache = $locator->findResource('gantry-cache://theme/compiled/config', true, true);
if (is_bool($cache)) {
throw new \RuntimeException('Who just removed Gantry 5 cache folder? Try reloading the page if it fixes the issue');
}
$compiled = new CompiledConfig($cache, $files, GANTRY5_ROOT);
$compiled->setBlueprints(static function() use ($container) {
return $container['blueprints'];
});
$config = $compiled->load($withDefaults);
// Set atom inheritance.
$atoms = $config->get('page.head.atoms');
if (is_array($atoms)) {
$config->set('page.head.atoms', (new Atoms($atoms))->init()->toArray());
}
// Set FA default in Joomla
if (class_exists(Version::class)) {
$config->def('page.fontawesome.default_version', Version::MAJOR_VERSION < 4 ? 'fa4' : 'fa5css');
} else {
$config->def('page.fontawesome.default_version', 'fa4');
}
return $config;
}
}
Arguments
array:1 [
0 => array:4 [
"type" => "frameworks"
"title" => "JavaScript Frameworks"
"attributes" => array:4 [
"enabled" => "1"
"jquery" => array:3 [
"enabled" => "1"
"ui_core" => "1"
"ui_sortable" => "0"
]
"bootstrap" => array:1 [
"enabled" => "0"
]
"mootools" => array:2 [
"enabled" => "0"
"more" => "0"
]
]
"id" => "frameworks-1582"
]
]
if ($force) {
unset($gantry['configuration']);
}
// Set default name only if configuration has not been set before.
if ($name === null && !isset($gantry['configuration'])) {
$name = 'default';
}
$outline = isset($gantry['configuration']) ? $gantry['configuration'] : null;
// Set configuration if given.
if ($name && $name !== $outline) {
if (\GANTRY_DEBUGGER) {
Debugger::addMessage("Using Gantry outline {$name}");
}
$gantry['configuration'] = $name;
unset($gantry['config']);
$gantry['config'] = ConfigServiceProvider::load($gantry, $name);
}
return $this;
}
/**
* Get current preset.
*
* @param bool $forced If true, return only forced preset or null.
* @return string|null $preset
*/
public function preset($forced = false)
{
$presets = $this->presets()->toArray();
$preset = $this->preset;
if (!$preset && !$forced) {
/** @var Config $config */
$config = static::gantry()['config'];
Arguments
Gantry\Framework\Gantry {#650}
13
}
if (\GANTRY_DEBUGGER) {
Debugger::addMessage("Using Gantry 5 template {$templateName}");
}
/** @var Theme $theme */
$theme = $gantry['theme'];
$assignments = new Assignments();
if (\GANTRY_DEBUGGER) {
Debugger::addMessage('Selecting outline (rules, matches, scores):', 'debug');
Debugger::addMessage($assignments->getPage(), 'debug');
Debugger::addMessage($assignments->loadAssignments(), 'debug');
Debugger::addMessage($assignments->matches(), 'debug');
Debugger::addMessage($assignments->scores(), 'debug');
}
$theme->setLayout($assignments->select());
if ($this->params->get('asset_timestamps', 1)) {
$age = (int)($this->params->get('asset_timestamps_period', 7) * 86400);
Document::$timestamp_age = $age > 0 ? $age : PHP_INT_MAX;
} else {
Document::$timestamp_age = 0;
}
}
/**
* Re-route Gantry templates to Gantry Administration component.
*/
private function onAfterRouteAdmin()
{
$input = $this->app->input;
$option = $input->getCmd('option');
$task = $input->getCmd('task');
if (in_array($option, array('com_templates', 'com_advancedtemplates'), true)) {
Arguments
/**
* Return global configuration for Gantry5.
*
* @param array $global
*/
public function onGantryGlobalConfig(&$global)
{
$global = $this->params->toArray();
}
public function onAfterRoute()
{
if (version_compare(JVERSION, '4.0', '<')) {
// In Joomla 3.9 we need to make sure that user identity has been loaded.
$this->app->loadIdentity();
}
if ($this->app->isClient('site')) {
$this->onAfterRouteSite();
} elseif ($this->app->isClient('administrator')) {
$this->onAfterRouteAdmin();
}
}
/**
* Document gets set during dispatch, we need language and direction.
*/
public function onAfterDispatch()
{
if (class_exists('Gantry\Framework\Gantry')) {
$this->onAfterDispatchSiteAdmin();
}
}
public function onAfterRender()
{
if ($this->app->isClient('site') && class_exists('Gantry\Framework\Gantry')) {
$this->onAfterRenderSite();
{
$this->getDispatcher()->addListener(
$methodName,
function (AbstractEvent $event) use ($methodName) {
// Get the event arguments
$arguments = $event->getArguments();
// Extract any old results; they must not be part of the method call.
$allResults = [];
if (isset($arguments['result'])) {
$allResults = $arguments['result'];
unset($arguments['result']);
}
// Convert to indexed array for unpacking.
$arguments = \array_values($arguments);
$result = $this->{$methodName}(...$arguments);
// Ignore null results
if ($result === null) {
return;
}
// Restore the old results and add the new result from our method call
$allResults[] = $result;
$event['result'] = $allResults;
}
);
}
/**
* Registers a proper event listener, i.e. a method which accepts an AbstractEvent as its sole argument. This is the
* preferred way to implement plugins in Joomla! 4.x and will be the only possible method with Joomla! 5.x onwards.
*
* @param string $methodName The method name to register
*
* @return void
trigger_deprecation(
'joomla/event',
'2.0.0',
'Not passing an event object to %s() is deprecated, as of 3.0 the $event argument will be required.',
__METHOD__
);
$event = $this->getDefaultEvent($name);
}
if (isset($this->listeners[$event->getName()]))
{
foreach ($this->listeners[$event->getName()] as $listener)
{
if ($event->isStopped())
{
return $event;
}
$listener($event);
}
}
return $event;
}
/**
* Trigger an event.
*
* @param EventInterface|string $event The event object or name.
*
* @return EventInterface The event after being passed through all listeners.
*
* @since 1.0
* @deprecated 3.0 Use dispatch() instead.
*/
public function triggerEvent($event)
{
trigger_deprecation(
'joomla/event',
Arguments
Joomla\Event\Event {#635}
public function triggerEvent($eventName, $args = [])
{
try {
$dispatcher = $this->getDispatcher();
} catch (\UnexpectedValueException $exception) {
$this->getLogger()->error(sprintf('Dispatcher not set in %s, cannot trigger events.', \get_class($this)));
return [];
}
if ($args instanceof Event) {
$event = $args;
} elseif (\is_array($args)) {
$className = self::getEventClassByEventName($eventName);
$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'];
}
}
Arguments
"onAfterRoute"
Joomla\Event\Event {#635}
if ($position !== false) {
$oldUri->setPath($base . '/' . substr_replace($oldPath, $item->route, $position, \strlen($activePathPrefix)));
$this->setHeader('Expires', 'Wed, 17 Aug 2005 00:00:00 GMT', true);
$this->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT', true);
$this->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate', false);
$this->sendHeaders();
$this->redirect((string) $oldUri, 301);
}
}
}
foreach ($result as $key => $value) {
$this->input->def($key, $value);
}
// Trigger the onAfterRoute event.
PluginHelper::importPlugin('system');
$this->triggerEvent('onAfterRoute');
$Itemid = $this->input->getInt('Itemid', null);
$this->authorise($Itemid);
}
/**
* Set the current state of the detect browser option.
*
* @param boolean $state The new state of the detect browser option
*
* @return boolean The previous state
*
* @since 3.2
*/
public function setDetectBrowser($state = false)
{
$old = $this->getDetectBrowser();
$this->detect_browser = $state;
return $old;
Arguments
$this->triggerEvent('onAfterDispatch');
}
/**
* Method to run the Web application routines.
*
* @return void
*
* @since 3.2
*/
protected function doExecute()
{
// Initialise the application
$this->initialiseApp();
// 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()) {
/*
* Check if the user is required to reset their password
*
* Before $this->route(); "option" and "view" can't be safely read using:
* $this->input->getCmd('option'); or $this->input->getCmd('view');
* ex: due of the sef urls
*/
$this->checkUserRequireReset('com_users', 'profile', 'edit', 'com_users/profile.save,com_users/profile.apply,com_users/user.logout');
}
// Dispatch the application
$this->dispatch();
// Mark afterDispatch in the profiler.
JDEBUG ? $this->profiler->mark('afterDispatch') : null;
throw new \RuntimeException('Invalid input, aborting application.');
}
}
/**
* Execute the application.
*
* @return void
*
* @since 3.2
*/
public function execute()
{
try {
$this->sanityCheckSystemVariables();
$this->setupLogging();
$this->createExtensionNamespaceMap();
// 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();
}
// If gzip compression is enabled in configuration and the server is compliant, compress the output.
if ($this->get('gzip') && !ini_get('zlib.output_compression') && ini_get('output_handler') !== 'ob_gzhandler') {
$this->compress();
// Trigger the onAfterCompress event.
$this->triggerEvent('onAfterCompress');
}
} catch (\Throwable $throwable) {
/** @var ErrorEvent $event */
$event = AbstractEvent::create(
'onError',
[
'subject' => $throwable,
*
* In addition to aliasing "common" service keys, we also create aliases for the PHP classes to ensure autowiring objects
* is supported. This includes aliases for aliased class names, and the keys for aliased class names should be considered
* deprecated to be removed when the class name alias is removed as well.
*/
$container->alias('session.web', 'session.web.site')
->alias('session', 'session.web.site')
->alias('JSession', 'session.web.site')
->alias(\Joomla\CMS\Session\Session::class, 'session.web.site')
->alias(\Joomla\Session\Session::class, 'session.web.site')
->alias(\Joomla\Session\SessionInterface::class, 'session.web.site');
// Instantiate the application.
$app = $container->get(\Joomla\CMS\Application\SiteApplication::class);
// Set the application as global app
\Joomla\CMS\Factory::$application = $app;
// Execute the application.
$app->execute();
define('JOOMLA_MINIMUM_PHP', '7.2.5');
if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<')) {
die(
str_replace(
'{{phpversion}}',
JOOMLA_MINIMUM_PHP,
file_get_contents(dirname(__FILE__) . '/templates/system/incompatible.html')
)
);
}
/**
* Constant that is checked in included files to prevent direct access.
* 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 file
require_once dirname(__FILE__) . '/includes/app.php';
Arguments
"/web/folkivan/folkivan.hu/includes/app.php"