Actually create directories before using store operations.

Change-Id: I69a6b84f2f989fbe4cdd35ba75f25a4a26406347
This commit is contained in:
Aaron Schulz 2012-12-18 14:25:37 -08:00
parent 3b987fb098
commit 099b318d61

View file

@ -105,9 +105,11 @@ class GenerateFancyCaptchas extends Maintenance {
continue;
}
list( $salt, $hash ) = $instance->hashFromImageName( $fileInfo->getBasename() );
$dest = $instance->imagePath( $salt, $hash );
$backend->prepare( array( 'dir' => dirname( $dest ) ) );
$status = $backend->quickStore( array(
'src' => $fileInfo->getPathname(),
'dst' => $instance->imagePath( $salt, $hash )
'dst' => $dest
) );
if ( !$status->isOK() ) {
$this->error( "Could not save file '{$fileInfo->getPathname()}'.\n" );