diff --git a/flextype/Flextype.php b/flextype/Flextype.php index 87a26958..208eda5b 100755 --- a/flextype/Flextype.php +++ b/flextype/Flextype.php @@ -62,15 +62,7 @@ class Flextype // Turn on output buffering ob_start(); - // Set empty site item - Registry::set('site', []); - - // Set site items if site config exists - if (Filesystem::fileExists($site_config = PATH['config'] . '/' . 'site.yaml')) { - Registry::set('site', Yaml::parseFile($site_config)); - } else { - throw new \RuntimeException("Flextype site config file does not exist."); - } + Flextype::setSiteConfig(); // Set internal encoding function_exists('mb_language') and mb_language('uni'); @@ -127,6 +119,24 @@ class Flextype set_exception_handler('Flextype\Component\ErrorHandler\ErrorHandler::exception'); } + /** + * Set site config + * + * @access protected + */ + protected static function setSiteConfig() : void + { + // Set empty site item + Registry::set('site', []); + + // Set site items if site config exists + if (Filesystem::fileExists($site_config = PATH['config'] . '/' . 'site.yaml')) { + Registry::set('site', Yaml::parseFile($site_config)); + } else { + throw new \RuntimeException("Flextype site config file does not exist."); + } + } + /** * Return the Flextype instance. * Create it if it's not already created.