本文整理汇总了PHP中OA_Dal_ApplicationVariables::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP OA_Dal_ApplicationVariables::getAll方法的具体用法?PHP OA_Dal_ApplicationVariables::getAll怎么用?PHP OA_Dal_ApplicationVariables::getAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OA_Dal_ApplicationVariables
的用法示例。
在下文中一共展示了OA_Dal_ApplicationVariables::getAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSetGetAllDelete
/**
* Test set, getAll, delete
*
*/
function testSetGetAllDelete()
{
// Force cache clean-up
OA_Dal_ApplicationVariables::cleanCache();
$result = OA_Dal_ApplicationVariables::getAll();
$this->assertEqual($result, array());
$aData = array('one' => 'foo', 'two' => 'bar');
foreach ($aData as $k => $v) {
$result = OA_Dal_ApplicationVariables::set($k, $v);
$this->assertTrue($result);
}
// Check cached values
$result = OA_Dal_ApplicationVariables::getAll();
$this->assertEqual($result, $aData);
// Force cache clean-up
OA_Dal_ApplicationVariables::cleanCache();
// Check DB-stored values
$result = OA_Dal_ApplicationVariables::getAll();
$this->assertEqual($result, $aData);
foreach (array_keys($aData) as $name) {
$result = OA_Dal_ApplicationVariables::delete($name);
$this->assertTrue($result);
}
}
示例2: unserialize
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/lib/OA/Sync.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-maintenance.inc.php';
$update_check = false;
/*-------------------------------------------------------*/
/* Main code */
/*-------------------------------------------------------*/
// Check for product updates when the admin logs in
if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
$aConf = $GLOBALS['_MAX']['CONF'];
$aVars = OA_Dal_ApplicationVariables::getAll();
$update_check = false;
// Check accordingly to user preferences
if (!empty($aConf['sync']['checkForUpdates'])) {
if ($aVars['sync_cache']) {
$update_check = unserialize($aVars['sync_cache']);
}
// If cache timestamp not set or older than 24hrs, re-sync
if (isset($aVars['sync_timestamp']) && $aVars['sync_timestamp'] + 86400 < time()) {
$oSync = new OA_Sync();
$res = $oSync->checkForUpdates();
if ($res[0] == 0) {
$update_check = $res[1];
}
}
if (!is_array($update_check) || $update_check['config_version'] <= $aVars['sync_last_seen']) {