本文整理汇总了PHP中Settings::load方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::load方法的具体用法?PHP Settings::load怎么用?PHP Settings::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings
的用法示例。
在下文中一共展示了Settings::load方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start
public static function start($baseDir)
{
self::$_baseDir = $baseDir;
self::autload();
self::$_settings = new Settings();
self::$_settings->load();
new Router();
}
示例2: updateAction
public function updateAction()
{
Settings::load();
$languages = Config::get()->languages->list;
$start_pages = array();
foreach ($languages as $language_id => $language) {
$start_page = 0;
if (isset($_POST['start-page-' . $language_id])) {
$start_page = $this->sanitizeInteger($_POST['start-page-' . $language_id]);
}
$start_pages[$language_id] = $start_page;
}
Settings::set('startPages', $start_pages);
$error_pages = array();
foreach ($languages as $language_id => $language) {
$error_page = 0;
if (isset($_POST['error-page-' . $language_id])) {
$error_page = $this->sanitizeInteger($_POST['error-page-' . $language_id]);
}
$error_pages[$language_id] = $error_page;
}
Settings::set('errorPages', $error_pages);
$use_cache = $this->sanitizeBoolean(Request::postParam('use-cache', false));
Settings::set('useCache', $use_cache);
$cache_lifetime = $this->sanitizeInteger(Request::postParam('cache-lifetime', 0));
Settings::set('cacheLifetime', $cache_lifetime);
Settings::save();
$this->success();
}
示例3: execute
function execute()
{
$data = $_POST;
Settings::load('connection');
foreach ($data as $key => $value) {
Settings::set($key, $value, 'connection', false);
}
Settings::save('connection');
}
示例4: load
static function load($app_name)
{
$apps = self::getAppList();
if (!isset($apps[$app_name])) {
return;
}
$app_dir = $apps[$app_name];
self::$activeAppName = strtolower($app_name);
self::$activeAppDir = $app_dir;
$route_file_name = String::glue($app_dir, DS, APP_CONFIG_DIR, DS, 'route.php');
if (php_sapi_name() != 'cli') {
try {
Route::setActive(Route::getPath(), file_exists($route_file_name) ? include $route_file_name : array(), true);
} catch (Exception $e) {
self::parseError($e, $app_name);
}
}
self::setDefaultParams();
// Abort this code, but later
if (!Auth::loged() && Core::isSecure(Request::get('module')) && Request::get('module') != 'login' && false) {
if (php_sapi_name() == 'cli') {
echo 'Auth Error';
exit;
}
Request::redirect('/login/' . (Request::get(Route::$path) ? '&return=' . Request::get(Route::$path) : ''));
}
//
Settings::load('core', CORE_CONFIG_DIR . DS);
self::loadDependences($app_dir);
Settings::load($app_name);
App::startApp($app_name);
try {
Load::Action($app_dir . DS, Request::get('action'));
} catch (Exception $e) {
self::parseError($e, $app_name);
}
App::endApp($app_name);
Language::translate(Language::getActiveLanguageISO());
}
示例5: settype
}
if (!Settings::set("sessionMaxLength", $_GET['sessionMaxLength'])) {
echo "Erreur lors de l'enregistrement de sessionMaxLength !<br />";
}
}
// pass_leng
if (isset($_GET['pass_leng'])) {
settype($_GET['pass_leng'], "integer");
if ($_GET['pass_leng'] < 1) {
$_GET['pass_leng'] = 1;
}
if (!Settings::set("pass_leng", $_GET['pass_leng'])) {
echo "Erreur lors de l'enregistrement de pass_leng !<br />";
}
}
if (!Settings::load()) {
die("Erreur chargement settings");
}
# print the page header
print_header("", "", "", $type = "with_session");
if (isset($_GET['ok'])) {
$msg = get_vocab("message_records");
affiche_pop_up($msg, "admin");
}
// Affichage de la colonne de gauche
include "admin_col_gauche.php";
// Affichage du tableau de choix des sous-configuration
include "include/admin_config_tableau.inc.php";
//echo "<h2>".get_vocab('admin_config4.php')."</h2>";
//
// dans le cas de mysql, on propose une sauvegarde et l'ouverture de la base
示例6: die
include "version.php";
include "config/salt.php";
include "dirs.php";
include "settingsfile.php";
include "debug.php";
include "mysql.php";
include "config/database.php";
if (!sqlConnect()) {
die("Can't connect to the board database. Check the installation settings");
}
if (!fetch(query("SHOW TABLES LIKE '{misc}'"))) {
die(header("Location: install.php"));
}
include "mysqlfunctions.php";
include "settingssystem.php";
Settings::load();
Settings::checkPlugin("main");
include "feedback.php";
include "language.php";
include "write.php";
include "snippets.php";
include "links.php";
class KillException extends Exception
{
}
date_default_timezone_set("GMT");
$title = "";
//WARNING: These things need to be kept in a certain order of execution.
include "browsers.php";
include "pluginsystem.php";
loadFieldLists();
示例7: getSettings
/**
* Return the active ants settings
* @return Settings
*/
public function getSettings()
{
if (is_null($this->settings)) {
$this->settings = Settings::load();
}
return $this->settings;
}
示例8: PDO
$pdo = new PDO($dsn, DB_USER, DB_PASS);
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die;
}
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$GLOBALS['pdo'] = $pdo;
ob_start();
include 'includes/FirePHPCore/fb.php';
/*
/*
* Load the Settings class
*/
require_once 'Settings_class.php';
$settings = new Settings($pdo);
$settings->load();
/*
* Common functions
*/
require_once 'functions.php';
/*
* Load the allowed file types list
*/
require_once 'FileTypes_class.php';
$filetypes = new FileTypes_class($pdo);
$filetypes->load();
// Set the revision directory. (relative to $dataDir)
$CONFIG['revisionDir'] = $GLOBALS['CONFIG']['dataDir'] . 'revisionDir/';
// Set the revision directory. (relative to $dataDir)
$CONFIG['archiveDir'] = $GLOBALS['CONFIG']['dataDir'] . 'archiveDir/';
$_GET = sanitizeme($_GET);
示例9: GtkWindow
$ConfigFile->show();
}
/**
* main application section
*/
//Create the login window
$wnd = new GtkWindow();
$wnd->set_title('gource-php-gtk');
//Close the main loop when the window is destroyed
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));
//Set up all the widgets we need
//The second parameter says that the underscore should be parsed as underline
//path
$lblRepositoryPath = new GtkLabel('Repository Path', true);
$txtRepositoryPath = new GtkEntry();
$settings = Settings::load();
$txtRepositoryPath->set_text($settings['last_repo_path']);
//options
//hide
$chkOptionHideFiles = new GtkCheckButton('Hide Files', true);
$chkOptionHideFilenames = new GtkCheckButton('Hide File Names', true);
$chkOptionHideDirnames = new GtkCheckButton('Hide Directories', true);
$chkOptionHideDates = new GtkCheckButton('Hide Dates', true);
$chkOptionHideProgress = new GtkCheckButton('Hide Progress', true);
$chkOptionHideBloom = new GtkCheckButton('Hide Bloom', true);
$chkOptionHideMouse = new GtkCheckButton('Hide Mouse', true);
$chkOptionHideTree = new GtkCheckButton('Hide Tree', true);
$chkOptionHideUsers = new GtkCheckButton('Hide Users', true);
$chkOptionHideUsernames = new GtkCheckButton('Hide Usernames', true);
//general
$chkOptionFullscreen = new GtkCheckButton('Fullscreen', true);