From 1dccf6d87632ccf438b46d65f6be8590d4cbd2d4 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 28 Jun 2019 09:32:00 -0700 Subject: [PATCH] filebackend: remove wfTimestamp() dependency from FileJournal Change-Id: Ia9b9e1d2d40d240566a37012fa01e5db0c276ec0 --- includes/libs/filebackend/filejournal/FileJournal.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/libs/filebackend/filejournal/FileJournal.php b/includes/libs/filebackend/filejournal/FileJournal.php index 999594b85e..dc007a0cec 100644 --- a/includes/libs/filebackend/filejournal/FileJournal.php +++ b/includes/libs/filebackend/filejournal/FileJournal.php @@ -26,6 +26,8 @@ * @ingroup FileJournal */ +use Wikimedia\Timestamp\ConvertibleTimestamp; + /** * @brief Class for handling file operation journaling. * @@ -37,7 +39,6 @@ abstract class FileJournal { /** @var string */ protected $backend; - /** @var int */ protected $ttlDays; @@ -63,7 +64,7 @@ abstract class FileJournal { $class = $config['class']; $jrn = new $class( $config ); if ( !$jrn instanceof self ) { - throw new InvalidArgumentException( "Class given is not an instance of FileJournal." ); + throw new InvalidArgumentException( "$class is not an instance of " . __CLASS__ ); } $jrn->backend = $backend; @@ -82,7 +83,9 @@ abstract class FileJournal { } $s = Wikimedia\base_convert( sha1( $s ), 16, 36, 31 ); - return substr( Wikimedia\base_convert( wfTimestamp( TS_MW ), 10, 36, 9 ) . $s, 0, 31 ); + $timestamp = ConvertibleTimestamp::convert( TS_MW, time() ); + + return substr( Wikimedia\base_convert( $timestamp, 10, 36, 9 ) . $s, 0, 31 ); } /** -- 2.20.1