Error
Call to undefined method Gantry\Component\Stylesheet\Scss\Compiler::setOutputStyle()
Previous exceptions
  • Call to undefined method Gantry\Component\Stylesheet\Scss\Compiler::setOutputStyle() (0)
Error thrown with message "Call to undefined method Gantry\Component\Stylesheet\Scss\Compiler::setOutputStyle()" Stacktrace: #70 Error in /home/santmari/public_html/libraries/gantry5/src/classes/Gantry/Component/Stylesheet/ScssCompiler.php:557 #69 Gantry\Component\Stylesheet\ScssCompiler:getCompiler in /home/santmari/public_html/libraries/gantry5/src/classes/Gantry/Component/Stylesheet/ScssCompiler.php:170 #68 Gantry\Component\Stylesheet\ScssCompiler:compileFile in /home/santmari/public_html/libraries/gantry5/src/classes/Gantry/Component/Theme/ThemeTrait.php:271 #67 Gantry\Framework\Theme:css in /home/santmari/public_html/libraries/gantry5/src/classes/Gantry/Component/Content/Block/HtmlBlock.php:86 #66 Gantry\Component\Content\Block\HtmlBlock:getStyles in /home/santmari/public_html/libraries/gantry5/src/classes/Gantry/Component/Content/Document/HtmlDocument.php:221 #65 Gantry\Component\Content\Document\HtmlDocument:getStyles in /home/santmari/public_html/libraries/gantry5/src/classes/Gantry/Framework/Base/Gantry.php:119 #64 Gantry\Framework\Base\Gantry:styles in /home/santmari/public_html/libraries/gantry5/src/classes/Gantry/Framework/Gantry.php:50 #63 Gantry\Framework\Gantry:styles in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:702 #62 Twig\Template:getAttribute in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #61 __TwigTemplate_02a5b84cb0a00cbde5cdc23bc9182a690ffa1a44c70e568926a1874ddc899a34:block_head_application in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:214 #60 Twig\Template:displayBlock in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #59 __TwigTemplate_c96b0ebf620a496573b7bcb2f3f8904feca49bea71ce5331de7a1600504563d5:doDisplay in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:453 #58 Twig\Template:displayWithErrorHandling in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:420 #57 Twig\Template:display in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #56 __TwigTemplate_1d2e6ab141a3882afd7275e5a96fbb689be1492fbd37867789287835d0f241d7:doDisplay in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:453 #55 Twig\Template:displayWithErrorHandling in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:420 #54 Twig\Template:display in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #53 __TwigTemplate_02a5b84cb0a00cbde5cdc23bc9182a690ffa1a44c70e568926a1874ddc899a34:doDisplay in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:453 #52 Twig\Template:displayWithErrorHandling in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:420 #51 Twig\Template:displayBlock in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #50 __TwigTemplate_1e23798d38f0e10c24ed4069059576b856f2063da843581892285372b27edbc1:doDisplay in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:453 #49 Twig\Template:displayWithErrorHandling in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:420 #48 Twig\Template:display in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:432 #47 Twig\Template:render in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/TemplateWrapper.php:47 #46 Twig\TemplateWrapper:render in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Environment.php:384 #45 Twig\Environment:render in /home/santmari/public_html/libraries/gantry5/src/classes/Gantry/Component/Theme/AbstractTheme.php:176 #44 Gantry\Component\Theme\AbstractTheme:render in /home/santmari/public_html/templates/g5_helium/error.php:46 #43 require in /home/santmari/public_html/libraries/src/Document/HtmlDocument.php:741 #42 Joomla\CMS\Document\HtmlDocument:_loadTemplate in /home/santmari/public_html/libraries/src/Document/HtmlDocument.php:796 #41 Joomla\CMS\Document\HtmlDocument:_fetchTemplate in /home/santmari/public_html/libraries/src/Document/HtmlDocument.php:613 #40 Joomla\CMS\Document\HtmlDocument:parse in /home/santmari/public_html/libraries/src/Document/HtmlDocument.php:631 #39 Joomla\CMS\Document\HtmlDocument:render in /home/santmari/public_html/libraries/src/Document/ErrorDocument.php:139 #38 Joomla\CMS\Document\ErrorDocument:render in /home/santmari/public_html/libraries/src/Error/Renderer/HtmlRenderer.php:78 #37 Joomla\CMS\Error\Renderer\HtmlRenderer:render in /home/santmari/public_html/libraries/src/Exception/ExceptionHandler.php:126 #36 Joomla\CMS\Exception\ExceptionHandler:render in /home/santmari/public_html/libraries/src/Exception/ExceptionHandler.php:72 #35 Joomla\CMS\Exception\ExceptionHandler:handleException in /home/santmari/public_html/libraries/src/Application/CMSApplication.php:322 #34 Error in /home/santmari/public_html/libraries/gantry5/src/classes/Gantry/Component/Stylesheet/ScssCompiler.php:557 #33 Gantry\Component\Stylesheet\ScssCompiler:getCompiler in /home/santmari/public_html/libraries/gantry5/src/classes/Gantry/Component/Stylesheet/ScssCompiler.php:170 #32 Gantry\Component\Stylesheet\ScssCompiler:compileFile in /home/santmari/public_html/libraries/gantry5/src/classes/Gantry/Component/Theme/ThemeTrait.php:271 #31 Gantry\Framework\Theme:css in /home/santmari/public_html/libraries/gantry5/src/classes/Gantry/Component/Content/Block/HtmlBlock.php:86 #30 Gantry\Component\Content\Block\HtmlBlock:getStyles in /home/santmari/public_html/libraries/gantry5/src/classes/Gantry/Framework/Document.php:131 #29 Gantry\Framework\Document:registerStyles in /home/santmari/public_html/libraries/gantry5/src/classes/Gantry/Framework/Document.php:76 #28 Gantry\Framework\Document:registerAssets in /home/santmari/public_html/libraries/gantry5/src/classes/Gantry/Framework/Base/Platform.php:277 #27 Gantry\Framework\Base\Platform:finalize in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:700 #26 Twig\Template:getAttribute in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #25 __TwigTemplate_1e23798d38f0e10c24ed4069059576b856f2063da843581892285372b27edbc1:block_page_footer in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:214 #24 Twig\Template:displayBlock in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:175 #23 Twig\Template:displayParentBlock in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #22 __TwigTemplate_56fdccfc1c37525f87b79df4524fe7a94d025ba19375a2682b4a5b874792c745:block_page_footer in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:214 #21 Twig\Template:displayBlock in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #20 __TwigTemplate_1e23798d38f0e10c24ed4069059576b856f2063da843581892285372b27edbc1:doDisplay in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:453 #19 Twig\Template:displayWithErrorHandling in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:420 #18 Twig\Template:display in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #17 __TwigTemplate_56fdccfc1c37525f87b79df4524fe7a94d025ba19375a2682b4a5b874792c745:doDisplay in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:453 #16 Twig\Template:displayWithErrorHandling in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:420 #15 Twig\Template:display in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #14 __TwigTemplate_4c4bbbd27eb223f5e3c3c2ce88dae787fe07da0492baa19293d71770b00974df:doDisplay in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:453 #13 Twig\Template:displayWithErrorHandling in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:420 #12 Twig\Template:display in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Template.php:432 #11 Twig\Template:render in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/TemplateWrapper.php:47 #10 Twig\TemplateWrapper:render in /home/santmari/public_html/libraries/gantry5/compat/vendor/twig/twig/src/Environment.php:384 #9 Twig\Environment:render in /home/santmari/public_html/libraries/gantry5/src/classes/Gantry/Component/Theme/AbstractTheme.php:176 #8 Gantry\Component\Theme\AbstractTheme:render in /home/santmari/public_html/templates/g5_helium/index.php:35 #7 require in /home/santmari/public_html/libraries/src/Document/HtmlDocument.php:741 #6 Joomla\CMS\Document\HtmlDocument:_loadTemplate in /home/santmari/public_html/libraries/src/Document/HtmlDocument.php:796 #5 Joomla\CMS\Document\HtmlDocument:_fetchTemplate in /home/santmari/public_html/libraries/src/Document/HtmlDocument.php:613 #4 Joomla\CMS\Document\HtmlDocument:parse in /home/santmari/public_html/libraries/src/Application/CMSApplication.php:1012 #3 Joomla\CMS\Application\CMSApplication:render in /home/santmari/public_html/libraries/src/Application/SiteApplication.php:724 #2 Joomla\CMS\Application\SiteApplication:render in /home/santmari/public_html/libraries/src/Application/CMSApplication.php:298 #1 Joomla\CMS\Application\CMSApplication:execute in /home/santmari/public_html/includes/app.php:61 #0 require_once in /home/santmari/public_html/index.php:32
Stack frames (71)
70
Error
/src/classes/Gantry/Component/Stylesheet/ScssCompiler.php557
69
Gantry\Component\Stylesheet\ScssCompiler getCompiler
/src/classes/Gantry/Component/Stylesheet/ScssCompiler.php170
68
Gantry\Component\Stylesheet\ScssCompiler compileFile
/src/classes/Gantry/Component/Theme/ThemeTrait.php271
67
Gantry\Framework\Theme css
/src/classes/Gantry/Component/Content/Block/HtmlBlock.php86
66
Gantry\Component\Content\Block\HtmlBlock getStyles
/src/classes/Gantry/Component/Content/Document/HtmlDocument.php221
65
Gantry\Component\Content\Document\HtmlDocument getStyles
/src/classes/Gantry/Framework/Base/Gantry.php119
64
Gantry\Framework\Base\Gantry styles
/src/classes/Gantry/Framework/Gantry.php50
63
Gantry\Framework\Gantry styles
/compat/vendor/twig/twig/src/Template.php702
62
Twig\Template getAttribute
/compat/vendor/twig/twig/src/Environment.php497
61
__TwigTemplate_02a5b84cb0a00cbde5cdc23bc9182a690ffa1a44c70e568926a1874ddc899a34 block_head_application
/compat/vendor/twig/twig/src/Template.php214
60
Twig\Template displayBlock
/compat/vendor/twig/twig/src/Environment.php497
59
__TwigTemplate_c96b0ebf620a496573b7bcb2f3f8904feca49bea71ce5331de7a1600504563d5 doDisplay
/compat/vendor/twig/twig/src/Template.php453
58
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
57
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
56
__TwigTemplate_1d2e6ab141a3882afd7275e5a96fbb689be1492fbd37867789287835d0f241d7 doDisplay
/compat/vendor/twig/twig/src/Template.php453
55
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
54
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
53
__TwigTemplate_02a5b84cb0a00cbde5cdc23bc9182a690ffa1a44c70e568926a1874ddc899a34 doDisplay
/compat/vendor/twig/twig/src/Template.php453
52
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
51
Twig\Template displayBlock
/compat/vendor/twig/twig/src/Environment.php497
50
__TwigTemplate_1e23798d38f0e10c24ed4069059576b856f2063da843581892285372b27edbc1 doDisplay
/compat/vendor/twig/twig/src/Template.php453
49
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
48
Twig\Template display
/compat/vendor/twig/twig/src/Template.php432
47
Twig\Template render
/compat/vendor/twig/twig/src/TemplateWrapper.php47
46
Twig\TemplateWrapper render
/compat/vendor/twig/twig/src/Environment.php384
45
Twig\Environment render
/src/classes/Gantry/Component/Theme/AbstractTheme.php176
44
Gantry\Component\Theme\AbstractTheme render
/home/santmari/public_html/templates/g5_helium/error.php46
43
require
/home/santmari/public_html/libraries/src/Document/HtmlDocument.php741
42
Joomla\CMS\Document\HtmlDocument _loadTemplate
/home/santmari/public_html/libraries/src/Document/HtmlDocument.php796
41
Joomla\CMS\Document\HtmlDocument _fetchTemplate
/home/santmari/public_html/libraries/src/Document/HtmlDocument.php613
40
Joomla\CMS\Document\HtmlDocument parse
/home/santmari/public_html/libraries/src/Document/HtmlDocument.php631
39
Joomla\CMS\Document\HtmlDocument render
/home/santmari/public_html/libraries/src/Document/ErrorDocument.php139
38
Joomla\CMS\Document\ErrorDocument render
/home/santmari/public_html/libraries/src/Error/Renderer/HtmlRenderer.php78
37
Joomla\CMS\Error\Renderer\HtmlRenderer render
/home/santmari/public_html/libraries/src/Exception/ExceptionHandler.php126
36
Joomla\CMS\Exception\ExceptionHandler render
/home/santmari/public_html/libraries/src/Exception/ExceptionHandler.php72
35
Joomla\CMS\Exception\ExceptionHandler handleException
/home/santmari/public_html/libraries/src/Application/CMSApplication.php322
34
Error
/src/classes/Gantry/Component/Stylesheet/ScssCompiler.php557
33
Gantry\Component\Stylesheet\ScssCompiler getCompiler
/src/classes/Gantry/Component/Stylesheet/ScssCompiler.php170
32
Gantry\Component\Stylesheet\ScssCompiler compileFile
/src/classes/Gantry/Component/Theme/ThemeTrait.php271
31
Gantry\Framework\Theme css
/src/classes/Gantry/Component/Content/Block/HtmlBlock.php86
30
Gantry\Component\Content\Block\HtmlBlock getStyles
/src/classes/Gantry/Framework/Document.php131
29
Gantry\Framework\Document registerStyles
/src/classes/Gantry/Framework/Document.php76
28
Gantry\Framework\Document registerAssets
/src/classes/Gantry/Framework/Base/Platform.php277
27
Gantry\Framework\Base\Platform finalize
/compat/vendor/twig/twig/src/Template.php700
26
Twig\Template getAttribute
/compat/vendor/twig/twig/src/Environment.php497
25
__TwigTemplate_1e23798d38f0e10c24ed4069059576b856f2063da843581892285372b27edbc1 block_page_footer
/compat/vendor/twig/twig/src/Template.php214
24
Twig\Template displayBlock
/compat/vendor/twig/twig/src/Template.php175
23
Twig\Template displayParentBlock
/compat/vendor/twig/twig/src/Environment.php497
22
__TwigTemplate_56fdccfc1c37525f87b79df4524fe7a94d025ba19375a2682b4a5b874792c745 block_page_footer
/compat/vendor/twig/twig/src/Template.php214
21
Twig\Template displayBlock
/compat/vendor/twig/twig/src/Environment.php497
20
__TwigTemplate_1e23798d38f0e10c24ed4069059576b856f2063da843581892285372b27edbc1 doDisplay
/compat/vendor/twig/twig/src/Template.php453
19
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
18
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
17
__TwigTemplate_56fdccfc1c37525f87b79df4524fe7a94d025ba19375a2682b4a5b874792c745 doDisplay
/compat/vendor/twig/twig/src/Template.php453
16
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
15
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
14
__TwigTemplate_4c4bbbd27eb223f5e3c3c2ce88dae787fe07da0492baa19293d71770b00974df doDisplay
/compat/vendor/twig/twig/src/Template.php453
13
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
12
Twig\Template display
/compat/vendor/twig/twig/src/Template.php432
11
Twig\Template render
/compat/vendor/twig/twig/src/TemplateWrapper.php47
10
Twig\TemplateWrapper render
/compat/vendor/twig/twig/src/Environment.php384
9
Twig\Environment render
/src/classes/Gantry/Component/Theme/AbstractTheme.php176
8
Gantry\Component\Theme\AbstractTheme render
/home/santmari/public_html/templates/g5_helium/index.php35
7
require
/home/santmari/public_html/libraries/src/Document/HtmlDocument.php741
6
Joomla\CMS\Document\HtmlDocument _loadTemplate
/home/santmari/public_html/libraries/src/Document/HtmlDocument.php796
5
Joomla\CMS\Document\HtmlDocument _fetchTemplate
/home/santmari/public_html/libraries/src/Document/HtmlDocument.php613
4
Joomla\CMS\Document\HtmlDocument parse
/home/santmari/public_html/libraries/src/Application/CMSApplication.php1012
3
Joomla\CMS\Application\CMSApplication render
/home/santmari/public_html/libraries/src/Application/SiteApplication.php724
2
Joomla\CMS\Application\SiteApplication render
/home/santmari/public_html/libraries/src/Application/CMSApplication.php298
1
Joomla\CMS\Application\CMSApplication execute
/home/santmari/public_html/includes/app.php61
0
require_once
/home/santmari/public_html/index.php32
        /** @var UniformResourceLocator $locator */
        $locator = Gantry::instance()['locator'];
        $cacheDir = $locator->findResource('gantry-cache://theme/scss/source', true, true);
        if (!file_exists($cacheDir)) {
            Folder::create($cacheDir);
        }
 
        $options = [
            'cacheDir' => $cacheDir,
            //'prefix' => '',
            'forceRefresh' => true
        ];
        $compiler = new Compiler($options);
 
        $this->functions->setCompiler($compiler);
 
        if ($this->production) {
            $compiler->setOutputStyle(OutputStyle::COMPRESSED);
        } else {
            $compiler->setOutputStyle(OutputStyle::EXPANDED);
            $compiler->setSourceMap(Compiler::SOURCE_MAP_INLINE);
            // TODO: Look if we can / should use option to let compiler to save the source map.
            $compiler->setSourceMapOptions([
                'sourceMapRootpath' => '',
                'sourceMapBasepath' => GANTRY5_ROOT,
            ]);
        }
 
        return $compiler;
    }
 
    /**
     * @return LegacyCompiler
     */
    protected function getLegacyCompiler()
    {
        // Autoload legacy compiler classes
        /** @var ClassLoader $loader */
        $loader = static::gantry()['loader'];
        $loader->setPsr4('Leafo\\ScssPhp\\', [GANTRY5_LIBRARY . '/src/classes/Leafo/ScssPhp', GANTRY5_LIBRARY . '/vendor/leafo/scssphp/src']);
Arguments
  1. "Call to undefined method Gantry\Component\Stylesheet\Scss\Compiler::setOutputStyle()"
    
        /** @var string $path */
        $path = $locator->findResource($out, true, true);
        $file = File::instance($path);
 
        // Attempt to lock the file for writing.
        try {
            $file->lock(false);
        } catch (\Exception $e) {
            // Another process has locked the file; we will check this in a bit.
        }
 
        if ($file->locked() === false) {
            // File was already locked by another process, lets avoid compiling the same file twice.
            return false;
        }
 
        $logfile = fopen('php://memory', 'rb+');
        $logger = new StreamLogger($logfile, true);
 
        $compiler = $this->getCompiler();
        $compiler->setLogger($logger);
 
        // Set the lookup paths.
        $this->functions->setBasePath($path);
        $compiler->setImportPaths([[$this, 'findImport']]);
 
        // Run the compiler.
        $compiler->addVariables($this->getVariables(true));
        $scss = '$output-bourbon-deprecation-warnings: false;' . "\n" . '@import "' . $in . '.scss"';
        try {
            $this->result = $compiler->compileString($scss);
            $css = $this->result->getCss();
        } catch (CompilerException $e) {
            if (version_compare(static::$options['compatibility'], '5.5', '<')) {
                static::$options['legacy'][$in] = true;
                $this->warnings['__TITLE__'] = 'Please update your theme!';
                $this->warnings[$in] = ['WARNING: ' . $e->getMessage()];
 
                return $this->compileLegacyFile($in);
            }
    /**
     * Returns URL to CSS file.
     *
     * If file does not exist, it will be created by using CSS compiler.
     *
     * @param string $name
     * @return string
     */
    public function css($name)
    {
        if (!isset($this->cssCache[$name])) {
            $compiler = $this->compiler();
 
            if ($compiler->needsCompile($name, [$this, 'getCssVariables'])) {
                if (\GANTRY_DEBUGGER) {
                    Debugger::startTimer("css-{$name}", "Compiling CSS: {$name}");
                    Debugger::addMessage("Compiling CSS: {$name}");
                }
 
                $compiler->compileFile($name);
 
                if (\GANTRY_DEBUGGER) {
                    Debugger::stopTimer("css-{$name}");
                }
            }
 
            $this->cssCache[$name] = $compiler->getCssUrl($name);
        }
 
        return $this->cssCache[$name];
    }
 
    /**
     * @return array
     */
    public function getCssVariables()
    {
        if ($this->preset) {
            $variables = $this->presets()->flatten($this->preset . '.styles', '-');
        } else {
        $styles = $this->getAssetsInLocation('styles', $location);
 
        if (!$styles) {
            return [];
        }
 
        $gantry = Gantry::instance();
 
        /** @var Theme|null $theme */
        $theme = isset($gantry['theme']) ? $gantry['theme'] : null;
 
        /** @var Document $document */
        $document = $gantry['document'];
 
        foreach ($styles as $key => $style) {
            if (isset($style['href'])) {
                $url = $style['href'];
                if ($theme && preg_match('|\.scss$|', $url)) {
                    // Compile SCSS files.
                    $url = $theme->css(Gantry::basename($url, '.scss'));
                }
                // Deal with streams and relative paths.
                $url = $document::url($url, null, null, false);
 
                $styles[$key]['href'] = $url;
            }
        }
 
        return $styles;
    }
 
    /**
     * @param string $location
     * @return array
     * @since 5.4.3
     */
    public function getScripts($location = 'head')
    {
        $scripts = $this->getAssetsInLocation('scripts', $location);
 
                if (!empty($element['src'])) {
                    $success = static::addScript($element, $priority, $location);
                } elseif (!empty($element['content'])) {
                    $success = static::addInlineScript($element, $priority, $location);
                }
 
                break;
        }
 
        return $success;
    }
 
    /**
     * @param string $location
     * @return array
     */
    public static function getStyles($location = 'head')
    {
        static::getObject();
        $styles = static::$stack[0]->getStyles($location);
 
        $output = [];
 
        foreach ($styles as $style) {
            switch ($style[':type']) {
                case 'file':
                    $attribs = '';
                    if ($style['media']) {
                        $attribs .= ' media="' . static::escape($style['media']) . '"';
                    }
                    $output[] = sprintf(
                        '<link rel="stylesheet" href="%s" type="%s"%s />',
                        static::escape($style['href']),
                        static::escape($style['type']),
                        $attribs
                    );
                    break;
                case 'inline':
                    $attribs = '';
                    if ($style['type'] !== 'text/css') {
     * @return string
     */
    public function siteUrl()
    {
        /** @var Document $document */
        $document = $this['document'];
 
        return $document::siteUrl();
    }
 
    /**
     * @param string $location
     * @return array
     */
    public function styles($location = 'head')
    {
        /** @var Document $document */
        $document = $this['document'];
 
        return $document::getStyles($location);
    }
 
    /**
     * @param string $location
     * @return array
     */
    public function scripts($location = 'head')
    {
        /** @var Document $document */
        $document = $this['document'];
 
        return $document::getScripts($location);
    }
 
    /**
     * Load Javascript framework / extension in platform independent way.
     *
     * @param string $framework
     * @return bool
     */
    /**
     * @return bool
     */
    public function admin()
    {
        /** @var CMSApplication $application */
        $app = Factory::getApplication();
 
        return $app->isClient('administrator');
    }
 
    /**
     * @param string $location
     * @param bool   $force
     * @return array
     */
    public function styles($location = 'head', $force = false)
    {
        // Do not display head, Joomla will take care of it (most of the time).
        return (!$force && $location === 'head') ? [] : parent::styles($location);
    }
 
    /**
     * @param string $location
     * @param bool $force
     * @return array
     */
    public function scripts($location = 'head', $force = false)
    {
        // Do not display head, Joomla will take care of it (most of the time).
        return (!$force && $location === 'head') ? [] : parent::scripts($location);
    }
 
    /**
     * @return array
     */
    protected function loadGlobal()
    {
        $global = null;
 
            }
 
            throw new RuntimeError(sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), -1, $this->getSourceContext());
        }
 
        if ($isDefinedTest) {
            return true;
        }
 
        if ($this->env->hasExtension('\Twig\Extension\SandboxExtension')) {
            $this->env->getExtension('\Twig\Extension\SandboxExtension')->checkMethodAllowed($object, $method);
        }
 
        // Some objects throw exceptions when they have __call, and the method we try
        // to call is not supported. If ignoreStrictCheck is true, we should return null.
        try {
            if (!$arguments) {
                $ret = $object->$method();
            } else {
                $ret = \call_user_func_array([$object, $method], $arguments);
            }
        } catch (\BadMethodCallException $e) {
            if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) {
                return;
            }
            throw $e;
        }
 
        // @deprecated in 1.28
        if ($object instanceof \Twig_TemplateInterface) {
            $self = $object->getTemplateName() === $this->getTemplateName();
            $message = sprintf('Calling "%s" on template "%s" from template "%s" is deprecated since version 1.28 and won\'t be supported anymore in 2.0.', $item, $object->getTemplateName(), $this->getTemplateName());
            if ('renderBlock' === $method || 'displayBlock' === $method) {
                $message .= sprintf(' Use block("%s"%s) instead).', $arguments[0], $self ? '' : ', template');
            } elseif ('hasBlock' === $method) {
                $message .= sprintf(' Use "block("%s"%s) is defined" instead).', $arguments[0], $self ? '' : ', template');
            } elseif ('render' === $method || 'display' === $method) {
                $message .= sprintf(' Use include("%s") instead).', $object->getTemplateName());
            }
            @trigger_error($message, \E_USER_DEPRECATED);
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
 
        if ($useBlocks && isset($blocks[$name])) {
            $template = $blocks[$name][0];
            $block = $blocks[$name][1];
        } elseif (isset($this->blocks[$name])) {
            $template = $this->blocks[$name][0];
            $block = $this->blocks[$name][1];
        } else {
            $template = null;
            $block = null;
        }
 
        // avoid RCEs when sandbox is enabled
        if (null !== $template && !$template instanceof self) {
            throw new \LogicException('A block must be a method on a \Twig\Template instance.');
        }
 
        if (null !== $template) {
            try {
                $template->$block($context, $blocks);
            } catch (Error $e) {
                if (!$e->getSourceContext()) {
                    $e->setSourceContext($template->getSourceContext());
                }
 
                // this is mostly useful for \Twig\Error\LoaderError exceptions
                // see \Twig\Error\LoaderError
                if (-1 === $e->getTemplateLine()) {
                    $e->guess();
                }
 
                throw $e;
            } catch (\Exception $e) {
                $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e);
                $e->guess();
 
                throw $e;
            }
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false);
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
     * @internal
     */
    public function __construct(Environment $env, Template $template)
    {
        $this->env = $env;
        $this->template = $template;
    }
 
    /**
     * Renders the template.
     *
     * @param array $context An array of parameters to pass to the template
     *
     * @return string The rendered template
     */
    public function render($context = [])
    {
        // using func_get_args() allows to not expose the blocks argument
        // as it should only be used by internal code
        return $this->template->render($context, \func_num_args() > 1 ? func_get_arg(1) : []);
    }
 
    /**
     * Displays the template.
     *
     * @param array $context An array of parameters to pass to the template
     */
    public function display($context = [])
    {
        // using func_get_args() allows to not expose the blocks argument
        // as it should only be used by internal code
        $this->template->display($context, \func_num_args() > 1 ? func_get_arg(1) : []);
    }
 
    /**
     * Checks if a block is defined.
     *
     * @param string $name    The block name
     * @param array  $context An array of parameters to pass to the template
     *
        @trigger_error(sprintf('The %s method is deprecated since version 1.22 and will be removed in Twig 2.0.', __METHOD__), \E_USER_DEPRECATED);
 
        return $this->templateClassPrefix;
    }
 
    /**
     * Renders a template.
     *
     * @param string|TemplateWrapper $name    The template name
     * @param array                  $context An array of parameters to pass to the template
     *
     * @return string The rendered template
     *
     * @throws LoaderError  When the template cannot be found
     * @throws SyntaxError  When an error occurred during compilation
     * @throws RuntimeError When an error occurred during rendering
     */
    public function render($name, array $context = [])
    {
        return $this->load($name)->render($context);
    }
 
    /**
     * Displays a template.
     *
     * @param string|TemplateWrapper $name    The template name
     * @param array                  $context An array of parameters to pass to the template
     *
     * @throws LoaderError  When the template cannot be found
     * @throws SyntaxError  When an error occurred during compilation
     * @throws RuntimeError When an error occurred during rendering
     */
    public function display($name, array $context = [])
    {
        $this->load($name)->display($context);
    }
 
    /**
     * Loads a template.
     *
 
            $this->renderer = $this->extendTwig($twig, $loader);
        }
 
        return $this->renderer;
    }
 
    /**
     * Render a template file by using given context.
     *
     * @param string $file
     * @param array $context
     * @return string
     */
    public function render($file, array $context = [])
    {
        // Include Gantry specific things to the context.
        $context = $this->getContext($context);
 
        return $this->renderer()->render($file, $context);
    }
 
    /**
     * Compile and render twig string.
     *
     * @param string $string
     * @param array $context
     * @return string
     */
    public function compile($string, array $context = [])
    {
        $renderer = $this->renderer();
        $template = $renderer->createTemplate($string);
 
        // Include Gantry specific things to the context.
        $context = $this->getContext($context);
 
        return $template->render($context);
    }
 
$joomla->document = $this;
 
/** @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);
 
     *
     * @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
  1. "/home/santmari/public_html/templates/g5_helium/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  = [];
 
        $name  = $options['name'] ?? '';
        $title = $options['title'] ?? '';
 
        parent::$_buffer[$type][$name][$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);
        }
 
    {
        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
     *
 
        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
 
        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,
            ]
        );
    }
}
 
             * 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->getInput()->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) {
            }
        }
 
        // 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)
                $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
        /** @var UniformResourceLocator $locator */
        $locator = Gantry::instance()['locator'];
        $cacheDir = $locator->findResource('gantry-cache://theme/scss/source', true, true);
        if (!file_exists($cacheDir)) {
            Folder::create($cacheDir);
        }
 
        $options = [
            'cacheDir' => $cacheDir,
            //'prefix' => '',
            'forceRefresh' => true
        ];
        $compiler = new Compiler($options);
 
        $this->functions->setCompiler($compiler);
 
        if ($this->production) {
            $compiler->setOutputStyle(OutputStyle::COMPRESSED);
        } else {
            $compiler->setOutputStyle(OutputStyle::EXPANDED);
            $compiler->setSourceMap(Compiler::SOURCE_MAP_INLINE);
            // TODO: Look if we can / should use option to let compiler to save the source map.
            $compiler->setSourceMapOptions([
                'sourceMapRootpath' => '',
                'sourceMapBasepath' => GANTRY5_ROOT,
            ]);
        }
 
        return $compiler;
    }
 
    /**
     * @return LegacyCompiler
     */
    protected function getLegacyCompiler()
    {
        // Autoload legacy compiler classes
        /** @var ClassLoader $loader */
        $loader = static::gantry()['loader'];
        $loader->setPsr4('Leafo\\ScssPhp\\', [GANTRY5_LIBRARY . '/src/classes/Leafo/ScssPhp', GANTRY5_LIBRARY . '/vendor/leafo/scssphp/src']);
Arguments
  1. "Call to undefined method Gantry\Component\Stylesheet\Scss\Compiler::setOutputStyle()"
    
Exception message: Call to undefined method Gantry\Component\Stylesheet\Scss\Compiler::setOutputStyle()
        /** @var string $path */
        $path = $locator->findResource($out, true, true);
        $file = File::instance($path);
 
        // Attempt to lock the file for writing.
        try {
            $file->lock(false);
        } catch (\Exception $e) {
            // Another process has locked the file; we will check this in a bit.
        }
 
        if ($file->locked() === false) {
            // File was already locked by another process, lets avoid compiling the same file twice.
            return false;
        }
 
        $logfile = fopen('php://memory', 'rb+');
        $logger = new StreamLogger($logfile, true);
 
        $compiler = $this->getCompiler();
        $compiler->setLogger($logger);
 
        // Set the lookup paths.
        $this->functions->setBasePath($path);
        $compiler->setImportPaths([[$this, 'findImport']]);
 
        // Run the compiler.
        $compiler->addVariables($this->getVariables(true));
        $scss = '$output-bourbon-deprecation-warnings: false;' . "\n" . '@import "' . $in . '.scss"';
        try {
            $this->result = $compiler->compileString($scss);
            $css = $this->result->getCss();
        } catch (CompilerException $e) {
            if (version_compare(static::$options['compatibility'], '5.5', '<')) {
                static::$options['legacy'][$in] = true;
                $this->warnings['__TITLE__'] = 'Please update your theme!';
                $this->warnings[$in] = ['WARNING: ' . $e->getMessage()];
 
                return $this->compileLegacyFile($in);
            }
    /**
     * Returns URL to CSS file.
     *
     * If file does not exist, it will be created by using CSS compiler.
     *
     * @param string $name
     * @return string
     */
    public function css($name)
    {
        if (!isset($this->cssCache[$name])) {
            $compiler = $this->compiler();
 
            if ($compiler->needsCompile($name, [$this, 'getCssVariables'])) {
                if (\GANTRY_DEBUGGER) {
                    Debugger::startTimer("css-{$name}", "Compiling CSS: {$name}");
                    Debugger::addMessage("Compiling CSS: {$name}");
                }
 
                $compiler->compileFile($name);
 
                if (\GANTRY_DEBUGGER) {
                    Debugger::stopTimer("css-{$name}");
                }
            }
 
            $this->cssCache[$name] = $compiler->getCssUrl($name);
        }
 
        return $this->cssCache[$name];
    }
 
    /**
     * @return array
     */
    public function getCssVariables()
    {
        if ($this->preset) {
            $variables = $this->presets()->flatten($this->preset . '.styles', '-');
        } else {
        $styles = $this->getAssetsInLocation('styles', $location);
 
        if (!$styles) {
            return [];
        }
 
        $gantry = Gantry::instance();
 
        /** @var Theme|null $theme */
        $theme = isset($gantry['theme']) ? $gantry['theme'] : null;
 
        /** @var Document $document */
        $document = $gantry['document'];
 
        foreach ($styles as $key => $style) {
            if (isset($style['href'])) {
                $url = $style['href'];
                if ($theme && preg_match('|\.scss$|', $url)) {
                    // Compile SCSS files.
                    $url = $theme->css(Gantry::basename($url, '.scss'));
                }
                // Deal with streams and relative paths.
                $url = $document::url($url, null, null, false);
 
                $styles[$key]['href'] = $url;
            }
        }
 
        return $styles;
    }
 
    /**
     * @param string $location
     * @return array
     * @since 5.4.3
     */
    public function getScripts($location = 'head')
    {
        $scripts = $this->getAssetsInLocation('scripts', $location);
 
        static $error = false;
 
        if (isset($new)) {
            $error = (bool) $new;
        }
 
        return $error;
    }
 
    protected static function registerStyles()
    {
        if (static::errorPage()) {
            return;
        }
 
        /** @var CMSApplication $application */
        $application = Factory::getApplication();
        $doc = $application->getDocument();
 
        $styles = static::$stack[0]->getStyles();
 
        foreach ($styles as $style) {
            switch ($style[':type']) {
                case 'file':
                    $attribs = array_replace(['type' => $style['type'], 'media' => $style['media']], $style['element']);
                    $attribs = array_filter($attribs, static function($arg) { return null !== $arg; });
                    $doc->addStyleSheet($style['href'], [], $attribs);
                    break;
                case 'inline':
                    $doc->addStyleDeclaration($style['content'], $style['type']);
                    break;
            }
        }
    }
 
    protected static function registerScripts()
    {
        if (static::errorPage()) {
            return;
        }
        if (
            $framework === 'bootstrap'
            || ($framework === 'bootstrap.2' && JVersion::MAJOR_VERSION === 3)
            || ($framework === 'bootstrap.5' && JVersion::MAJOR_VERSION >= 4)
        ) {
            /** @var Theme $theme */
            $theme = Gantry::instance()['theme'];
            $theme->joomla = true;
        }
 
        return true;
    }
 
    /**
     *
     */
    public static function registerAssets()
    {
        static::registerFrameworks();
        static::registerStyles();
        static::registerScripts();
    }
 
    /**
     * NOTE: In PHP this function can be called either from Gantry DI container or statically.
     *
     * @param bool|null $addDomain
     * @return string
     */
    public static function domain($addDomain = null)
    {
        if (!$addDomain) {
            return '';
        }
 
        $absolute = Uri::root(false);
        $relative = Uri::root(true);
 
        return substr($absolute, 0, -strlen($relative));
    }
    {
        return null;
    }
 
    /**
     * @param string $text
     * @return string
     */
    public function filter($text)
    {
        return $text;
    }
 
    public function finalize()
    {
        $gantry = Gantry::instance();
        /** @var Document $document */
        $document = $gantry['document'];
 
        $document::registerAssets();
    }
 
    /**
     * @return mixed|null
     */
    public function call()
    {
        $args = func_get_args();
        $callable = array_shift($args);
        return is_callable($callable) ? call_user_func_array($callable, $args) : null;
    }
 
    /**
     * @param string $action
     * @param int|string|null $id
     * @return bool
     */
    public function authorize($action, $id = null)
    {
        return true;
            if ($ignoreStrictCheck || !$this->env->isStrictVariables()) {
                return;
            }
 
            throw new RuntimeError(sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), -1, $this->getSourceContext());
        }
 
        if ($isDefinedTest) {
            return true;
        }
 
        if ($this->env->hasExtension('\Twig\Extension\SandboxExtension')) {
            $this->env->getExtension('\Twig\Extension\SandboxExtension')->checkMethodAllowed($object, $method);
        }
 
        // Some objects throw exceptions when they have __call, and the method we try
        // to call is not supported. If ignoreStrictCheck is true, we should return null.
        try {
            if (!$arguments) {
                $ret = $object->$method();
            } else {
                $ret = \call_user_func_array([$object, $method], $arguments);
            }
        } catch (\BadMethodCallException $e) {
            if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) {
                return;
            }
            throw $e;
        }
 
        // @deprecated in 1.28
        if ($object instanceof \Twig_TemplateInterface) {
            $self = $object->getTemplateName() === $this->getTemplateName();
            $message = sprintf('Calling "%s" on template "%s" from template "%s" is deprecated since version 1.28 and won\'t be supported anymore in 2.0.', $item, $object->getTemplateName(), $this->getTemplateName());
            if ('renderBlock' === $method || 'displayBlock' === $method) {
                $message .= sprintf(' Use block("%s"%s) instead).', $arguments[0], $self ? '' : ', template');
            } elseif ('hasBlock' === $method) {
                $message .= sprintf(' Use "block("%s"%s) is defined" instead).', $arguments[0], $self ? '' : ', template');
            } elseif ('render' === $method || 'display' === $method) {
                $message .= sprintf(' Use include("%s") instead).', $object->getTemplateName());
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
 
        if ($useBlocks && isset($blocks[$name])) {
            $template = $blocks[$name][0];
            $block = $blocks[$name][1];
        } elseif (isset($this->blocks[$name])) {
            $template = $this->blocks[$name][0];
            $block = $this->blocks[$name][1];
        } else {
            $template = null;
            $block = null;
        }
 
        // avoid RCEs when sandbox is enabled
        if (null !== $template && !$template instanceof self) {
            throw new \LogicException('A block must be a method on a \Twig\Template instance.');
        }
 
        if (null !== $template) {
            try {
                $template->$block($context, $blocks);
            } catch (Error $e) {
                if (!$e->getSourceContext()) {
                    $e->setSourceContext($template->getSourceContext());
                }
 
                // this is mostly useful for \Twig\Error\LoaderError exceptions
                // see \Twig\Error\LoaderError
                if (-1 === $e->getTemplateLine()) {
                    $e->guess();
                }
 
                throw $e;
            } catch (\Exception $e) {
                $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e);
                $e->guess();
 
                throw $e;
            }
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false);
    }
 
    /**
     * Displays a parent block.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @param string $name    The block name to display from the parent
     * @param array  $context The context
     * @param array  $blocks  The current set of blocks
     */
    public function displayParentBlock($name, array $context, array $blocks = [])
    {
        $name = (string) $name;
 
        if (isset($this->traits[$name])) {
            $this->traits[$name][0]->displayBlock($name, $context, $blocks, false);
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, $blocks, false);
        } else {
            throw new RuntimeError(sprintf('The template has no parent and no traits defining the "%s" block.', $name), -1, $this->getSourceContext());
        }
    }
 
    /**
     * Displays a block.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @param string $name      The block name to display
     * @param array  $context   The context
     * @param array  $blocks    The current set of blocks
     * @param bool   $useBlocks Whether to use the current set of blocks
     */
    public function displayBlock($name, array $context, array $blocks = [], $useBlocks = true)
    {
        $name = (string) $name;
 
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
 
        if ($useBlocks && isset($blocks[$name])) {
            $template = $blocks[$name][0];
            $block = $blocks[$name][1];
        } elseif (isset($this->blocks[$name])) {
            $template = $this->blocks[$name][0];
            $block = $this->blocks[$name][1];
        } else {
            $template = null;
            $block = null;
        }
 
        // avoid RCEs when sandbox is enabled
        if (null !== $template && !$template instanceof self) {
            throw new \LogicException('A block must be a method on a \Twig\Template instance.');
        }
 
        if (null !== $template) {
            try {
                $template->$block($context, $blocks);
            } catch (Error $e) {
                if (!$e->getSourceContext()) {
                    $e->setSourceContext($template->getSourceContext());
                }
 
                // this is mostly useful for \Twig\Error\LoaderError exceptions
                // see \Twig\Error\LoaderError
                if (-1 === $e->getTemplateLine()) {
                    $e->guess();
                }
 
                throw $e;
            } catch (\Exception $e) {
                $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e);
                $e->guess();
 
                throw $e;
            }
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false);
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
     * @internal
     */
    public function __construct(Environment $env, Template $template)
    {
        $this->env = $env;
        $this->template = $template;
    }
 
    /**
     * Renders the template.
     *
     * @param array $context An array of parameters to pass to the template
     *
     * @return string The rendered template
     */
    public function render($context = [])
    {
        // using func_get_args() allows to not expose the blocks argument
        // as it should only be used by internal code
        return $this->template->render($context, \func_num_args() > 1 ? func_get_arg(1) : []);
    }
 
    /**
     * Displays the template.
     *
     * @param array $context An array of parameters to pass to the template
     */
    public function display($context = [])
    {
        // using func_get_args() allows to not expose the blocks argument
        // as it should only be used by internal code
        $this->template->display($context, \func_num_args() > 1 ? func_get_arg(1) : []);
    }
 
    /**
     * Checks if a block is defined.
     *
     * @param string $name    The block name
     * @param array  $context An array of parameters to pass to the template
     *
        @trigger_error(sprintf('The %s method is deprecated since version 1.22 and will be removed in Twig 2.0.', __METHOD__), \E_USER_DEPRECATED);
 
        return $this->templateClassPrefix;
    }
 
    /**
     * Renders a template.
     *
     * @param string|TemplateWrapper $name    The template name
     * @param array                  $context An array of parameters to pass to the template
     *
     * @return string The rendered template
     *
     * @throws LoaderError  When the template cannot be found
     * @throws SyntaxError  When an error occurred during compilation
     * @throws RuntimeError When an error occurred during rendering
     */
    public function render($name, array $context = [])
    {
        return $this->load($name)->render($context);
    }
 
    /**
     * Displays a template.
     *
     * @param string|TemplateWrapper $name    The template name
     * @param array                  $context An array of parameters to pass to the template
     *
     * @throws LoaderError  When the template cannot be found
     * @throws SyntaxError  When an error occurred during compilation
     * @throws RuntimeError When an error occurred during rendering
     */
    public function display($name, array $context = [])
    {
        $this->load($name)->display($context);
    }
 
    /**
     * Loads a template.
     *
 
            $this->renderer = $this->extendTwig($twig, $loader);
        }
 
        return $this->renderer;
    }
 
    /**
     * Render a template file by using given context.
     *
     * @param string $file
     * @param array $context
     * @return string
     */
    public function render($file, array $context = [])
    {
        // Include Gantry specific things to the context.
        $context = $this->getContext($context);
 
        return $this->renderer()->render($file, $context);
    }
 
    /**
     * Compile and render twig string.
     *
     * @param string $string
     * @param array $context
     * @return string
     */
    public function compile($string, array $context = [])
    {
        $renderer = $this->renderer();
        $template = $renderer->createTemplate($string);
 
        // Include Gantry specific things to the context.
        $context = $this->getContext($context);
 
        return $template->render($context);
    }
 
 
// Bootstrap Gantry framework or fail gracefully (inside included file).
$className = __DIR__ . '/custom/includes/gantry.php';
if (!is_file($className)) {
    $className = __DIR__ . '/includes/gantry.php';
}
$gantry = include $className;
 
/** @var Platform $joomla */
$joomla = $gantry['platform'];
$joomla->document = $this;
 
/** @var Theme $theme */
$theme = $gantry['theme'];
 
// All the custom twig variables can be defined in here:
$context = array();
 
// Render the page.
echo $theme->render('index.html.twig', $context);
 
     *
     * @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
  1. "/home/santmari/public_html/templates/g5_helium/index.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  = [];
 
        $name  = $options['name'] ?? '';
        $title = $options['title'] ?? '';
 
        parent::$_buffer[$type][$name][$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);
        }
 
     * @since   3.2
     */
    protected function render()
    {
        // Setup the document options.
        $this->docOptions['template']         = $this->get('theme');
        $this->docOptions['file']             = $this->get('themeFile', 'index.php');
        $this->docOptions['params']           = $this->get('themeParams');
        $this->docOptions['csp_nonce']        = $this->get('csp_nonce');
        $this->docOptions['templateInherits'] = $this->get('themeInherits');
 
        if ($this->get('themes.base')) {
            $this->docOptions['directory'] = $this->get('themes.base');
        } else {
            // Fall back to constants.
            $this->docOptions['directory'] = \defined('JPATH_THEMES') ? JPATH_THEMES : (\defined('JPATH_BASE') ? JPATH_BASE : __DIR__) . '/themes';
        }
 
        // Parse the document.
        $this->document->parse($this->docOptions);
 
        // Trigger the onBeforeRender event.
        PluginHelper::importPlugin('system');
        $this->triggerEvent('onBeforeRender');
 
        $caching = false;
 
        if ($this->isClient('site') && $this->get('caching') && $this->get('caching', 2) == 2 && !Factory::getUser()->get('id')) {
            $caching = true;
        }
 
        // Render the document.
        $data = $this->document->render($caching, $this->docOptions);
 
        // Set the application output data.
        $this->setBody($data);
 
        // Trigger the onAfterRender event.
        $this->triggerEvent('onAfterRender');
 
                    $this->set('themeFile', 'offline.php');
                    $this->setHeader('Status', '503 Service Temporarily Unavailable', 'true');
                }
 
                if (!is_dir(JPATH_THEMES . '/' . $template->template) && !$this->get('offline')) {
                    $this->set('themeFile', 'component.php');
                }
 
                // Ensure themeFile is set by now
                if ($this->get('themeFile') == '') {
                    $this->set('themeFile', $file . '.php');
                }
 
                // Pass the parent template to the state
                $this->set('themeInherits', $template->parent);
 
                break;
        }
 
        parent::render();
    }
 
    /**
     * Route the application.
     *
     * Routing is the process of examining the request environment to determine which
     * component should receive the request. The component optional parameters
     * are then set in the request object to be processed when the application is being
     * dispatched.
     *
     * @return  void
     *
     * @since   3.2
     */
    protected function route()
    {
        // Get the full request URI.
        $uri = clone Uri::getInstance();
 
        // It is not possible to inject the SiteRouter as it requires a SiteApplication
     * 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,
                    'eventClass'  => ErrorEvent::class,
                    'application' => $this,
                ]
            );
 
 *
 * 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
  1. "/home/santmari/public_html/includes/app.php"
    

