本文整理汇总了PHP中AppConfig::set方法的典型用法代码示例。如果您正苦于以下问题:PHP AppConfig::set方法的具体用法?PHP AppConfig::set怎么用?PHP AppConfig::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppConfig
的用法示例。
在下文中一共展示了AppConfig::set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: app_controller
function app_controller()
{
global $session, $route, $mysqli;
$result = false;
include "Modules/app/AppConfig_model.php";
$appconfig = new AppConfig($mysqli);
if ($route->format == 'html') {
if ($route->action == "" && $session['write']) {
$result = view("Modules/app/client.php", array());
}
}
if ($route->format == 'json') {
if ($route->action == "setconfig" && $session['write']) {
$result = $appconfig->set($session['userid'], get('data'));
}
if ($route->action == "getconfig" && $session['read']) {
$result = $appconfig->get($session['userid']);
}
if ($route->action == "dataremote") {
$id = (int) get("id");
$start = (double) get("start");
$end = (double) get("end");
$interval = (int) get("interval");
$result = json_decode(file_get_contents("http://emoncms.org/feed/data.json?id={$id}&start={$start}&end={$end}&interval={$interval}&skipmissing=0&limitinterval=0"));
}
if ($route->action == "valueremote") {
$id = (int) get("id");
$result = (double) json_decode(file_get_contents("http://emoncms.org/feed/value.json?id={$id}"));
}
}
return array('content' => $result, 'fullwidth' => true);
}
示例2: AppConfig
// variables
$silentRun = false;
if ($argc > 1 && $argv[1] == '-s') {
$silentRun = true;
}
$cleanupIfFail = true;
if ($argc > 1 && $argv[1] == '-c') {
$cleanupIfFail = false;
$silentRun = true;
}
$app = new AppConfig();
$installer = new Installer();
$user = new UserInput();
$db_params = array();
// set the installation ids
$app->set('INSTALLATION_UID', uniqid("IID"));
// unique id per installation
// load or create installation sequence id
if (is_file(FILE_INSTALL_SEQ_ID)) {
$install_seq = @file_get_contents(FILE_INSTALL_SEQ_ID);
$app->set('INSTALLATION_SEQUENCE_UID', $install_seq);
} else {
$install_seq = uniqid("ISEQID");
// unique id per a set of installations
$app->set('INSTALLATION_SEQUENCE_UID', $install_seq);
file_put_contents(FILE_INSTALL_SEQ_ID, $install_seq);
}
// read package version
$version = parse_ini_file('package/version.ini');
logMessage(L_INFO, "Installing Kaltura " . $version['type'] . ' ' . $version['number']);
$app->set('KALTURA_VERSION', 'Kaltura ' . $version['type'] . ' ' . $version['number']);