* @ingroup FileJournal
*/
+use Wikimedia\Timestamp\ConvertibleTimestamp;
+
/**
* @brief Class for handling file operation journaling.
*
abstract class FileJournal {
/** @var string */
protected $backend;
-
/** @var int */
protected $ttlDays;
$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;
}
$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 );
}
/**