diff --git a/src/Plugin/ImageToolkit/ImagemagickToolkit.php b/src/Plugin/ImageToolkit/ImagemagickToolkit.php index 8552a17..717a041 100644 --- a/src/Plugin/ImageToolkit/ImagemagickToolkit.php +++ b/src/Plugin/ImageToolkit/ImagemagickToolkit.php @@ -145,6 +145,8 @@ class ImagemagickToolkit extends ImageToolkitBase { * {@inheritdoc} */ public function buildConfigurationForm(array $form, FormStateInterface $form_state) { + $config = $this->configFactory->getEditable('imagemagick.settings'); + $form['imagemagick'] = array( '#type' => 'item', '#description' => $this->t('ImageMagick is a stand-alone program for image manipulation. It must be installed on the server and you need to know where it is located. Consult your server administrator or hosting provider for details.'), @@ -156,7 +158,7 @@ class ImagemagickToolkit extends ImageToolkitBase { '#min' => 0, '#max' => 100, '#maxlength' => 3, - '#default_value' => $this->configFactory->get('imagemagick.settings')->get('quality'), + '#default_value' => $config->get('quality'), '#field_suffix' => '%', '#description' => $this->t('Define the image quality of processed images. Ranges from 0 to 100. Higher values mean better image quality but bigger files.'), ); @@ -165,19 +167,19 @@ class ImagemagickToolkit extends ImageToolkitBase { '#title' => $this->t('Enable GraphicsMagick support', array( '@gm-url' => 'http://www.graphicsmagick.org', )), - '#default_value' => $this->configFactory->get('imagemagick.settings')->get('gm'), + '#default_value' => $config->get('gm'), ); $form['convert'] = array( '#type' => 'textfield', '#title' => $this->t('Path to the "convert" binary'), - '#default_value' => $this->configFactory->get('imagemagick.settings')->get('convert'), + '#default_value' => $config->get('convert'), '#required' => TRUE, '#description' => $this->t('The complete path and filename of the ImageMagick convert binary. For example: /usr/bin/convert or C:\Program Files\ImageMagick-6.3.4-Q16\convert.exe'), ); $form['prepend'] = array( '#type' => 'textfield', '#title' => $this->t('Prepend arguments'), - '#default_value' => $this->configFactory->get('imagemagick.settings')->get('prepend'), + '#default_value' => $config->get('prepend'), '#required' => FALSE, '#description' => $this->t('Additional arguments to add in front of the others when executing the convert command. Useful if you need to set -limit arguments.'), ); @@ -185,14 +187,14 @@ class ImagemagickToolkit extends ImageToolkitBase { $form['use_identify'] = array( '#type' => 'checkbox', '#title' => $this->t('Use "identify"'), - '#default_value' => $this->configFactory->get('imagemagick.settings')->get('use_identify'), + '#default_value' => $config->get('use_identify'), '#description' => $this->t('Use ImageMagick identify binary to parse image files to determine image format and dimensions. If not selected, the PHP getimagesize function will be used.'), ); $form['debug'] = array( '#type' => 'checkbox', '#title' => $this->t('Display debugging information'), - '#default_value' => $this->configFactory->get('imagemagick.settings')->get('debug'), + '#default_value' => $config->get('debug'), '#description' => $this->t('Shows ImageMagick commands and their output to users with the %permission permission.', array( '%permission' => $this->t('Administer site configuration'), )), @@ -207,7 +209,7 @@ class ImagemagickToolkit extends ImageToolkitBase { $form['advanced']['density'] = array( '#type' => 'checkbox', '#title' => $this->t('Change image resolution to 72 ppi'), - '#default_value' => $this->configFactory->get('imagemagick.settings')->get('advanced.density'), + '#default_value' => $config->get('advanced.density'), '#return_value' => 72, '#description' => $this->t('Resamples the image density to a resolution of 72 pixels per inch, the default for web images. Does not affect the pixel size or quality.', array( '@help-url' => 'http://www.imagemagick.org/script/command-line-options.php#density', @@ -216,7 +218,7 @@ class ImagemagickToolkit extends ImageToolkitBase { $form['advanced']['colorspace'] = array( '#type' => 'select', '#title' => $this->t('Convert colorspace'), - '#default_value' => $this->configFactory->get('imagemagick.settings')->get('advanced.colorspace'), + '#default_value' => $config->get('advanced.colorspace'), '#options' => array( 'RGB' => $this->t('RGB'), 'sRGB' => $this->t('sRGB'), @@ -236,7 +238,7 @@ class ImagemagickToolkit extends ImageToolkitBase { $form['advanced']['profile'] = array( '#type' => 'textfield', '#title' => $this->t('Color profile path'), - '#default_value' => $this->configFactory->get('imagemagick.settings')->get('advanced.profile'), + '#default_value' => $config->get('advanced.profile'), '#description' => $this->t('The path to a color profile file that all processed images will be converted to. Leave blank to disable. Use a sRGB profile to correct the display of professional images and photography.', array( '@help-url' => 'http://www.imagemagick.org/script/command-line-options.php#profile', '@color-url' => 'http://www.color.org/profiles.html', @@ -315,7 +317,7 @@ class ImagemagickToolkit extends ImageToolkitBase { * {@inheritdoc} */ public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - $this->configFactory->get('imagemagick.settings') + $this->configFactory->getEditable('imagemagick.settings') ->set('quality', $form_state->getValue(array('imagemagick', 'quality'))) ->set('gm', $form_state->getValue(array('imagemagick', 'gm'))) ->set('convert', $form_state->getValue(array('imagemagick', 'convert'))) diff --git a/src/Plugin/ImageToolkit/Operation/imagemagick/CreateNew.php b/src/Plugin/ImageToolkit/Operation/imagemagick/CreateNew.php index 9cf0e4d..6de9b33 100644 --- a/src/Plugin/ImageToolkit/Operation/imagemagick/CreateNew.php +++ b/src/Plugin/ImageToolkit/Operation/imagemagick/CreateNew.php @@ -8,7 +8,7 @@ namespace Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick; use Drupal\Component\Utility\Color; -use Drupal\Component\Utility\String; +use Drupal\Component\Utility\SafeMarkup; /** * Defines imagemagick CreateNew operation. @@ -53,7 +53,7 @@ class CreateNew extends ImagemagickImageToolkitOperationBase { protected function validateArguments(array $arguments) { // Assure extension is supported. if (!in_array($arguments['extension'], $this->getToolkit()->getSupportedExtensions())) { - throw new \InvalidArgumentException(String::format("Invalid extension (@value) specified for the image 'convert' operation", array('@value' => $arguments['extension']))); + throw new \InvalidArgumentException(SafeMarkup::format("Invalid extension (@value) specified for the image 'convert' operation", array('@value' => $arguments['extension']))); } // Assure integers for width and height. @@ -62,15 +62,15 @@ class CreateNew extends ImagemagickImageToolkitOperationBase { // Fail when width or height are 0 or negative. if ($arguments['width'] <= 0) { - throw new \InvalidArgumentException(String::format("Invalid width (@value) specified for the image 'create_new' operation", array('@value' => $arguments['width']))); + throw new \InvalidArgumentException(SafeMarkup::format("Invalid width (@value) specified for the image 'create_new' operation", array('@value' => $arguments['width']))); } if ($arguments['height'] <= 0) { - throw new \InvalidArgumentException(String::format("Invalid height (@value) specified for the image 'create_new' operation", array('@value' => $arguments['height']))); + throw new \InvalidArgumentException(SafeMarkup::format("Invalid height (@value) specified for the image 'create_new' operation", array('@value' => $arguments['height']))); } // Assure transparent color is a valid hex string. if ($arguments['transparent_color'] && !Color::validateHex($arguments['transparent_color'])) { - throw new \InvalidArgumentException(String::format("Invalid transparent color (@value) specified for the image 'create_new' operation", array('@value' => $arguments['transparent_color']))); + throw new \InvalidArgumentException(SafeMarkup::format("Invalid transparent color (@value) specified for the image 'create_new' operation", array('@value' => $arguments['transparent_color']))); } return $arguments; diff --git a/src/Plugin/ImageToolkit/Operation/imagemagick/Crop.php b/src/Plugin/ImageToolkit/Operation/imagemagick/Crop.php index a32fced..e23fb07 100644 --- a/src/Plugin/ImageToolkit/Operation/imagemagick/Crop.php +++ b/src/Plugin/ImageToolkit/Operation/imagemagick/Crop.php @@ -7,7 +7,7 @@ namespace Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick; -use Drupal\Component\Utility\String; +use Drupal\Component\Utility\SafeMarkup; /** * Defines imagemagick Crop operation. @@ -67,10 +67,10 @@ class Crop extends ImagemagickImageToolkitOperationBase { // Fail when width or height are 0 or negative. if ($arguments['width'] <= 0) { - throw new \InvalidArgumentException(String::format("Invalid width (@value) specified for the image 'crop' operation", array('@value' => $arguments['width']))); + throw new \InvalidArgumentException(SafeMarkup::format("Invalid width (@value) specified for the image 'crop' operation", array('@value' => $arguments['width']))); } if ($arguments['height'] <= 0) { - throw new \InvalidArgumentException(String::format("Invalid height (@value) specified for the image 'crop' operation", array('@value' => $arguments['height']))); + throw new \InvalidArgumentException(SafeMarkup::format("Invalid height (@value) specified for the image 'crop' operation", array('@value' => $arguments['height']))); } return $arguments; diff --git a/src/Plugin/ImageToolkit/Operation/imagemagick/Resize.php b/src/Plugin/ImageToolkit/Operation/imagemagick/Resize.php index a43bca4..ef4d48b 100644 --- a/src/Plugin/ImageToolkit/Operation/imagemagick/Resize.php +++ b/src/Plugin/ImageToolkit/Operation/imagemagick/Resize.php @@ -7,7 +7,7 @@ namespace Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick; -use Drupal\Component\Utility\String; +use Drupal\Component\Utility\SafeMarkup; /** * Defines imagemagick resize operation. @@ -46,10 +46,10 @@ class Resize extends ImagemagickImageToolkitOperationBase { // Fail when width or height are 0 or negative. if ($arguments['width'] <= 0) { - throw new \InvalidArgumentException(String::format("Invalid width (@value) specified for the image 'resize' operation", array('@value' => $arguments['width']))); + throw new \InvalidArgumentException(SafeMarkup::format("Invalid width (@value) specified for the image 'resize' operation", array('@value' => $arguments['width']))); } if ($arguments['height'] <= 0) { - throw new \InvalidArgumentException(String::format("Invalid height (@value) specified for the image 'resize' operation", array('@value' => $arguments['height']))); + throw new \InvalidArgumentException(SafeMarkup::format("Invalid height (@value) specified for the image 'resize' operation", array('@value' => $arguments['height']))); } return $arguments; diff --git a/src/Plugin/ImageToolkit/Operation/imagemagick/Rotate.php b/src/Plugin/ImageToolkit/Operation/imagemagick/Rotate.php index bf275a0..bacf3f1 100644 --- a/src/Plugin/ImageToolkit/Operation/imagemagick/Rotate.php +++ b/src/Plugin/ImageToolkit/Operation/imagemagick/Rotate.php @@ -8,7 +8,7 @@ namespace Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick; use Drupal\Component\Utility\Color; -use Drupal\Component\Utility\String; +use Drupal\Component\Utility\SafeMarkup; use Drupal\imagemagick\Rectangle; /** @@ -48,7 +48,7 @@ class Rotate extends ImagemagickImageToolkitOperationBase { if (!empty($arguments['background'])) { // Validate the background color. if (!Color::validateHex($arguments['background'])) { - throw new \InvalidArgumentException(String::format("Invalid color '@value' specified for the 'rotate' operation.", array('@value' => $arguments['background']))); + throw new \InvalidArgumentException(SafeMarkup::format("Invalid color '@value' specified for the 'rotate' operation.", array('@value' => $arguments['background']))); } } else { diff --git a/src/Plugin/ImageToolkit/Operation/imagemagick/Scale.php b/src/Plugin/ImageToolkit/Operation/imagemagick/Scale.php index d9244c3..18566a9 100644 --- a/src/Plugin/ImageToolkit/Operation/imagemagick/Scale.php +++ b/src/Plugin/ImageToolkit/Operation/imagemagick/Scale.php @@ -7,7 +7,7 @@ namespace Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick; -use Drupal\Component\Utility\String; +use Drupal\Component\Utility\SafeMarkup; /** * Defines imagemagick Scale operation. @@ -73,10 +73,10 @@ class Scale extends Resize { // Fail when width or height are 0 or negative. if ($arguments['width'] <= 0) { - throw new \InvalidArgumentException(String::format("Invalid width (@value) specified for the image 'scale' operation", array('@value' => $arguments['width']))); + throw new \InvalidArgumentException(SafeMarkup::format("Invalid width (@value) specified for the image 'scale' operation", array('@value' => $arguments['width']))); } if ($arguments['height'] <= 0) { - throw new \InvalidArgumentException(String::format("Invalid height (@value) specified for the image 'scale' operation", array('@value' => $arguments['height']))); + throw new \InvalidArgumentException(SafeMarkup::format("Invalid height (@value) specified for the image 'scale' operation", array('@value' => $arguments['height']))); } return $arguments; diff --git a/src/Plugin/ImageToolkit/Operation/imagemagick/ScaleAndCrop.php b/src/Plugin/ImageToolkit/Operation/imagemagick/ScaleAndCrop.php index 2627e8c..8bc3d28 100644 --- a/src/Plugin/ImageToolkit/Operation/imagemagick/ScaleAndCrop.php +++ b/src/Plugin/ImageToolkit/Operation/imagemagick/ScaleAndCrop.php @@ -7,7 +7,7 @@ namespace Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick; -use Drupal\Component\Utility\String; +use Drupal\Component\Utility\SafeMarkup; /** * Defines imagemagick Scale and crop operation. @@ -54,10 +54,10 @@ class ScaleAndCrop extends ImagemagickImageToolkitOperationBase { // Fail when width or height are 0 or negative. if ($arguments['width'] <= 0) { - throw new \InvalidArgumentException(String::format("Invalid width (@value) specified for the image 'scale_and_crop' operation", array('@value' => $arguments['width']))); + throw new \InvalidArgumentException(SafeMarkup::format("Invalid width (@value) specified for the image 'scale_and_crop' operation", array('@value' => $arguments['width']))); } if ($arguments['height'] <= 0) { - throw new \InvalidArgumentException(String::format("Invalid height (@value) specified for the image 'scale_and_crop' operation", array('@value' => $arguments['height']))); + throw new \InvalidArgumentException(SafeMarkup::format("Invalid height (@value) specified for the image 'scale_and_crop' operation", array('@value' => $arguments['height']))); } return $arguments; diff --git a/src/Plugin/ImageToolkit/Operation/imagemagick/Sharpen.php b/src/Plugin/ImageToolkit/Operation/imagemagick/Sharpen.php index 01d173a..2577d92 100644 --- a/src/Plugin/ImageToolkit/Operation/imagemagick/Sharpen.php +++ b/src/Plugin/ImageToolkit/Operation/imagemagick/Sharpen.php @@ -7,8 +7,6 @@ namespace Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick; -use Drupal\Component\Utility\String; - /** * Defines imagemagick Sharpen operation. * diff --git a/src/Plugin/ImageToolkit/Operation/imagemagick/Watermark.php b/src/Plugin/ImageToolkit/Operation/imagemagick/Watermark.php index a8a8b90..5cf4ca9 100644 --- a/src/Plugin/ImageToolkit/Operation/imagemagick/Watermark.php +++ b/src/Plugin/ImageToolkit/Operation/imagemagick/Watermark.php @@ -7,8 +7,6 @@ namespace Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick; -use Drupal\Component\Utility\String; - /** * Defines imagemagick Watermark operation. * diff --git a/src/Tests/ToolkitImagemagickTest.php b/src/Tests/ToolkitImagemagickTest.php index ac1395b..bf99de6 100644 --- a/src/Tests/ToolkitImagemagickTest.php +++ b/src/Tests/ToolkitImagemagickTest.php @@ -7,9 +7,9 @@ namespace Drupal\imagemagick\Tests; +use Drupal\Component\Utility\SafeMarkup; use Drupal\Core\Image\ImageInterface; use Drupal\simpletest\WebTestBase; -use Drupal\Component\Utility\String; /** * Tests that core image manipulations work properly through Imagemagick. @@ -60,10 +60,10 @@ class ToolkitImagemagickTest extends WebTestBase { $this->drupalLogin($admin_user); // Change the toolkit. - \Drupal::config('system.image') + \Drupal::configFactory()->getEditable('system.image') ->set('toolkit', 'imagemagick') ->save(); - \Drupal::config('imagemagick.settings') + \Drupal::configFactory()->getEditable('imagemagick.settings') ->set('debug', TRUE) ->set('quality', 100) ->save(); @@ -266,7 +266,7 @@ class ToolkitImagemagickTest extends WebTestBase { ); // Prepare a directory for test file results. - $directory = $this->public_files_directory . '/imagetest'; + $directory = $this->publicFilesDirectory . '/imagetest'; file_prepare_directory($directory, FILE_CREATE_DIRECTORY); foreach ($files as $file) { @@ -274,7 +274,7 @@ class ToolkitImagemagickTest extends WebTestBase { // Load up a fresh image. $image = $this->imageFactory->get(drupal_get_path('module', 'simpletest') . '/files/' . $file); if (!$image->isValid()) { - $this->fail(String::format('Could not load image %file.', array('%file' => $file))); + $this->fail(SafeMarkup::format('Could not load image %file.', array('%file' => $file))); continue 2; } @@ -291,7 +291,7 @@ class ToolkitImagemagickTest extends WebTestBase { // Check MIME type if needed. if (isset($values['mimetype'])) { - $this->assertEqual($values['mimetype'], $toolkit->getMimeType(), String::format('Image %file after %action action has proper MIME type (@mimetype).', array('%file' => $file, '%action' => $op, '@ew' => $values['width'], '@mimetype' => $values['mimetype']))); + $this->assertEqual($values['mimetype'], $toolkit->getMimeType(), SafeMarkup::format('Image %file after %action action has proper MIME type (@mimetype).', array('%file' => $file, '%action' => $op, '@ew' => $values['width'], '@mimetype' => $values['mimetype']))); } // To keep from flooding the test with assert values, make a general @@ -309,8 +309,8 @@ class ToolkitImagemagickTest extends WebTestBase { $correct_dimensions_object = FALSE; } - $this->assertTrue($correct_dimensions_real, String::format('Image %file after %action action has proper dimensions. Expected @ewx@eh, actual @awx@ah.', array('%file' => $file, '%action' => $op, '@ew' => $values['width'], '@eh' => $values['height'], '@aw' => imagesx($toolkit->getResource()), '@ah' => imagesy($toolkit->getResource())))); - $this->assertTrue($correct_dimensions_object, String::format('Image %file object after %action action is reporting the proper height and width values. Expected @ewx@eh, actual @awx@ah.', array('%file' => $file, '%action' => $op, '@ew' => $values['width'], '@eh' => $values['height'], '@aw' => imagesx($toolkit->getResource()), '@ah' => imagesy($toolkit->getResource())))); + $this->assertTrue($correct_dimensions_real, SafeMarkup::format('Image %file after %action action has proper dimensions. Expected @ewx@eh, actual @awx@ah.', array('%file' => $file, '%action' => $op, '@ew' => $values['width'], '@eh' => $values['height'], '@aw' => imagesx($toolkit->getResource()), '@ah' => imagesy($toolkit->getResource())))); + $this->assertTrue($correct_dimensions_object, SafeMarkup::format('Image %file object after %action action is reporting the proper height and width values. Expected @ewx@eh, actual @awx@ah.', array('%file' => $file, '%action' => $op, '@ew' => $values['width'], '@eh' => $values['height'], '@aw' => imagesx($toolkit->getResource()), '@ah' => imagesy($toolkit->getResource())))); // JPEG colors will always be messed up due to compression. if ($image->getToolkit()->getType() != IMAGETYPE_JPEG) { @@ -351,7 +351,7 @@ class ToolkitImagemagickTest extends WebTestBase { } $color = $this->getPixelColor($image, $x, $y); $correct_colors = $this->colorsAreEqual($color, $corner); - $this->assertTrue($correct_colors, String::format('Image %file object after %action action has the correct color placement at corner %corner.', array('%file' => $file, '%action' => $op, '%corner' => $key))); + $this->assertTrue($correct_colors, SafeMarkup::format('Image %file object after %action action has the correct color placement at corner %corner.', array('%file' => $file, '%action' => $op, '%corner' => $key))); } } } @@ -363,25 +363,25 @@ class ToolkitImagemagickTest extends WebTestBase { $image->createNew(50, 20, image_type_to_extension($type, FALSE), '#ffff00'); $file = 'from_null' . image_type_to_extension($type); $file_path = $directory . '/' . $file; - $this->assertEqual(50, $image->getWidth(), String::format('Image file %file has the correct width.', array('%file' => $file))); - $this->assertEqual(20, $image->getHeight(), String::format('Image file %file has the correct height.', array('%file' => $file))); - $this->assertEqual(image_type_to_mime_type($type), $image->getMimeType(), String::format('Image file %file has the correct MIME type.', array('%file' => $file))); - $this->assertTrue($image->save($file_path), String::format('Image %file created anew from a null image was saved.', array('%file' => $file))); + $this->assertEqual(50, $image->getWidth(), SafeMarkup::format('Image file %file has the correct width.', array('%file' => $file))); + $this->assertEqual(20, $image->getHeight(), SafeMarkup::format('Image file %file has the correct height.', array('%file' => $file))); + $this->assertEqual(image_type_to_mime_type($type), $image->getMimeType(), SafeMarkup::format('Image file %file has the correct MIME type.', array('%file' => $file))); + $this->assertTrue($image->save($file_path), SafeMarkup::format('Image %file created anew from a null image was saved.', array('%file' => $file))); // Reload saved image. $image_reloaded = $this->imageFactory->get($file_path, 'gd'); if (!$image_reloaded->isValid()) { - $this->fail(String::format('Could not load image %file.', array('%file' => $file))); + $this->fail(SafeMarkup::format('Could not load image %file.', array('%file' => $file))); continue; } - $this->assertEqual(50, $image_reloaded->getWidth(), String::format('Image file %file has the correct width.', array('%file' => $file))); - $this->assertEqual(20, $image_reloaded->getHeight(), String::format('Image file %file has the correct height.', array('%file' => $file))); - $this->assertEqual(image_type_to_mime_type($type), $image_reloaded->getMimeType(), String::format('Image file %file has the correct MIME type.', array('%file' => $file))); + $this->assertEqual(50, $image_reloaded->getWidth(), SafeMarkup::format('Image file %file has the correct width.', array('%file' => $file))); + $this->assertEqual(20, $image_reloaded->getHeight(), SafeMarkup::format('Image file %file has the correct height.', array('%file' => $file))); + $this->assertEqual(image_type_to_mime_type($type), $image_reloaded->getMimeType(), SafeMarkup::format('Image file %file has the correct MIME type.', array('%file' => $file))); if ($image_reloaded->getToolkit()->getType() == IMAGETYPE_GIF) { - $this->assertEqual('#ffff00', $image_reloaded->getToolkit()->getTransparentColor(), String::format('Image file %file has the correct transparent color channel set.', array('%file' => $file))); + $this->assertEqual('#ffff00', $image_reloaded->getToolkit()->getTransparentColor(), SafeMarkup::format('Image file %file has the correct transparent color channel set.', array('%file' => $file))); } else { - $this->assertEqual(NULL, $image_reloaded->getToolkit()->getTransparentColor(), String::format('Image file %file has no color channel set.', array('%file' => $file))); + $this->assertEqual(NULL, $image_reloaded->getToolkit()->getTransparentColor(), SafeMarkup::format('Image file %file has no color channel set.', array('%file' => $file))); } } @@ -415,7 +415,7 @@ class ToolkitImagemagickTest extends WebTestBase { $file_path = $directory . '/' . $file; $image->save($file_path); $image_reloaded = $this->imageFactory->get($file_path); - $this->assertTrue($image_reloaded->isValid(), String::format('Image file %file loaded successfully.', array('%file' => $file))); + $this->assertTrue($image_reloaded->isValid(), SafeMarkup::format('Image file %file loaded successfully.', array('%file' => $file))); } } }