本文整理汇总了PHP中getSettings函数的典型用法代码示例。如果您正苦于以下问题:PHP getSettings函数的具体用法?PHP getSettings怎么用?PHP getSettings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getSettings函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run_disallow_permissions
function run_disallow_permissions()
{
$settings = getSettings();
$root = "..";
pake_echo_action("permissions", "allow permissions...");
pake_chmod('', $root, 0755);
}
示例2: getUserConfig
function getUserConfig($configKey, $baseFolder = null, $reset = false)
{
$configKey = strtolower($configKey);
if ($reset) {
if (isset($_SESSION['USERCONFIG'][$configKey])) {
unset($_SESSION['USERCONFIG'][$configKey]);
}
}
if (isset($_SESSION['USERCONFIG']) && isset($_SESSION['USERCONFIG'][$configKey])) {
return $_SESSION['USERCONFIG'][$configKey];
}
$configData = getSettings($configKey);
if (strlen($configData) > 2) {
$_SESSION['USERCONFIG'][$configKey] = json_decode($configData, true);
return $_SESSION['USERCONFIG'][$configKey];
}
if ($baseFolder == null) {
$bt = debug_backtrace();
$baseFolder = dirname($bt[0]['file']) . "/";
}
$configArr = [APPROOT . APPS_DATA_FOLDER . "jsonData/" . $configKey . ".json", $baseFolder . "config.json"];
foreach ($configArr as $f) {
if (file_exists($f)) {
$configData = file_get_contents($f);
$_SESSION['USERCONFIG'][$configKey] = json_decode($configData, true);
setSettings($configKey, $configData);
return $_SESSION['USERCONFIG'][$configKey];
}
}
return false;
}
示例3: showModuleSettings
function showModuleSettings($module, $key)
{
$table = getSettings($module);
table_open();
if ($table) {
tr_open();
td_open(1);
echo getString("settings_description", "Beskrivelse");
td_close();
td_open(1);
echo getString("settings_value", "Verdi");
td_close();
td_open(1);
echo getString("settings_type", "Type");
td_close();
td_open(1);
echo getString("settings_edit", "Endre");
td_close();
tr_close();
while ($row = nextResultInTable($table)) {
tr_open();
td_open(1);
echo $row['description'];
td_close();
form_start_post();
if ($row['settingskey'] == $key) {
showSetting($row, true);
td_open(1);
form_hidden("m_c", "showSettingsGUI");
form_hidden("module", $module);
form_hidden("key", $row['settingskey']);
form_hidden("save", true);
form_submit("submit", getString("settings_save_setting", "Lagre"));
td_close();
} else {
showSetting($row, false);
td_open(1);
form_hidden("m_c", "showSettingsGUI");
form_hidden("module", $module);
form_hidden("key", $row['settingskey']);
form_submit("submit", getString("settings_edit_setting", "Endre"));
td_close();
}
form_end();
tr_close();
}
} else {
// ingen settings, gi beskjed:
tr_open();
td_open(1);
echo getString("settings_could_not_find_settings_for_this_module", "Fant ingen innstillinger for denne modulen");
td_close();
tr_close();
}
table_close();
}
示例4: printSettings
function printSettings($uid, $pid, $name, $typeid)
{
echo "\n\t\t<li class=\"plant\" data-uid=\"" . $uid . "\" data-pid=\"" . $pid . "\" data-plant-nickname=\"" . $name . "\" data-plant-type=\"" . getCommonName($typeid) . "\"><h2 class=\"name button\">" . $name . " <span>(" . getCommonName($typeid) . ")</span></h2>\n\t\t\t<ul class=\"sub\">";
$info = getSettings($uid, $pid);
foreach ($info as $key => $value) {
$key = str_replace("_", " ", $key);
echo "<li class='plant{$key}'><span class='key'>" . $key . "</span><span class=\"value\">" . ucfirst($value) . "</span></li>";
}
echo "\n\t\t\t<li data-value=\"alert\" class=\"button green \">Set Alert Type</li>\n\t\t\t<li class=\"button red\">Delete</li>\n\t\t\t</ul>\n\t\t</li>\n\t\t";
}
示例5: processSettings
function processSettings($calID)
{
//get settings from calendar
$dbSet = getSettings();
if (!empty($dbSet)) {
echo "<li>Calendar settings retrieved from database.</li>\n";
}
//convert 2.7.1 date settings to new settings
$ds = isset($dbSet['dateSep']) ? $dbSet['dateSep'] : '.';
//dateSep: LuxCal 2.7.1
if (isset($dbSet['dateFormat'])) {
switch ($dbSet['dateFormat']) {
//dateSep: LuxCal 2.7.1 format
case '1':
$dbSet['dateFormat'] = 'd' . $ds . 'm' . $ds . 'y';
break;
case '2':
$dbSet['dateFormat'] = 'm' . $ds . 'd' . $ds . 'y';
break;
case '3':
$dbSet['dateFormat'] = 'y' . $ds . 'm' . $ds . 'd';
}
}
if (empty($dbSet['MdFormat'])) {
$dbSet['MdFormat'] = empty($dbSet['dateUSorEU']) ? 'M d' : 'd M';
}
//dateUSorEU: LuxCal 2.7.1
if (empty($dbSet['MdyFormat'])) {
$dbSet['MdyFormat'] = empty($dbSet['dateUSorEU']) ? 'M d, y' : 'd M y';
}
if (empty($dbSet['MyFormat'])) {
$dbSet['MyFormat'] = empty($dbSet['dateUSorEU']) ? 'M y' : 'M y';
}
if (empty($dbSet['DMdFormat'])) {
$dbSet['DMdFormat'] = empty($dbSet['dateUSorEU']) ? 'WD, M d' : 'WD d M';
}
if (empty($dbSet['DMdyFormat'])) {
$dbSet['DMdyFormat'] = empty($dbSet['dateUSorEU']) ? 'WD, M d, y' : 'WD d M y';
}
if (empty($dbSet['timeFormat'])) {
$dbSet['timeFormat'] = empty($dbSet['time24']) ? 'h:ma' : 'h.m';
}
//time24: LuxCal 2.7.1
//check and complete settings
checkSettings($dbSet);
//if $dbSet['x'] empty, set to default value
echo "<li>Calendar settings verified/completed.</li>\n";
//save calendar settings to calendar
$result = saveSettings($calID, $dbSet, true);
if ($result === false) {
exit('Error: Unable to save settings in database. Check database credentials.');
}
echo "<li>Calendar settings saved to database.</li>\n";
return $result;
}
示例6: getSettings
public function getSettings()
{
$settings = getSettings();
if (strstr($_SERVER['HTTP_REFERER'], 'admin')) {
$langs = $this->config->item('languages');
$language = $this->config->item('language');
$locale = $langs[$language][0];
} else {
$locale = MY_Controller::getCurrentLocale();
}
$settings['curLocale'] = $locale;
return json_encode($settings);
}
示例7: runClient
function runClient()
{
$settings = getSettings();
$client = Client::getInstance($settings);
$type = 'echo';
$data = array('foo' => 'bar', 'baz' => 9001);
$resultId = $client->putRequest($type, $data);
Common::$lg->addDebug("Client put request {$resultId} on AMQ");
$result = $client->getResult($resultId);
Common::$lg->addDebug("Client got data for {$resultId}");
if ($result->{'foo'} == $data['foo'] && $result->{'baz'} == $data['baz']) {
exit(0);
} else {
echo "Client received wrong data for {$resultId}";
exit(1);
}
}
示例8: writeGlobalCache
function writeGlobalCache()
{
global $db, $_SYS;
$row = getSettings(0);
$apikey = $row['apikey'];
$tmparr = array();
if (!empty($apikey)) {
$row['apikey'] = array();
$tmpapis = explode("\n", $apikey);
foreach ($tmpapis as $tmpapi) {
$tmpapikv = explode(":", $tmpapi);
if (is_array($tmpapikv) && !empty($tmpapikv[0]) && !empty($tmpapikv[1])) {
$row['apikey'][$tmpapikv[0]] = trim($tmpapikv[1]);
}
}
}
$str = "<?php \r\n \$cache_global = " . varToStr($row) . "; \r\n?>";
writeFile(getCacheFilePath("global.php"), $str);
}
示例9: deleteJob
deleteJob($_REQUEST["job_id"]);
header("Location: " . $GLOBALS['contextpath'] . "/user/" . $_SESSION['username'] . "/");
}
exit;
break;
case "reset":
if (is_numeric($_REQUEST["job_id"])) {
resetJob($_REQUEST["job_id"]);
header("Location: " . $GLOBALS['contextpath'] . "/job/" . $_REQUEST["job_id"] . "/");
}
case "viewall":
header("Location: " . $GLOBALS['contextpath'] . "/user/" . $_SESSION['username'] . "/");
break;
default:
getJobs();
exit;
break;
}
exit;
break;
case "useragents":
getUserAgents();
exit;
break;
case "settings":
getSettings();
exit;
break;
}
}
}
示例10: mysql_client_encoding
// include the default language
require_once WB_PATH . '/modules/foldergallery/languages/EN.php';
// check if module language file exists for the language set by the user (e.g. DE, EN)
if (file_exists(WB_PATH . '/modules/foldergallery/languages/' . LANGUAGE . '.php')) {
require_once WB_PATH . '/modules/foldergallery/languages/' . LANGUAGE . '.php';
}
// Files includen
require_once WB_PATH . '/modules/foldergallery/info.php';
require_once WB_PATH . '/modules/foldergallery/admin/scripts/backend.functions.php';
require_once WB_PATH . '/modules/foldergallery/class/class.upload.php';
require_once WB_PATH . '/modules/foldergallery/class/validator.php';
require_once WB_PATH . '/modules/foldergallery/class/DirectoryHandler.Class.php';
// Set the mySQL encoding to utf8
$oldMysqlEncoding = mysql_client_encoding();
mysql_set_charset('utf8', $database->db_handle);
$settings = getSettings($section_id);
$root_dir = $settings['root_dir'];
//Chio
if (isset($_GET['cat_id']) && is_numeric($_GET['cat_id'])) {
$cat_id = $_GET['cat_id'];
} else {
$error['no_cat_id'] = 1;
$admin->print_error('lost cat', ADMIN_URL . '/pages/modify.php?page_id=' . $page_id . '§ion_id=' . $section_id);
die;
}
// Kategorie Infos aus der DB holen
$sql = 'SELECT * FROM ' . TABLE_PREFIX . 'mod_foldergallery_categories WHERE id=' . $cat_id . ' LIMIT 1;';
$query = $database->query($sql);
$categorie = $query->fetchRow();
if (is_array($categorie)) {
if ($categorie['parent'] != -1) {
示例11: errorlog
//Insert a log message into the error log
function errorlog($msg, &$db)
{
$insert['msg'] = $msg;
$insert['time'] = time();
$query = $db->autoexecute('log_errors', $insert, 'INSERT');
}
//Insert a log message into the GM log
function gmlog($msg, &$db)
{
$insert['msg'] = $msg;
$insert['time'] = time();
$query = $db->autoexecute('log_gm', $insert, 'INSERT');
}
//Get all settings variables
function getSettings(&$db)
{
$query = $db->execute("select `name`, `value` from `settings`");
while ($set = $query->fetchrow()) {
$setting->{$set}['name'] = $set['value'];
}
return $setting;
}
$setting = getSettings($db);
//Get the player's IP address
$ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
//Check that the player has the appropriate permission of a GM rank above 20
if (check_permissions($player, 21) == 0) {
header("Location: ../logout.php");
exit;
}
示例12: getSession
<?php
require_once '../configuration_admin.php';
// start the session
$session = getSession();
// get smarty handle
$smarty = getSmartyHandle();
$GLOBALS['applog']->logMessage(var_export($_REQUEST, true), LOGGER_ERROR, 'edit_custom');
// check permissions
if ($session->isLoggedIn()) {
// get handle on database
$db = getDBHandle();
// get handle on the settings
$settings = getSettings();
// define standard fields to parse/clear
$fields = array('eventHeaderCustom', 'eventTextCustom', 'eventSubtextCustom', 'eventLinkCustom', 'boingoLinkCustom');
if (isset($_REQUEST['submit'])) {
$GLOBALS['applog']->logMessage("normal form submission hit", LOGGER_ERROR, 'edit_custom');
// some of the fields just get dumped into settings
$fields = array('eventLinkCustom', 'boingoLinkCustom');
foreach ($fields as $key) {
if (strlen($_REQUEST[$key])) {
$GLOBALS['applog']->logMessage("Saving setting {$key}, value " . $_REQUEST[$key], LOGGER_DEBUG, 'edit_custom');
$settings->__set($key, $_REQUEST[$key]);
}
}
// some get truncated if they are too long
$fields = array('eventHeaderCustom', 'eventTextCustom', 'eventSubtextCustom');
foreach ($fields as $key) {
if (strlen($_REQUEST[$key])) {
if (strlen($_REQUEST[$key]) > $GLOBALS['textRestrictions'][$key]) {
示例13: foreach
<table align="center" width="800">
<tr align="center" height="25">
<td bgcolor="#AAAAAA"><strong>Index</strong></td>
<td bgcolor="#AAAAAA"><strong>Ontology Prefix</strong></td>
<td bgcolor="#AAAAAA"><strong>Classes</strong></td>
<td bgcolor="#AAAAAA"><strong>Object Properties</strong></td>
<td bgcolor="#AAAAAA"><strong>Datatype Properties</strong></td>
<td bgcolor="#AAAAAA"><strong>Annotation Properties</strong></td>
<td bgcolor="#AAAAAA"><strong>Total</strong></td>
</tr>
<?php
foreach ($rs as $row) {
$o = $row['ontology_abbrv'];
$settings = getSettings($o);
$classQueryString = "\nPREFIX rdf: <{$settings['ns_rdf']}>\nPREFIX owl: <{$settings['ns_owl']}>\nSELECT count(distinct ?s) as ?cCount\nFROM <{$settings['ns_main']}>\nWHERE\n{\n?s a owl:Class .\nFILTER (isIRI(?s)).\n}\n";
$objectQueryString = "\nPREFIX rdf: <{$settings['ns_rdf']}>\nPREFIX owl: <{$settings['ns_owl']}>\nSELECT count(distinct ?s) as ?oCount\nFROM <{$settings['ns_main']}>\nWHERE\n{\n?s a owl:ObjectProperty .\nFILTER (isIRI(?s)).\n}\n";
$datatypeQueryString = "\nPREFIX rdf: <{$settings['ns_rdf']}>\nPREFIX owl: <{$settings['ns_owl']}>\nSELECT count(distinct ?s) as ?dCount\nFROM <{$settings['ns_main']}>\nWHERE\n{\n?s a owl:DatatypeProperty .\nFILTER (isIRI(?s)).\n}\n";
$annotationQueryString = "\nPREFIX rdf: <{$settings['ns_rdf']}>\nPREFIX owl: <{$settings['ns_owl']}>\nSELECT count(distinct ?s) as ?aCount\nFROM <{$settings['ns_main']}>\nWHERE\n{\n?s a owl:AnnotationProperty .\nFILTER (isIRI(?s)).\n}\n";
$cCountResult = json_query($classQueryString);
$aCountResult = json_query($annotationQueryString);
$dCountResult = json_query($datatypeQueryString);
$oCountResult = json_query($objectQueryString);
$cCount = $cCountResult[0]['cCount'];
$aCount = $aCountResult[0]['aCount'];
$dCount = $dCountResult[0]['dCount'];
$oCount = $oCountResult[0]['oCount'];
$total = $cCount + $aCount + $dCount + $oCount;
?>
<tr align="center" height="25" <?php
示例14: Workflows
<?php
require './vendor/autoload.php';
require './src/functions.php';
require_once './src/workflows.php';
$w = new Workflows('com.vdesabou.spotify.mini.player');
//
// Read settings from JSON
//
$settings = getSettings($w);
$oauth_client_id = $settings->oauth_client_id;
$oauth_client_secret = $settings->oauth_client_secret;
$oauth_redirect_uri = $settings->oauth_redirect_uri;
try {
$session = new SpotifyWebAPI\Session($oauth_client_id, $oauth_client_secret, $oauth_redirect_uri);
if (!empty($_GET['code'])) {
// Request a access token using the code from Spotify
$ret = $session->requestAccessToken($_GET['code']);
if ($ret == true) {
$api = new SpotifyWebAPI\SpotifyWebAPI();
// Set the code on the API wrapper
$api->setAccessToken($session->getAccessToken());
$user = $api->me();
$ret = updateSetting($w, 'oauth_access_token', $session->getAccessToken());
if ($ret == false) {
echo "There was an error when updating settings";
exec("kill -9 \$(ps -efx | grep \"php -S localhost:15298\" | grep -v grep | awk '{print \$2}')");
return;
}
$ret = updateSetting($w, 'oauth_expires', time());
if ($ret == false) {
示例15: catch
} catch (Exception $e) {
echo $e->getMessage();
//Boring error messages from anything else!
}
}
}
if (isset($_POST['regid']) && isset($_POST['sendEmail']) && isset($_POST['template']) && !$cancelProcess) {
$CustomMsg;
$Header;
$Subject;
$Body;
$Footer;
$email;
$template;
$userid = $_SESSION['UserID'];
$data = getSettings($userid);
$useremail = $data->email;
$userfriendlyemail = $data->friendlyemail;
$userbcc = $data->bcc;
if ($userbcc != 1) {
//it is a no, blank it
$userbcc = "";
} else {
$userbcc = $useremail;
}
$template = $_POST['template'];
$regid = $_POST['regid'];
$tbl = "registration";
//grab the message to be sent
if (!$cancelProcess) {
$result = mysql_query("SELECT CustomMessageBody,EmailAddress FROM " . $tbl . " WHERE regid='" . $regid . "'");