/** @var FileJournal */
protected $fileJournal;
- /** Flags for supported features */
- const ATTR_HEADERS = 1;
- const ATTR_METADATA = 2;
+ /** Bitfield flags for supported features */
+ const ATTR_HEADERS = 1; // files can be tagged with standard HTTP headers
+ const ATTR_METADATA = 2; // files can be stored with metadata key/values
+ const ATTR_UNICODE_PATHS = 4; // files can have Unicode paths (not just ASCII)
/**
* Create a new backend instance from configuration.
* @since 1.23
*/
public function getFeatures() {
- return 0;
+ return self::ATTR_UNICODE_PATHS;
}
/**
*
* @param array $paths Storage paths
* @param int $type LockManager::LOCK_* constant
+ * @param int $timeout Timeout in seconds (0 means non-blocking) (since 1.24)
* @return Status
*/
- final public function lockFiles( array $paths, $type ) {
+ final public function lockFiles( array $paths, $type, $timeout = 0 ) {
$paths = array_map( 'FileBackend::normalizeStoragePath', $paths );
- return $this->lockManager->lock( $paths, $type );
+ return $this->lockManager->lock( $paths, $type, $timeout );
}
/**
* @param array $paths List of storage paths or map of lock types to path lists
* @param int|string $type LockManager::LOCK_* constant or "mixed"
* @param Status $status Status to update on lock/unlock
+ * @param int $timeout Timeout in seconds (0 means non-blocking) (since 1.24)
* @return ScopedLock|null Returns null on failure
*/
- final public function getScopedFileLocks( array $paths, $type, Status $status ) {
+ final public function getScopedFileLocks( array $paths, $type, Status $status, $timeout = 0 ) {
if ( $type === 'mixed' ) {
foreach ( $paths as &$typePaths ) {
$typePaths = array_map( 'FileBackend::normalizeStoragePath', $typePaths );
$paths = array_map( 'FileBackend::normalizeStoragePath', $paths );
}
- return ScopedLock::factory( $this->lockManager, $paths, $type, $status );
+ return ScopedLock::factory( $this->lockManager, $paths, $type, $status, $timeout );
}
/**