本文整理匯總了PHP中POD::commit方法的典型用法代碼示例。如果您正苦於以下問題:PHP POD::commit方法的具體用法?PHP POD::commit怎麽用?PHP POD::commit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類POD
的用法示例。
在下文中一共展示了POD::commit方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: write
public static function write($id, $data)
{
if (is_null(self::$context)) {
self::initialize();
}
if (strlen($id) < 32) {
return false;
}
$userid = Acl::getIdentity('textcube');
if (empty($userid)) {
$userid = Acl::getIdentity('openid') ? SESSION_OPENID_USERID : '';
}
if (empty($userid)) {
$userid = 'null';
}
$data = POD::escapeString($data);
$server = POD::escapeString($_SERVER['HTTP_HOST']);
$request = POD::escapeString(substr($_SERVER['REQUEST_URI'], 0, 255));
$referer = isset($_SERVER['HTTP_REFERER']) ? POD::escapeString(substr($_SERVER['HTTP_REFERER'], 0, 255)) : '';
$timer = Timer::getMicroTime() - self::$sessionMicrotime;
$current = Timestamp::getUNIXtime();
$result = self::query('count', "UPDATE " . self::$context->getProperty('database.prefix') . "Sessions \n\t\t\t\tSET userid = {$userid}, privilege = '{$data}', server = '{$server}', request = '{$request}', referer = '{$referer}', timer = {$timer}, updated = " . $current . " \n\t\t\t\tWHERE id = '{$id}' AND address = '{$_SERVER['REMOTE_ADDR']}'");
if ($result && $result == 1) {
@POD::commit();
return true;
}
return false;
}