本文整理汇总了PHP中config::config_exists方法的典型用法代码示例。如果您正苦于以下问题:PHP config::config_exists方法的具体用法?PHP config::config_exists怎么用?PHP config::config_exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类config
的用法示例。
在下文中一共展示了config::config_exists方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_folder_path
public static function get_folder_path($id)
{
if (!$id) {
return '';
}
static $folders = null;
if (!config::config_exists()) {
return false;
}
if ($folders === null) {
config::load_config();
$folders = config::search('/^folder_/');
}
return isset($folders['folder_' . $id]) ? $folders['folder_' . $id] : false;
}
示例2: save_config
static function save_config($conf)
{
if (!config::config_exists()) {
config::create_config();
}
$content = file_get_contents(CONFIG_FILE);
$new = substr($content, 0, strpos($content, '//--AUTOCONFIG-START') + 20) . "\n\n";
ksort($conf);
$new .= '$_conf = ' . var_export($conf, true) . ";\n";
if (strlen($conf['error_reporting']) != 0) {
$new .= '$_conf["error_reporting"] = ' . $conf['error_reporting'] . ";\n\n";
}
$new .= substr($content, strpos($content, '//--AUTOCONFIG-END'));
if (file_put_contents(CONFIG_FILE_WRITE, $new) === FALSE) {
common::error("Failed writing to config.php, make sure it is writale. See Test Server section for more info");
}
}
示例3: dbconnections
static function dbconnections()
{
if (!config::config_exists()) {
return array();
}
return config::get('db');
}
示例4: reset
<?php
if (LOGGED !== true) {
die;
}
if (!config::config_exists()) {
print '
<h2>PhpBF Framework configuration</h2>
Config file does not exists or is not valid. Do you want to create a new config file with default values?
<br/><br/>
<input type="button" value="Create" onclick="document.location.href=\'' . common::url('self') . '?edit=config\';"/>
';
} else {
config::load_confdata();
print '<h2>PhpBF Framework configuration</h2>';
$first = reset(array_keys(config::$sections));
print '<style>
#menu {
background: #333;
list-style: none;
margin: 0;
padding: 0;
width: 100%;
}
#menu li {
margin: 0;
padding: 0;
}
#menu a {
background: #333;
border-bottom: 1px solid #393939;