Introduce WebRequest::getProtocol()
[lhc/web/wiklou.git] / maintenance / cleanupUploadStash.php
index 97dee97..c2ba555 100644 (file)
@@ -25,7 +25,7 @@
  * @ingroup Maintenance
  */
 
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
 
 /**
  * Maintenance script to remove old or broken uploads from temporary uploaded
@@ -82,9 +82,9 @@ class UploadStashCleanup extends Maintenance {
                                        $stash->getFile( $key, true );
                                        $stash->removeFileNoAuth( $key );
                                } catch ( UploadStashBadPathException $ex ) {
-                                       $this->output( "Failed removing stashed upload with key: $key\n"  );
+                                       $this->output( "Failed removing stashed upload with key: $key\n" );
                                } catch ( UploadStashZeroLengthFileException $ex ) {
-                                       $this->output( "Failed removing stashed upload with key: $key\n"  );
+                                       $this->output( "Failed removing stashed upload with key: $key\n" );
                                }
                                if ( $i % 100 == 0 ) {
                                        $this->output( "$i\n" );
@@ -113,7 +113,7 @@ class UploadStashCleanup extends Maintenance {
 
                // Apparently lots of stash files are not registered in the DB...
                $dir = $tempRepo->getZonePath( 'public' );
-               $iterator = $tempRepo->getBackend()->getFileList( array( 'dir' => $dir ) );
+               $iterator = $tempRepo->getBackend()->getFileList( array( 'dir' => $dir, 'adviseStat' => 1 ) );
                $this->output( "Deleting orphaned temp files...\n" );
                if ( strpos( $dir, '/local-temp' ) === false ) { // sanity check
                        $this->error( "Temp repo is not using the temp container.", 1 ); // die
@@ -140,4 +140,4 @@ class UploadStashCleanup extends Maintenance {
 }
 
 $maintClass = "UploadStashCleanup";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;