dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add simplified storage API
[lhc/web/wiklou.git]
/
maintenance
/
syncFileBackend.php
diff --git
a/maintenance/syncFileBackend.php
b/maintenance/syncFileBackend.php
index
c505b14
..
14a1502
100644
(file)
--- a/
maintenance/syncFileBackend.php
+++ b/
maintenance/syncFileBackend.php
@@
-71,6
+71,7
@@
class SyncFileBackend extends Maintenance {
if ( $this->isQuiet() ) {
print $id; // give a single machine-readable number
}
if ( $this->isQuiet() ) {
print $id; // give a single machine-readable number
}
+
return;
}
return;
}
@@
-104,7
+105,7
@@
class SyncFileBackend extends Maintenance {
}
// Periodically update the position file
}
// Periodically update the position file
- $callback = function( $pos ) use ( $startFromPosFile, $posFile, $start ) {
+ $callback = function
( $pos ) use ( $startFromPosFile, $posFile, $start ) {
if ( $startFromPosFile && $pos >= $start ) { // successfully advanced
file_put_contents( $posFile, $pos, LOCK_EX );
}
if ( $startFromPosFile && $pos >= $start ) { // successfully advanced
file_put_contents( $posFile, $pos, LOCK_EX );
}
@@
-238,6
+239,7
@@
class SyncFileBackend extends Maintenance {
if ( !$fsFile ) {
$this->error( "Unable to sync '$dPath': could not get local copy." );
$status->fatal( 'backend-fail-internal', $src->getName() );
if ( !$fsFile ) {
$this->error( "Unable to sync '$dPath': could not get local copy." );
$status->fatal( 'backend-fail-internal', $src->getName() );
+
return $status;
}
$fsFiles[] = $fsFile; // keep TempFSFile objects alive as needed
return $status;
}
$fsFiles[] = $fsFile; // keep TempFSFile objects alive as needed
@@
-254,6
+256,7
@@
class SyncFileBackend extends Maintenance {
} else { // error
$this->error( "Unable to sync '$dPath': could not stat file." );
$status->fatal( 'backend-fail-internal', $src->getName() );
} else { // error
$this->error( "Unable to sync '$dPath': could not stat file." );
$status->fatal( 'backend-fail-internal', $src->getName() );
+
return $status;
}
}
return $status;
}
}
@@
-277,6
+280,7
@@
class SyncFileBackend extends Maintenance {
* Substitute the backend name of storage paths with that of a given one
*
* @param array|string $paths List of paths or single string path
* Substitute the backend name of storage paths with that of a given one
*
* @param array|string $paths List of paths or single string path
+ * @param FileBackend $backend
* @return array|string
*/
protected function replaceNamePaths( $paths, FileBackend $backend ) {
* @return array|string
*/
protected function replaceNamePaths( $paths, FileBackend $backend ) {