当前位置: 首页>>代码示例>>PHP>>正文


PHP rex::isSetup方法代码示例

本文整理汇总了PHP中rex::isSetup方法的典型用法代码示例。如果您正苦于以下问题:PHP rex::isSetup方法的具体用法?PHP rex::isSetup怎么用?PHP rex::isSetup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rex的用法示例。


在下文中一共展示了rex::isSetup方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

<?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')) {
开发者ID:staabm,项目名称:redaxo,代码行数:31,代码来源:packages.php

示例2: getSystemPlugins

 /**
  * {@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;
 }
开发者ID:staabm,项目名称:redaxo,代码行数:21,代码来源:addon.php

示例3: header

<?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');
开发者ID:VIEWSION,项目名称:redaxo,代码行数:31,代码来源:backend.php

示例4: testIsSetup

 public function testIsSetup()
 {
     $this->assertFalse(rex::isSetup(), 'test run not within the setup');
     // TODO find more appropriate tests
 }
开发者ID:staabm,项目名称:redaxo,代码行数:5,代码来源:rex_test.php

示例5: array_merge

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');
}
开发者ID:skerbis,项目名称:redaxo,代码行数:31,代码来源:boot.php

示例6: handleError

 /**
  * 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);
     }
 }
开发者ID:DECAF,项目名称:redaxo,代码行数:21,代码来源:error_handler.php

示例7:

    <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>
开发者ID:skerbis,项目名称:redaxo,代码行数:28,代码来源:footer.php


注:本文中的rex::isSetup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。