本文整理汇总了PHP中rex_fragment::addDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_fragment::addDirectory方法的具体用法?PHP rex_fragment::addDirectory怎么用?PHP rex_fragment::addDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rex_fragment
的用法示例。
在下文中一共展示了rex_fragment::addDirectory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array_keys
$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')) {
rex_autoload::addDirectory($folder . 'vendor');
}
$autoload = $package->getProperty('autoload');
if (is_array($autoload) && isset($autoload['classes']) && is_array($autoload['classes'])) {
foreach ($autoload['classes'] as $dir) {
$dir = $package->getPath($dir);
if (is_readable($dir)) {
rex_autoload::addDirectory($dir);
}
示例2: rex_timer
require_once __DIR__ . '/lib/util/path.php';
rex_path::init($REX['HTDOCS_PATH'], $REX['BACKEND_FOLDER']);
require_once rex_path::core('lib/autoload.php');
// register core-classes as php-handlers
rex_autoload::register();
// add core base-classpath to autoloader
rex_autoload::addDirectory(rex_path::core('lib'));
rex_url::init($REX['HTDOCS_PATH'], $REX['BACKEND_FOLDER']);
// start timer at the very beginning
rex::setProperty('timer', new rex_timer($_SERVER['REQUEST_TIME_FLOAT']));
// add backend flag to rex
rex::setProperty('redaxo', $REX['REDAXO']);
// add core lang directory to rex_i18n
rex_i18n::addDirectory(rex_path::core('lang'));
// add core base-fragmentpath to fragmentloader
rex_fragment::addDirectory(rex_path::core('fragments/'));
// ----------------- FUNCTIONS
require_once rex_path::core('functions/function_rex_globals.php');
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'])) {