diff --git a/Console/Command/ThumbnailShell.php b/Console/Command/ThumbnailShell.php index b58a976e..676328e4 100644 --- a/Console/Command/ThumbnailShell.php +++ b/Console/Command/ThumbnailShell.php @@ -21,7 +21,7 @@ class ThumbnailShell extends AppShell { */ public function getOptionParser() { $parser = parent::getOptionParser(); - $parser->addSubcommand('generate', ['help' => 'Find models and regenerate the thumbnails.']); + $parser->addSubcommand('generate', array('help' => 'Find models and regenerate the thumbnails.')); return $parser; } @@ -62,12 +62,12 @@ public function generate() { 'rootDir' => $mergedConfig['rootDir'], ); - $files = $this->{$modelName}->find('all', [ + $files = $this->{$modelName}->find('all', array( 'fields' => [$this->{$modelName}->primaryKey, $field, $mergedConfig['fields']['dir']], - 'conditions' => [ + 'conditions' => array( $field . " IS NOT NULL" - ] - ]); + ) + )); foreach ($files as $file) { $this->{$modelName}->Behaviors->load('ShellUpload', $behaviorConfig); @@ -79,19 +79,19 @@ public function generate() { } // $field needs to be an array like uploading an image - $fieldData = [ + $fieldData = array( 'name' => basename($sourceFilePath), 'type' => mime_content_type($sourceFilePath), 'size' => filesize($sourceFilePath), 'tmp_name' => $sourceFilePath, 'error' => UPLOAD_ERR_OK - ]; + ); - $data = [ + $data = array( $this->{$modelName}->primaryKey => $file[$modelName][$this->{$modelName}->primaryKey], $field => $fieldData, $config['fields']['dir'] => $file[$modelName][$this->{$modelName}->primaryKey], - ]; + ); if ($this->{$modelName}->hasField('modified')) { $data['modified'] = false; @@ -107,4 +107,4 @@ public function generate() { } } } -} \ No newline at end of file +} diff --git a/README.md b/README.md index 6a9184de..cc3801b3 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Media Plugin is too complicated, and it was a PITA to merge the latest updates i * CakePHP 2.x * Imagick/GD PHP Extension (for thumbnail creation) -* PHP 5 +* PHP 5.3+ * Patience ## Documentation