<?php /** * Packages loading. * * @package redaxo5 */ rex_addon::initialize(!rex::isSetup()); if (rex::isSetup() || rex::isSafeMode()) { $packageOrder = array_keys(rex_package::getSetupPackages()); } else { $packageOrder = rex::getConfig('package-order', []); } // in the first run, we register all folders for class- and fragment-loading, // so it is transparent in which order the addons are included afterwards. foreach ($packageOrder as $packageId) { $package = rex_package::get($packageId); $folder = $package->getPath(); // add addon path for i18n if (is_readable($folder . 'lang')) { rex_i18n::addDirectory($folder . 'lang'); } // add package path for fragment loading if (is_readable($folder . 'fragments')) { rex_fragment::addDirectory($folder . 'fragments' . DIRECTORY_SEPARATOR); } // add addon path for class-loading if (is_readable($folder . 'lib')) { rex_autoload::addDirectory($folder . 'lib'); } if (is_readable($folder . 'vendor')) {
/** * {@inheritdoc} */ public function getSystemPlugins() { if (rex::isSetup() || rex::isSafeMode()) { // in setup and safemode this method is called before the package .lang files are added to rex_i18n // so don't use getProperty(), to avoid loading all properties without translations $properties = rex_file::getConfig($this->getPath(parent::FILE_PACKAGE)); $systemPlugins = isset($properties['system_plugins']) ? (array) $properties['system_plugins'] : []; } else { $systemPlugins = (array) $this->getProperty('system_plugins', []); } $plugins = []; foreach ($systemPlugins as $plugin) { if ($this->pluginExists($plugin)) { $plugins[$plugin] = $this->getPlugin($plugin); } } return $plugins; }
<?php /** * @package redaxo5 */ header('X-Robots-Tag: noindex, nofollow, noarchive'); // ----- pages, verfuegbare seiten // array(name,addon=1,htmlheader=1); $pages = []; $page = ''; // ----------------- SETUP if (rex::isSetup()) { // ----------------- SET SETUP LANG $requestLang = rex_request('lang', 'string'); if (in_array($requestLang, rex_i18n::getLocales())) { rex::setProperty('lang', $requestLang); } else { rex::setProperty('lang', 'en_gb'); } rex_i18n::setLocale(rex::getProperty('lang')); $pages['setup'] = rex_be_controller::getSetupPage(); $page = 'setup'; rex_be_controller::setCurrentPage('setup'); } else { // ----------------- CREATE LANG OBJ rex_i18n::setLocale(rex::getProperty('lang')); // ---- prepare login $login = new rex_backend_login(); rex::setProperty('login', $login); $rex_user_login = rex_post('rex_user_login', 'string'); $rex_user_psw = rex_post('rex_user_psw', 'string');
public function testIsSetup() { $this->assertFalse(rex::isSetup(), 'test run not within the setup'); // TODO find more appropriate tests }
require_once rex_path::core('functions/function_rex_other.php'); // ----------------- VERSION rex::setProperty('version', '5.0.0-alpha7'); $cacheFile = rex_path::cache('config.yml.cache'); $configFile = rex_path::data('config.yml'); if (file_exists($cacheFile) && file_exists($configFile) && filemtime($cacheFile) >= filemtime($configFile)) { $config = rex_file::getCache($cacheFile); } else { $config = array_merge(rex_file::getConfig(rex_path::core('default.config.yml')), rex_file::getConfig($configFile)); rex_file::putCache($cacheFile, $config); } foreach ($config as $key => $value) { if (in_array($key, ['fileperm', 'dirperm'])) { $value = octdec($value); } rex::setProperty($key, $value); } date_default_timezone_set(rex::getProperty('timezone', 'Europe/Berlin')); if (!rex::isSetup()) { rex_error_handler::register(); } // ----------------- REX PERMS rex_complex_perm::register('clang', 'rex_clang_perm'); // ----- SET CLANG if (!rex::isSetup()) { rex_clang::setCurrentId(rex_request('clang', 'int', rex_clang::getStartId())); } if (isset($REX['LOAD_PAGE']) && $REX['LOAD_PAGE']) { unset($REX); require rex_path::core(rex::isBackend() ? 'backend.php' : 'frontend.php'); }
/** * Handles a error message. * * @param int $errno The error code to handle * @param string $errstr The error message * @param string $errfile The file in which the error occured * @param int $errline The line of the file in which the error occured * * @throws ErrorException */ public static function handleError($errno, $errstr, $errfile, $errline) { if (in_array($errno, [E_USER_ERROR, E_ERROR, E_COMPILE_ERROR, E_RECOVERABLE_ERROR, E_PARSE])) { throw new ErrorException($errstr, 0, $errno, $errfile, $errline); } elseif ((error_reporting() & $errno) == $errno) { if (ini_get('display_errors') && (rex::isSetup() || rex::isDebugMode() || ($user = rex_backend_login::createUser()) && $user->isAdmin())) { echo '<div><b>' . self::getErrorType($errno) . "</b>: {$errstr} in <b>{$errfile}</b> on line <b>{$errline}</b></div>"; } rex_logger::logError($errno, $errstr, $errfile, $errline); } }
<footer class="rex-global-footer"> <nav class="rex-nav-footer"> <ul class="list-inline"> <li><a href="#rex-start-of-page"><i class="fa fa-arrow-up"></i></a></li> <li><a href="http://www.yakamara.de">yakamara.de</a></li> <li><a href="http://www.redaxo.org">redaxo.org</a></li> <li><a href="http://www.redaxo.org/de/forum/"><?php echo rex_i18n::msg('footer_joinforum'); ?> </a></li> <li><a href="<?php echo rex::isSetup() ? 'http://www.redaxo.org/' : rex_url::backendPage('credits'); ?> "><?php echo rex_i18n::msg('footer_credits'); ?> </a></li> <li><?php echo rex_i18n::msg('footer_datetime', rex_formatter::strftime(time(), 'date')); ?> </li> <li><!--DYN--><?php echo rex_i18n::msg('footer_scripttime', $this->time); ?> <!--/DYN--></li> </ul> </nav> </footer>