本文整理汇总了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;
}