本文整理匯總了PHP中rex_path::coreData方法的典型用法代碼示例。如果您正苦於以下問題:PHP rex_path::coreData方法的具體用法?PHP rex_path::coreData怎麽用?PHP rex_path::coreData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rex_path
的用法示例。
在下文中一共展示了rex_path::coreData方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: 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::coreAssets());
$success = 'Updated assets';
} elseif ($func == 'updateinfos') {
$configFile = rex_path::coreData('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'];
示例2: testCheckConnectionInvalidDatabase
public function testCheckConnectionInvalidDatabase()
{
$configFile = rex_path::coreData('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'));
}