Environment & details:

Key Value
option
"com_jcart"
Itemid
"209"
route
"product/product"
path
"57"
product_id
"136"
view
"home"
empty
empty
empty
empty
Key Value
PATH
"/usr/local/bin:/bin:/usr/bin"
HTTP_ACCEPT
"*/*"
HTTP_HOST
"santmarine.com.au"
HTTP_USER_AGENT
"claudebot"
DOCUMENT_ROOT
"/home/santmari/public_html"
REMOTE_ADDR
"35.168.113.41"
REMOTE_PORT
"46930"
SERVER_ADDR
"27.131.79.201"
SERVER_NAME
"santmarine.com.au"
SERVER_ADMIN
"webmaster@santmarine.com.au"
SERVER_PORT
"443"
REQUEST_SCHEME
"https"
REQUEST_URI
"/index.php?option=com_jcart&Itemid=209&route=product/product&path=57&product_id=136"
HTTPS
true
HTTP_AUTHORIZATION
""
X_SPDY
"HTTP2"
SSL_PROTOCOL
"TLSv1.3"
SSL_CIPHER
"TLS_AES_256_GCM_SHA384"
SSL_CIPHER_USEKEYSIZE
"256"
SSL_CIPHER_ALGKEYSIZE
"256"
SCRIPT_FILENAME
"/home/santmari/public_html/index.php"
QUERY_STRING
"option=com_jcart&Itemid=209&route=product/product&path=57&product_id=136"
SCRIPT_URI
"https://santmarine.com.au/index.php"
SCRIPT_URL
"/index.php"
SCRIPT_NAME
"/index.php"
SERVER_PROTOCOL
"HTTP/1.1"
SERVER_SOFTWARE
"LiteSpeed"
REQUEST_METHOD
"GET"
X-LSCACHE
"on"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1710844090.5167
REQUEST_TIME
1710844090
empty
0. Whoops\Handler\PrettyPageHandler