Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVictor Dubiniuk <victor.dubiniuk@gmail.com>2015-08-25 21:18:48 +0300
committerVictor Dubiniuk <victor.dubiniuk@gmail.com>2015-08-25 21:30:49 +0300
commit3fbf3237e244ba949fc0a37d9286286583146bfa (patch)
treee23be976e841ec04b0bdcd17b3d756f172461135 /lib
parentd93ee482af35a0fbf3fc25e792a6d43abd6f6fd0 (diff)
WebODF uses timestamps with milliseconds
Diffstat (limited to 'lib')
-rw-r--r--lib/db/op.php15
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;
+ }
}