function __construct() {
parent::__construct();
- $this->mDescription = "Find unregistered files in the 'public' repo zone.";
+ $this->addDescription( "Find unregistered files in the 'public' repo zone." );
$this->addOption( 'subdir',
'Only scan files in this subdirectory (e.g. "a/a0")', false, true );
$this->addOption( 'verbose', "Mention file paths checked" );
foreach ( array_diff( $curNames, $curNamesFound ) as $name ) {
$file = $repo->newFile( $name );
// Print name and public URL to ease recovery
- $this->output( $name . "\n" . $file->getCanonicalUrl() . "\n\n" );
+ if ( $file ) {
+ $this->output( $name . "\n" . $file->getCanonicalUrl() . "\n\n" );
+ } else {
+ $this->error( "Cannot get URL for bad file title '$name'" );
+ }
}
foreach ( array_diff( $oldNames, $oldNamesFound ) as $name ) {