$dbw = wfGetDB( DB_MASTER );
- // @todo FIXME private/protected/public property?
- $this->timestamp = $now = wfTimestampNow();
+ $now = wfTimestampNow();
$data = [
'log_type' => $this->type,
'log_action' => $this->action,
$sql = $dbr->limitResult( $sql, $limit, false );
}
- $res = $dbr->query( $sql, __METHOD__ );
-
- if ( $res->numRows() == 0 ) {
- $this->mResultEmpty = true;
- }
-
- return $res;
+ return $dbr->query( $sql, __METHOD__ );
}
function setTopText( FormOptions $opts ) {
* @ingroup Maintenance
*/
class DumpUploads extends Maintenance {
+ /** @var string */
+ private $mBasePath;
+
public function __construct() {
parent::__construct();
$this->addDescription( 'Generates list of uploaded files which can be fed to tar or similar.
public function execute() {
global $IP;
- $this->mAction = 'fetchLocal';
$this->mBasePath = $this->getOption( 'base', $IP );
- $this->mShared = false;
- $this->mSharedSupplement = false;
-
- if ( $this->hasOption( 'local' ) ) {
- $this->mAction = 'fetchLocal';
- }
-
- if ( $this->hasOption( 'used' ) ) {
- $this->mAction = 'fetchUsed';
- }
+ $shared = false;
+ $sharedSupplement = false;
if ( $this->hasOption( 'shared' ) ) {
if ( $this->hasOption( 'used' ) ) {
// Include shared-repo files in the used check
- $this->mShared = true;
+ $shared = true;
} else {
// Grab all local *plus* used shared
- $this->mSharedSupplement = true;
+ $sharedSupplement = true;
}
}
- $this->{$this->mAction} ( $this->mShared );
- if ( $this->mSharedSupplement ) {
+
+ if ( $this->hasOption( 'local' ) ) {
+ $this->fetchLocal( $shared );
+ } elseif ( $this->hasOption( 'used' ) ) {
+ $this->fetchUsed( $shared );
+ } else {
+ $this->fetchLocal( $shared );
+ }
+
+ if ( $sharedSupplement ) {
$this->fetchUsed( true );
}
}
$files = [];
$fileLines = file( $fileName );
if ( $fileLines === false ) {
- $this->hasError = true;
$this->error( "Unable to open list file $fileName." );
return $files;
if ( file_exists( $extension ) ) {
$files[] = $extension;
} else {
- $this->hasError = true;
$this->error( "Extension {$extension} doesn't exist" );
}
}