diff options
author | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2015-08-25 21:18:48 +0300 |
---|---|---|
committer | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2015-08-25 21:30:49 +0300 |
commit | 3fbf3237e244ba949fc0a37d9286286583146bfa (patch) | |
tree | e23be976e841ec04b0bdcd17b3d756f172461135 /lib | |
parent | d93ee482af35a0fbf3fc25e792a6d43abd6f6fd0 (diff) |
WebODF uses timestamps with milliseconds
Diffstat (limited to 'lib')
-rw-r--r-- | lib/db/op.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/db/op.php b/lib/db/op.php index 48199a70..50449398 100644 --- a/lib/db/op.php +++ b/lib/db/op.php @@ -90,7 +90,7 @@ class Op extends \OCA\Documents\Db { $op = array( 'optype' => 'AddMember', 'memberid' => (string) $memberId, - 'timestamp' => (string) time(), + 'timestamp' => $this->getMillisecondsAsString(), 'setProperties' => array( 'fullName' => $fullName, 'color' => $color, @@ -106,7 +106,7 @@ class Op extends \OCA\Documents\Db { 'optype' => 'RemoveCursor', 'memberid' => (string) $memberId, 'reason' => 'server-idle', - 'timestamp' => (string) time() + 'timestamp' => $this->getMillisecondsAsString() ); $this->insertOp($esId, $memberId, $op); } @@ -115,7 +115,7 @@ class Op extends \OCA\Documents\Db { $op = array( 'optype' => 'RemoveMember', 'memberid' => (string) $memberId, - 'timestamp' => (string) time() + 'timestamp' => $this->getMillisecondsAsString() ); $this->insertOp($esId, $memberId, $op); } @@ -125,7 +125,7 @@ class Op extends \OCA\Documents\Db { $op = array( 'optype' => 'UpdateMember', 'memberid' => (string) $memberId, - 'timestamp' => (string) time(), + 'timestamp' => $this->getMillisecondsAsString(), 'setProperties' => array( 'fullName' => $fullName, ) @@ -184,4 +184,11 @@ class Op extends \OCA\Documents\Db { } return $ops; } + + protected function getMillisecondsAsString(){ + $microtime = microtime(); + list($usec, $sec) = explode(" ", $microtime); + $milliseconds = $sec.substr($usec, 2, 3); + return $milliseconds; + } } |