X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ffilebackend%2Ffilejournal%2FFileJournal.php;h=a1b7a4596183e6a7fdeaac193a5109ec6ab20f0c;hb=d8e9288c7b574d35ea435295c219f2ac902391e4;hp=d99384db1b7a6ed5437b8c7c50f74fd2269e3567;hpb=47a5e369d7c0e129da081fa77c3e3d418e86d780;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filebackend/filejournal/FileJournal.php b/includes/filebackend/filejournal/FileJournal.php index d99384db1b..a1b7a45961 100644 --- a/includes/filebackend/filejournal/FileJournal.php +++ b/includes/filebackend/filejournal/FileJournal.php @@ -54,7 +54,7 @@ abstract class FileJournal { * Create an appropriate FileJournal object from config * * @param $config Array - * @param $backend string A registered file backend name + * @param string $backend A registered file backend name * @throws MWException * @return FileJournal */ @@ -90,8 +90,8 @@ abstract class FileJournal { * newSha1 : The final base 36 SHA-1 of the file * Note that 'false' should be used as the SHA-1 for non-existing files. * - * @param $entries Array List of file operations (each an array of parameters) - * @param $batchId string UUID string that identifies the operation batch + * @param array $entries List of file operations (each an array of parameters) + * @param string $batchId UUID string that identifies the operation batch * @return Status */ final public function logChangeBatch( array $entries, $batchId ) { @@ -104,8 +104,8 @@ abstract class FileJournal { /** * @see FileJournal::logChangeBatch() * - * @param $entries Array List of file operations (each an array of parameters) - * @param $batchId string UUID string that identifies the operation batch + * @param array $entries List of file operations (each an array of parameters) + * @param string $batchId UUID string that identifies the operation batch * @return Status */ abstract protected function doLogChangeBatch( array $entries, $batchId ); @@ -125,6 +125,23 @@ abstract class FileJournal { */ abstract protected function doGetCurrentPosition(); + /** + * Get the position ID of the latest journal entry at some point in time + * + * @param $time integer|string timestamp + * @return integer|false + */ + final public function getPositionAtTime( $time ) { + return $this->doGetPositionAtTime( $time ); + } + + /** + * @see FileJournal::getPositionAtTime() + * @param $time integer|string timestamp + * @return integer|false + */ + abstract protected function doGetPositionAtTime( $time ); + /** * Get an array of file change log entries. * A starting change ID and/or limit can be specified. @@ -201,6 +218,15 @@ class NullFileJournal extends FileJournal { return false; } + /** + * @see FileJournal::doGetPositionAtTime() + * @param $time integer|string timestamp + * @return integer|false + */ + protected function doGetPositionAtTime( $time ) { + return false; + } + /** * @see FileJournal::doGetChangeEntries() * @return Array