本文整理汇总了PHP中rex_path::data方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_path::data方法的具体用法?PHP rex_path::data怎么用?PHP rex_path::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rex_path
的用法示例。
在下文中一共展示了rex_path::data方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkFilesystem
/**
* checks permissions of all required filesystem resources.
*
* @return array An array of error messages
*/
public static function checkFilesystem()
{
// -------------------------- SCHREIBRECHTE
$writables = [rex_path::media(), rex_path::assets(), rex_path::cache(), rex_path::data(), rex_path::src()];
$func = function ($dir) use(&$func) {
if (!rex_dir::isWritable($dir)) {
return ['setup_304' => [$dir]];
}
$res = [];
foreach (rex_finder::factory($dir) as $path => $file) {
if ($file->isDir()) {
$res = array_merge_recursive($res, $func($path));
} elseif (!$file->isWritable()) {
$res['setup_305'][] = $path;
}
}
return $res;
};
$res = [];
foreach ($writables as $dir) {
if (@is_dir($dir)) {
$res = array_merge_recursive($res, $func($dir));
} else {
$res['setup_306'][] = $dir;
}
}
return $res;
}
示例2: header
// echo nl2br(htmlspecialchars($cont));
if (rex_file::putConfig($configFile, $config) !== false) {
$info = rex_i18n::msg('setup_error1', '<a href="' . rex_url::backendController() . '">', '</a>');
header('Location:' . rex_url::backendController());
exit;
} else {
$error[] = rex_i18n::msg('setup_error2');
}
} elseif ($func == 'generate') {
// generate all articles,cats,templates,caches
$success = rex_delete_cache();
} elseif ($func == 'updateassets') {
rex_dir::copy(rex_path::core('assets'), rex_path::assets());
$success = 'Updated assets';
} elseif ($func == 'updateinfos') {
$configFile = rex_path::data('config.yml');
$config = array_merge(rex_file::getConfig(rex_path::core('default.config.yml')), rex_file::getConfig($configFile));
$settings = rex_post('settings', 'array', []);
foreach (['server', 'servername', 'error_email', 'lang'] as $key) {
if (!isset($settings[$key]) || !$settings[$key]) {
$error[] = rex_i18n::msg($key . '_required');
continue;
}
$config[$key] = $settings[$key];
try {
rex::setProperty($key, $settings[$key]);
} catch (InvalidArgumentException $e) {
$error[] = rex_i18n::msg($key . '_invalid');
}
}
$config['debug'] = isset($settings['debug']) && $settings['debug'];
示例3: function
<?php
if (rex_string::versionCompare(rex::getVersion(), '5.0.0-beta1', '<=')) {
rex_extension::register('RESPONSE_SHUTDOWN', function () {
rex_file::delete(rex_path::assets('jquery.min.js'));
rex_file::delete(rex_path::assets('jquery.min.map'));
rex_file::delete(rex_path::assets('jquery-pjax.min.js'));
rex_file::delete(rex_path::assets('jquery-ui.custom.min.js'));
rex_file::delete(rex_path::assets('jquery-ui.custom.txt'));
rex_file::delete(rex_path::assets('redaxo-logo.svg'));
rex_file::delete(rex_path::assets('sha1.js'));
rex_file::delete(rex_path::assets('standard.js'));
});
rex_dir::copy(__DIR__ . '/assets', rex_path::assets('core'));
rex_dir::create(rex_path::data('core'));
rename(rex_path::data('config.yml'), rex_path::data('core/config.yml'));
}
示例4: testCheckConnectionInvalidDatabase
public function testCheckConnectionInvalidDatabase()
{
$configFile = rex_path::data('config.yml');
$config = rex_file::getConfig($configFile);
$this->assertTrue(true !== rex_sql::checkDbConnection($config['db'][1]['host'], $config['db'][1]['login'], $config['db'][1]['password'], 'fu-database'));
}