<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,8 +2,12 @@
 /**
  * Plugin Configuration File
  *
- * Include it in your app's core.php or bootstrap.php
- * then customize configuration values if you need to.
+ * In order to make the plugin work you must include this file
+ * within either your app&#8217;s `core.php` or `bootstrap.php`.
+ *
+ * To overwrite defaults you'll define constants before including this file,
+ * and overwrite other settings selectively with `Configure::write()`
+ * calls after including it.
  *
  * Copyright (c) 2007-2009 David Persson
  *
@@ -21,106 +25,111 @@
  * @since      media 0.50
  */
 /**
- * An absolute (slash terminated) path to a directory holding media files
+ * Directory paths
+ *
+ * Each constant is defined with a value which is
+ * an absolute (slash terminated) path to a directory holding media files.
  *
- * E.g.: /var/www/example.org/htdocs/app/webroot/media/
+ * Example:
+ * 	`'/var/www/example.org/htdocs/app/webroot/media/'`
  */
-	if (!defined('MEDIA')) {
-		define('MEDIA', WWW_ROOT . 'media' . DS);
-	}
-	if (!defined('MEDIA_STATIC')) {
-		define('MEDIA_STATIC', MEDIA . 'static' . DS);
-	}
-	if (!defined('MEDIA_FILTER')) {
-		define('MEDIA_FILTER', MEDIA . 'filter' . DS);
-	}
-	if (!defined('MEDIA_TRANSFER')) {
-		define('MEDIA_TRANSFER', MEDIA . 'transfer' . DS);
-	}
-/*
- * Either a (slash terminated) complete URL or an path fragment relative to your webroot
+if (!defined('MEDIA')) {
+	define('MEDIA', WWW_ROOT . 'media' . DS);
+}
+if (!defined('MEDIA_STATIC')) {
+	define('MEDIA_STATIC', MEDIA . 'static' . DS);
+}
+if (!defined('MEDIA_FILTER')) {
+	define('MEDIA_FILTER', MEDIA . 'filter' . DS);
+}
+if (!defined('MEDIA_TRANSFER')) {
+	define('MEDIA_TRANSFER', MEDIA . 'transfer' . DS);
+}
+/**
+ * URL paths
+ *
+ * Each constant is defined with a value which is
+ * either a (slash terminated) complete URL or an path fragment relative to your webroot.
  *
- * In case the corresponding  directory isn't served define the constant with a value of `false`
+ * In case the corresponding directory isn't served use `false` as a value.
  *
- * E.g.: http://www.example.org/app/media/
- * E.g.: media/
- * E.g.: false
+ * Examples:
+ * 	`'http://www.example.org/app/media/'`
+ * 	`'media/'`
+ * 	`false`
  */
-	if (!defined('MEDIA_URL')) {
-		define('MEDIA_URL', 'media/');
-	}
-	if (!defined('MEDIA_STATIC_URL')) {
-		define('MEDIA_STATIC_URL', MEDIA_URL . 'static/');
-	}
-	if (!defined('MEDIA_FILTER_URL')) {
-		define('MEDIA_FILTER_URL', MEDIA_URL . 'filter/');
-	}
-	if (!defined('MEDIA_TRANSFER_URL')) {
-		define('MEDIA_TRANSFER_URL', MEDIA_URL . 'transfer/');
-	}
+if (!defined('MEDIA_URL')) {
+	define('MEDIA_URL', 'media/');
+}
+if (!defined('MEDIA_STATIC_URL')) {
+	define('MEDIA_STATIC_URL', MEDIA_URL . 'static/');
+}
+if (!defined('MEDIA_FILTER_URL')) {
+	define('MEDIA_FILTER_URL', MEDIA_URL . 'filter/');
+}
+if (!defined('MEDIA_TRANSFER_URL')) {
+	define('MEDIA_TRANSFER_URL', MEDIA_URL . 'transfer/');
+}
 /**
  * MIME type detection by file extension
  *
- * 	engine - null for autodetection or core
- * 	db     - absolute path to a glob db file in freedesktop, apache, or php format
- * 	         (required for core)
+ * Options:
+ * 	engine - `null` for autodetection or `'core'`
+ * 	db     - Absolute path to a glob db file in freedesktop, apache, or php format
+ * 	         (required for core engine)
  */
-	Configure::write('Mime.glob', array(
-		'engine' =&gt; null,
-		'db'     =&gt; null,
-	));
+Configure::write('Mime.glob', array(
+	'engine' =&gt; null,
+	'db'     =&gt; null,
+));
 /**
  * MIME type detection by file content
  *
- * 	engine - null for autodetection or core, fileinfo, mime_magic
- * 	db     - absolute path to a glob db file in freedesktop, apache, or php format
- * 	         (optional for the fileinfo and mime_magic engine, required for core)
+ * Options:
+ * 	engine - `null` for autodetection or `'core'`, `'fileinfo'`, `'mime_magic'`
+ * 	db     - Absolute path to a glob db file in freedesktop, apache, or php format
+ * 	         (optional for the fileinfo and mime_magic engine, required for core engine)
  */
-	Configure::write('Mime.magic', array(
-		'engine' =&gt; null,
-		'db'     =&gt; null,
-	));
+Configure::write('Mime.magic', array(
+	'engine' =&gt; null,
+	'db'     =&gt; null,
+));
 /**
- * Media filters
+ * Filters and versions
  *
- * A filter is a set of instructions.
- * Each instruction represents a call to a method of the Medium class.
+ * For each medium type a set of filters keyed by version name is configured.
+ * A filter is a set of instructions which are processed by the Medium class.
  */
-	Configure::write('Media.filter.audio', array(
-		's'   =&gt; array('convert' =&gt; 'image/png', 'fitCrop' =&gt; array(100, 100)),
-		'm'   =&gt; array('convert' =&gt; 'image/png', 'fit' =&gt; array(300, 300)),
-	    )
-	);
-	Configure::write('Media.filter.css', array(
-		'c'   =&gt; array('compress'),
-		)
-	);
-	Configure::write('Media.filter.document', array(
-		'xxs' =&gt; array('convert' =&gt; 'image/png', 'zoomCrop' =&gt; array(16, 16)),
-		's'   =&gt; array('convert' =&gt; 'image/png', 'fitCrop' =&gt; array(100, 100)),
-		'm'   =&gt; array('convert' =&gt; 'image/png', 'fit' =&gt; array(300, 300)),
-		)
-	);
-	Configure::write('Media.filter.generic', array());
-	Configure::write('Media.filter.image', array(
-		'xxs' =&gt; array('convert' =&gt; 'image/png', 'zoomCrop' =&gt; array(16, 16)),
-		'xs'  =&gt; array('convert' =&gt; 'image/png', 'zoomCrop' =&gt; array(32, 32)),
-		's'   =&gt; array('convert' =&gt; 'image/png', 'fitCrop' =&gt; array(100, 100)),
-		'm'   =&gt; array('convert' =&gt; 'image/png', 'fit' =&gt; array(300, 300)),
-		'l'   =&gt; array('convert' =&gt; 'image/png', 'fit' =&gt; array(450, 450)),
-		'xl'  =&gt; array('convert' =&gt; 'image/png', 'fit' =&gt; array(680, 440)),
-		)
-	);
-	Configure::write('Media.filter.icon', array());
-	Configure::write('Media.filter.js', array(
-		'c'   =&gt; array('compress'),
-		)
-	);
-	Configure::write('Media.filter.text', array());
-	Configure::write('Media.filter.video', array(
-		'xxs' =&gt; array('convert' =&gt; 'image/png', 'zoomCrop' =&gt; array(16, 16)),
-		's'   =&gt; array('convert' =&gt; 'image/png', 'fitCrop' =&gt; array(100, 100)),
-		'm'   =&gt; array('convert' =&gt; 'image/png', 'fit' =&gt; array(300, 300)),
-		)
-	);
+Configure::write('Media.filter.audio', array(
+	's'   =&gt; array('convert' =&gt; 'image/png', 'fitCrop' =&gt; array(100, 100)),
+	'm'   =&gt; array('convert' =&gt; 'image/png', 'fit' =&gt; array(300, 300)),
+));
+Configure::write('Media.filter.css', array(
+	'c'   =&gt; array('compress'),
+));
+Configure::write('Media.filter.document', array(
+	'xxs' =&gt; array('convert' =&gt; 'image/png', 'zoomCrop' =&gt; array(16, 16)),
+	's'   =&gt; array('convert' =&gt; 'image/png', 'fitCrop' =&gt; array(100, 100)),
+	'm'   =&gt; array('convert' =&gt; 'image/png', 'fit' =&gt; array(300, 300)),
+));
+Configure::write('Media.filter.generic', array());
+Configure::write('Media.filter.image', array(
+	'xxs' =&gt; array('convert' =&gt; 'image/png', 'zoomCrop' =&gt; array(16, 16)),
+	'xs'  =&gt; array('convert' =&gt; 'image/png', 'zoomCrop' =&gt; array(32, 32)),
+	's'   =&gt; array('convert' =&gt; 'image/png', 'fitCrop' =&gt; array(100, 100)),
+	'm'   =&gt; array('convert' =&gt; 'image/png', 'fit' =&gt; array(300, 300)),
+	'l'   =&gt; array('convert' =&gt; 'image/png', 'fit' =&gt; array(450, 450)),
+	'xl'  =&gt; array('convert' =&gt; 'image/png', 'fit' =&gt; array(680, 440)),
+	)
+);
+Configure::write('Media.filter.icon', array());
+Configure::write('Media.filter.js', array(
+	'c'   =&gt; array('compress'),
+));
+Configure::write('Media.filter.text', array());
+Configure::write('Media.filter.video', array(
+	'xxs' =&gt; array('convert' =&gt; 'image/png', 'zoomCrop' =&gt; array(16, 16)),
+	's'   =&gt; array('convert' =&gt; 'image/png', 'fitCrop' =&gt; array(100, 100)),
+	'm'   =&gt; array('convert' =&gt; 'image/png', 'fit' =&gt; array(300, 300)),
+));
 ?&gt;</diff>
      <filename>config/core.php</filename>
    </modified>
    <modified>
      <diff>@@ -23,26 +23,41 @@
  * @subpackage media.config.sql
  */
 class MediaSchema extends CakeSchema {
-
+/**
+ * before
+ *
+ * @param array $event
+ * @access public
+ */
 	function before($event = array()) {
 		return true;
 	}
-
+/**
+ * after
+ *
+ * @param array $event
+ * @access public
+ */
 	function after($event = array()) {
 	}
-
+/**
+ * attachments
+ *
+ * @var array
+ * @access public
+ */
 	var $attachments = array(
-			'id'          =&gt; array('type' =&gt; 'integer', 'null' =&gt; false, 'default' =&gt; NULL, 'key' =&gt; 'primary', 'extra' =&gt; 'auto_increment', 'length' =&gt; 10),
-			'model'       =&gt; array('type' =&gt; 'string', 'null' =&gt; false, 'default' =&gt; NULL, 'length' =&gt; 255),
-			'foreign_key' =&gt; array('type' =&gt; 'integer', 'null' =&gt; false, 'default' =&gt; NULL, 'length' =&gt; 10),
-			'dirname'     =&gt; array('type' =&gt; 'string', 'null' =&gt; true, 'default' =&gt; NULL, 'length' =&gt; 255),
-			'basename'    =&gt; array('type' =&gt; 'string', 'null' =&gt; false, 'default' =&gt; NULL, 'length' =&gt; 255),
-			'checksum'    =&gt; array('type' =&gt; 'string', 'null' =&gt; false, 'default' =&gt; NULL, 'length' =&gt; 255),
-			'group'       =&gt; array('type' =&gt; 'string', 'null' =&gt; true, 'default' =&gt; NULL, 'length' =&gt; 255),
-			'alternative' =&gt; array('type' =&gt; 'string', 'null' =&gt; true, 'default' =&gt; NULL,'length' =&gt; 50),
-			'created'     =&gt; array('type' =&gt; 'datetime', 'null' =&gt; true, 'default' =&gt; NULL),
-			'modified'    =&gt; array('type' =&gt; 'datetime', 'null' =&gt; true, 'default' =&gt; NULL),
-			'indexes'     =&gt; array('PRIMARY' =&gt; array('column' =&gt; 'id', 'unique' =&gt; 1))
-			);
+		'id'          =&gt; array('type' =&gt; 'integer', 'null' =&gt; false, 'default' =&gt; NULL, 'key' =&gt; 'primary', 'extra' =&gt; 'auto_increment', 'length' =&gt; 10),
+		'model'       =&gt; array('type' =&gt; 'string', 'null' =&gt; false, 'default' =&gt; NULL, 'length' =&gt; 255),
+		'foreign_key' =&gt; array('type' =&gt; 'integer', 'null' =&gt; false, 'default' =&gt; NULL, 'length' =&gt; 10),
+		'dirname'     =&gt; array('type' =&gt; 'string', 'null' =&gt; true, 'default' =&gt; NULL, 'length' =&gt; 255),
+		'basename'    =&gt; array('type' =&gt; 'string', 'null' =&gt; false, 'default' =&gt; NULL, 'length' =&gt; 255),
+		'checksum'    =&gt; array('type' =&gt; 'string', 'null' =&gt; false, 'default' =&gt; NULL, 'length' =&gt; 255),
+		'group'       =&gt; array('type' =&gt; 'string', 'null' =&gt; true, 'default' =&gt; NULL, 'length' =&gt; 255),
+		'alternative' =&gt; array('type' =&gt; 'string', 'null' =&gt; true, 'default' =&gt; NULL,'length' =&gt; 50),
+		'created'     =&gt; array('type' =&gt; 'datetime', 'null' =&gt; true, 'default' =&gt; NULL),
+		'modified'    =&gt; array('type' =&gt; 'datetime', 'null' =&gt; true, 'default' =&gt; NULL),
+		'indexes'     =&gt; array('PRIMARY' =&gt; array('column' =&gt; 'id', 'unique' =&gt; 1))
+	);
 }
 ?&gt;
\ No newline at end of file</diff>
      <filename>config/sql/media.php</filename>
    </modified>
    <modified>
      <diff>@@ -22,5 +22,6 @@
  * @package    media
  * @subpackage media.controllers
  */
-class MediaAppController extends AppController {}
+class MediaAppController extends AppController {
+}
 ?&gt;
\ No newline at end of file</diff>
      <filename>media_app_controller.php</filename>
    </modified>
    <modified>
      <diff>@@ -22,5 +22,6 @@
  * @package    media
  * @subpackage media.models
  */
-class MediaAppModel extends AppModel {}
+class MediaAppModel extends AppModel {
+}
 ?&gt;
\ No newline at end of file</diff>
      <filename>media_app_model.php</filename>
    </modified>
    <modified>
      <diff>@@ -29,36 +29,38 @@ class Attachment extends MediaAppModel {
  * Name of model
  *
  * @var string
+ * @access public
  */
 	var $name = 'Attachment';
 /**
  * Name of table to use
  *
  * @var mixed
+ * @access public
  */
 	var $useTable = 'attachments';
 /**
  * actsAs property
  *
  * @var array
+ * @access public
  */
 	var $actsAs = array(
-			'Media.Polymorphic' =&gt; array(
-				'classField' =&gt; 'model',
-				'foreignKey' =&gt; 'foreign_key',
-				),
-			'Media.Transfer' =&gt; array(
-				'trustClient'     =&gt; false,
-				'destinationFile' =&gt; ':Medium.short::DS::Source.basename:',
-				'baseDirectory'   =&gt; MEDIA_TRANSFER,
-				'createDirectory' =&gt; true,
-				),
-			'Media.Media' =&gt; array(
-				'metadataLevel'   =&gt; 2,
-				'makeVersions'    =&gt; true,
-				'filterDirectory' =&gt; MEDIA_FILTER,
-				),
-			);
+		'Media.Polymorphic' =&gt; array(
+			'classField' =&gt; 'model',
+			'foreignKey' =&gt; 'foreign_key',
+		),
+		'Media.Transfer' =&gt; array(
+			'trustClient'     =&gt; false,
+			'destinationFile' =&gt; ':Medium.short::DS::Source.basename:',
+			'baseDirectory'   =&gt; MEDIA_TRANSFER,
+			'createDirectory' =&gt; true,
+		),
+		'Media.Media' =&gt; array(
+			'metadataLevel'   =&gt; 2,
+			'makeVersions'    =&gt; true,
+			'filterDirectory' =&gt; MEDIA_FILTER,
+	));
 /**
  * Validation rules for file and alternative fields
  *
@@ -70,50 +72,49 @@ class Attachment extends MediaAppModel {
  * try commenting the mimeType rule or providing less strict
  * settings for single rules.
  *
- * checkExtension and checkMimeType take both a blacklist and
+ * `checkExtension()` and `checkMimeType()` take both a blacklist and
  * a whitelist. If you are on windows make sure that you addtionally
- * specify the 'tmp' extension in case you are using a whitelist.
+ * specify the `'tmp'` extension in case you are using a whitelist.
  *
  * @var array
+ * @access public
  */
 	var $validate = array(
-			'file' =&gt; array(
-				'resource'   =&gt; array('rule' =&gt; 'checkResource'),
-				'access'     =&gt; array('rule' =&gt; 'checkAccess'),
-				'location'   =&gt; array('rule' =&gt; array('checkLocation', array(':MEDIA:', '/tmp/'))),
-				'permission' =&gt; array('rule' =&gt; array('checkPermission', '*')),
-				'size'       =&gt; array('rule' =&gt; array('checkSize', '5M')),
-				'pixels'     =&gt; array('rule' =&gt; array('checkPixels', '1600x1600')),
-				'extension'  =&gt; array('rule' =&gt; array('checkExtension',
-													array(
-														'bin', 'class', 'dll', 'dms', 'exe', 'lha',
-														'lzh', 'so', 'as', 'asp', 'sh', 'java', 'js',
-														'lisp', 'lua', 'pl', 'pm', 'php', 'py', 'pyc',
-														'vb', 'bas', 'jar',
-														),
-													'*'
+		'file' =&gt; array(
+			'resource'   =&gt; array('rule' =&gt; 'checkResource'),
+			'access'     =&gt; array('rule' =&gt; 'checkAccess'),
+			'location'   =&gt; array('rule' =&gt; array('checkLocation', array(':MEDIA:', '/tmp/'))),
+			'permission' =&gt; array('rule' =&gt; array('checkPermission', '*')),
+			'size'       =&gt; array('rule' =&gt; array('checkSize', '5M')),
+			'pixels'     =&gt; array('rule' =&gt; array('checkPixels', '1600x1600')),
+			'extension'  =&gt; array('rule' =&gt; array('checkExtension',
+												array(
+													'bin', 'class', 'dll', 'dms', 'exe', 'lha',
+													'lzh', 'so', 'as', 'asp', 'sh', 'java', 'js',
+													'lisp', 'lua', 'pl', 'pm', 'php', 'py', 'pyc',
+													'vb', 'bas', 'jar',
 													),
+												'*'
 												),
-				'mimeType'   =&gt; array('rule' =&gt; array('checkMimeType', false, '*')),
-				),
-			'alternative' =&gt; array(
-				'rule'       =&gt; 'checkRepresent',
-				'on'         =&gt; 'create',
-				'required'   =&gt; false,
-				'allowEmpty' =&gt; true,
-				),
-			);
-
+											),
+			'mimeType'   =&gt; array('rule' =&gt; array('checkMimeType', false, '*')),
+			),
+		'alternative' =&gt; array(
+			'rule'       =&gt; 'checkRepresent',
+			'on'         =&gt; 'create',
+			'required'   =&gt; false,
+			'allowEmpty' =&gt; true,
+		));
 /**
  * beforeMake Callback
  *
- * Called from within MediaBehavior::make
+ * Called from within `MediaBehavior::make()`
  *
  * $process an array with the following contents:
  *	overwrite - If the destination file should be overwritten if it exists
  *	directory - The destination directory (guranteed to exist)
- *  name - Medium name of $file (e.g. 'Image')
- *	version - The version requested to be processed (e.g. 'xl')
+ *  name - Medium name of $file (e.g. `'Image'`)
+ *	version - The version requested to be processed (e.g. `'xl'`)
  *	instructions - An array containing which names of methods to be called
  *
  * @param string $file Absolute path to the source file</diff>
      <filename>models/attachment.php</filename>
    </modified>
    <modified>
      <diff>@@ -56,12 +56,12 @@ class MediaBehavior extends ModelBehavior {
  * @var array
  */
 	var $_defaultSettings = array(
-			'metadataLevel'   =&gt; 1,
-			'baseDirectory'   =&gt; MEDIA,
-			'makeVersions'    =&gt; true,
-			'filterDirectory' =&gt; MEDIA_FILTER,
-			'createDirectory' =&gt; true,
-		);
+		'metadataLevel'   =&gt; 1,
+		'baseDirectory'   =&gt; MEDIA,
+		'makeVersions'    =&gt; true,
+		'filterDirectory' =&gt; MEDIA_FILTER,
+		'createDirectory' =&gt; true,
+	);
 /**
  * Holds cached metadata keyed by model alias
  *
@@ -72,11 +72,11 @@ class MediaBehavior extends ModelBehavior {
 /**
  * Setup
  *
- * @param object $model
+ * @param Model $Model
  * @param array $config See defaultSettings for configuration options
  * @return void
  */
-	function setup(&amp;$model, $config = null) {
+	function setup(&amp;$Model, $config = null) {
 		if (!is_array($config)) {
 			$config = array();
 		}
@@ -92,308 +92,327 @@ class MediaBehavior extends ModelBehavior {
 		}
 
 		/* Interact with Transfer Behavior */
-		if (isset($model-&gt;Behaviors-&gt;Transfer)) {
-			$transferSettings = $model-&gt;Behaviors-&gt;Transfer-&gt;settings[$model-&gt;alias];
+		if (isset($Model-&gt;Behaviors-&gt;Transfer)) {
+			$transferSettings = $Model-&gt;Behaviors-&gt;Transfer-&gt;settings[$Model-&gt;alias];
 			$config['baseDirectory'] = dirname($transferSettings['baseDirectory']) . DS;
 			$config['createDirectory'] = $transferSettings['createDirectory'];
 		}
 
-		$this-&gt;settings[$model-&gt;alias] = $config + $this-&gt;_defaultSettings;
-		$this-&gt;__cached[$model-&gt;alias] = Cache::read('media_metadata_' . $model-&gt;alias, '_cake_core_');
+		$this-&gt;settings[$Model-&gt;alias] = $config + $this-&gt;_defaultSettings;
+		$this-&gt;__cached[$Model-&gt;alias] = Cache::read('media_metadata_' . $Model-&gt;alias, '_cake_core_');
 	}
 /**
  * Callback
  *
- * @param object $model
+ * Requires `file` field to be present if a record is created.
+ *
+ * Handles deletion of a record and corresponding file if the `delete` field is
+ * present and has not a value of either `null` or `'0'.`
+ *
+ * Prevents `dirname`, `basename`, `checksum` and `delete` fields to be written to
+ * database.
+ *
+ * Parses contents of the `file` field if present and generates a normalized path
+ * relative to the path set in the `baseDirectory` option.
+ *
+ * @param Model $Model
  * @return boolean
  */
-	function beforeSave(&amp;$model) {
-		if (!$model-&gt;exists()) {
-			/* Clear all data if we are going to create a record and the file field is missing */
-			if (!isset($model-&gt;data[$model-&gt;alias]['file'])) {
-				unset($model-&gt;data[$model-&gt;alias]);
+	function beforeSave(&amp;$Model) {
+		if (!$Model-&gt;exists()) {
+			if (!isset($Model-&gt;data[$Model-&gt;alias]['file'])) {
+				unset($Model-&gt;data[$Model-&gt;alias]);
 				return true;
 			}
 		} else {
-			/* Handle deletion request */
-			if (isset($model-&gt;data[$model-&gt;alias]['delete']) &amp;&amp; $model-&gt;data[$model-&gt;alias]['delete'] !== '0') {
-				$model-&gt;delete();
-				unset($model-&gt;data[$model-&gt;alias]);
+			if (isset($Model-&gt;data[$Model-&gt;alias]['delete'])
+			&amp;&amp; $Model-&gt;data[$Model-&gt;alias]['delete'] !== '0') {
+				$Model-&gt;delete();
+				unset($Model-&gt;data[$Model-&gt;alias]);
 				return true;
 			}
 		}
 
-		/* Ensure that no bad fields sneaked into the to-be-saved data */
-		$blacklist = array('dirname', 'basename', 'checksum', 'delete');
-		$whitelist = array('id', 'file', 'model', 'foreign_key', 'created', 'modified', 'alternative');
+		$blacklist = array(
+			'dirname', 'basename', 'checksum', 'delete'
+		);
+		$whitelist = array(
+			'id', 'file', 'model', 'foreign_key',
+			'created', 'modified', 'alternative'
+		);
 
-		foreach ($model-&gt;data[$model-&gt;alias] as $key =&gt; $value) {
+		foreach ($Model-&gt;data[$Model-&gt;alias] as $key =&gt; $value) {
 			if (in_array($key, $whitelist)) {
-				continue(1);
+				continue;
 			}
 			if (in_array($key, $blacklist)) {
-				unset($model-&gt;data[$model-&gt;alias][$key]);
+				unset($Model-&gt;data[$Model-&gt;alias][$key]);
 			}
 		}
 
-		extract($this-&gt;settings[$model-&gt;alias]);
+		extract($this-&gt;settings[$Model-&gt;alias]);
 
-		if (isset($model-&gt;data[$model-&gt;alias]['file'])) {
-			$File = new File($model-&gt;data[$model-&gt;alias]['file']);
-			unset($model-&gt;data[$model-&gt;alias]['file']);
+		if (isset($Model-&gt;data[$Model-&gt;alias]['file'])) {
+			$File = new File($Model-&gt;data[$Model-&gt;alias]['file']);
+			unset($Model-&gt;data[$Model-&gt;alias]['file']);
 
-			/* Convert directory separators to / and remove trailing slash */
-			$dirname = substr(
-							str_replace(array($baseDirectory, DS), array(null, '/'),
-							Folder::slashTerm($File-&gt;Folder-&gt;pwd())),
-							0, -1
-							);
+			/* `baseDirectory` may equal the file's directory or use backslashes */
+			$dirname = substr(str_replace(
+				str_replace('\\', '/', $baseDirectory),
+				null,
+				str_replace('\\', '/', Folder::slashTerm($File-&gt;Folder-&gt;pwd()))
+			), 0, -1);
 
 			$result = array(
-						'checksum' =&gt; $File-&gt;md5(),
-						'dirname'  =&gt; $dirname,
-						'basename' =&gt; $File-&gt;name,
-					);
+				'checksum' =&gt; $File-&gt;md5(),
+				'dirname'  =&gt; $dirname,
+				'basename' =&gt; $File-&gt;name,
+			);
 
-			$model-&gt;data[$model-&gt;alias] = array_merge($model-&gt;data[$model-&gt;alias],$result);
+			$Model-&gt;data[$Model-&gt;alias] = array_merge($Model-&gt;data[$Model-&gt;alias], $result);
 		}
 		return true;
 	}
 /**
  * Callback
  *
- * @param object $model
- * @param bool $created
- * @return bool
+ * Triggers `make()` if both `dirname` and `basename` fields are present.
+ * Otherwise skips and returns `true` to continue the save operation.
+ *
+ * @param Model $Model
+ * @param boolean $created
+ * @return boolean
  */
-	function afterSave(&amp;$model, $created) {
-		extract($this-&gt;settings[$model-&gt;alias]);
+	function afterSave(&amp;$Model, $created) {
+		extract($this-&gt;settings[$Model-&gt;alias]);
 
 		if (!$created || !$makeVersions) {
 			return true;
 		}
-		if (!isset($model-&gt;data[$model-&gt;alias]['dirname']) || !isset($model-&gt;data[$model-&gt;alias]['basename'])) {
-			return true; /* Do not fail */
-		}
+		$item =&amp; $Model-&gt;data[$Model-&gt;alias];
 
-		return $this-&gt;make($model, $model-&gt;data[$model-&gt;alias]['dirname'] . DS . $model-&gt;data[$model-&gt;alias]['basename']);
+		if (!isset($item['dirname'], $item['basename'])) {
+			return true;
+		}
+		return $this-&gt;make($Model, $item['dirname'] . DS . $item['basename']);
 	}
 /**
- * Adds metadata of each medium to results
+ * Callback
  *
- * @param object $model
+ * Adds metadata of corresponding file to each result.
+ *
+ * If the corresponding file of a result is not readable it is removed
+ * from the results array, as it is inconsistent. This can be fixed
+ * by calling `cake media sync` from the command line.
+ *
+ * @param Model $Model
  * @param array $results
- * @param bool $primary
+ * @param boolean $primary
  * @return array
  */
-	function afterFind(&amp;$model, $results, $primary = false) {
+	function afterFind(&amp;$Model, $results, $primary = false) {
 		if (empty($results)) {
 			return $results;
 		}
-
-		extract($this-&gt;settings[$model-&gt;alias]);
+		extract($this-&gt;settings[$Model-&gt;alias]);
 
 		foreach ($results as $key =&gt; &amp;$result) {
-			if (!isset($result[$model-&gt;alias]['dirname']) || !isset($result[$model-&gt;alias]['basename'])) {
-				continue(1); /* Needed in certain situations like a pre-delete */
+			/* Needed during a pre deletion phase */
+			if (!isset($result[$Model-&gt;alias]['dirname'], $result[$Model-&gt;alias]['basename'])) {
+				continue;
 			}
+			$file = $result[$Model-&gt;alias]['dirname'] . DS . $result[$Model-&gt;alias]['basename'];
 
-			/* Retrieve metadata */
-			$metadata = $this-&gt;metadata(
-										$model,
-										$result[$model-&gt;alias]['dirname']
-										. DS . $result[$model-&gt;alias]['basename'],
-										$metadataLevel
-										);
+			$metadata = $this-&gt;metadata($Model, $file, $metadataLevel);
 
+			/* `metadata()` checks if the file is readable */
 			if ($metadata === false) {
-				/* file is not readable, which means this record is inconsitent */
 				unset($results[$key]);
-				continue(1);
+				continue;
 			}
-
-			$result[$model-&gt;alias] = array_merge($result[$model-&gt;alias], $metadata);
+			$result[$Model-&gt;alias] = array_merge($result[$Model-&gt;alias], $metadata);
 		}
-
 		return $results;
 	}
 /**
- * Deletes file corresponding to record
+ * Callback
+ *
+ * Deletes file corresponding to record as well as generated versions of that file.
  *
- * @param object $model
- * @param bool $cascade
- * @return bool
+ * If the file couldn't be deleted the callback won't stop the
+ * delete operation to continue to delete the record.
+ *
+ * @param Model $Model
+ * @param boolean $cascade
+ * @return boolean
  */
-	function beforeDelete(&amp;$model, $cascade = true) {
-		extract($this-&gt;settings[$model-&gt;alias]);
-
-		$result = $model-&gt;find(
-							'first',
-							array(
-								'conditions' =&gt; array('id' =&gt; $model-&gt;id),
-								'fields'     =&gt; array('dirname', 'basename'),
-								'recursive'  =&gt; -1,
-								)
-							);
+	function beforeDelete(&amp;$Model, $cascade = true) {
+		extract($this-&gt;settings[$Model-&gt;alias]);
+
+		$query = array(
+			'conditions' =&gt; array('id' =&gt; $Model-&gt;id),
+			'fields'     =&gt; array('dirname', 'basename'),
+			'recursive'  =&gt; -1,
+		);
+		$result = $Model-&gt;find('first', $query);
 
 		if (empty($result)) {
 			return false; /* Record did not pass verification? */
 		}
 
-		$File = new File($baseDirectory
-						 . $result[$model-&gt;alias]['dirname']
-						 . DS . $result[$model-&gt;alias]['basename']);
+		$file  = $baseDirectory;
+		$file .= $result[$Model-&gt;alias]['dirname'];
+		$file .= DS . $result[$Model-&gt;alias]['basename'];
 
+		$File = new File($file);
 		$Folder = new Folder($filterDirectory);
+
 		list($versions, ) = $Folder-&gt;ls();
 
 		foreach ($versions as $version) {
-			$Folder-&gt;cd(
-						$filterDirectory
-						. $version
-						. DS . $result[$model-&gt;alias]['dirname'] . DS
-						);
-
+			$Folder-&gt;cd($filterDirectory . $version	. DS . $result[$Model-&gt;alias]['dirname'] . DS);
 			$basenames = $Folder-&gt;find($File-&gt;name() . '\..*');
 
 			if (count($basenames) &gt; 1) {
-				trigger_error('MediaBehavior::beforeDelete - Ambiguous filename ' . $File-&gt;name() . ' in ' . $Folder-&gt;pwd() . '.', E_USER_NOTICE);
-				continue(1);
+				$message  = &quot;MediaBehavior::beforeDelete - Ambiguous filename &quot;;
+				$message .= &quot;`&quot; . $File-&gt;name() . &quot;` in `&quot; . $Folder-&gt;pwd() . &quot;`.&quot;;
+				trigger_error($message, E_USER_NOTICE);
+				continue;
 			} elseif (!isset($basenames[0])) {
-				continue(1);
+				continue;
 			}
 
 			$FilterFile = new File($Folder-&gt;pwd() . $basenames[0]);
 			$FilterFile-&gt;delete();
 		}
-
 		$File-&gt;delete();
-		return true; /* Always delete record */
+		return true;
 	}
 /**
- * Parses instruction sets and invokes Medium::make for a file
+ * Parses instruction sets and invokes `Medium::make()` for a file
  *
- * @param object $model
- * @param string $file Path to a file relative to MEDIA or an absolute path to a file
- * @return bool
+ * @param Model $Model
+ * @param string $file Path to a file relative to `baseDirectory`  or an absolute path to a file
+ * @return boolean
  */
-	function make(&amp;$model, $file, $overwrite = false) {
-		extract($this-&gt;settings[$model-&gt;alias]);
+	function make(&amp;$Model, $file, $overwrite = false) {
+		extract($this-&gt;settings[$Model-&gt;alias]);
 
-		$file = str_replace(array('/', '\\'), DS, is_file($file) ? $file : $baseDirectory . $file);
-		$File = new File($file);
+		list($file, $relativeFile) = $this-&gt;_file($Model, $file);
+
+		$relativeDirectory = DS . rtrim(dirname($relativeFile), '.');
 
-		$name = Medium::name($File-&gt;pwd());
+		$name = Medium::name($file);
 		$filter = Configure::read('Media.filter.' . strtolower($name));
-		$hasCallback = method_exists($model, 'beforeMake');
+
+		$hasCallback = method_exists($Model, 'beforeMake');
 
 		foreach ($filter as $version =&gt; $instructions) {
-			$directory = rtrim($filterDirectory . $version . DS
-								. dirname(str_replace($baseDirectory, '', $file)), '.');
+			$directory = Folder::slashTerm($filterDirectory . $version . $relativeDirectory);
 			$Folder = new Folder($directory, $createDirectory);
 
 			if (!$Folder-&gt;pwd()) {
-				trigger_error(&quot;MediaBehavior::make - Directory '{$directory}'&quot;
-								. &quot; could not be created or is not writable.&quot;
-								. &quot; Please check your permissions.&quot;,
-								E_USER_WARNING);
-				continue(1);
+				$message  = &quot;MediaBehavior::make - Directory `{$directory}` &quot;;
+				$message .= &quot;could not be created or is not writable. &quot;;
+				$message .= &quot;Please check the permissions.&quot;;
+				trigger_error($message, E_USER_WARNING);
+				continue;
 			}
 
 			if ($hasCallback) {
 				$process = compact('overwrite', 'directory', 'name', 'version', 'instructions');
 
-				if ($model-&gt;beforeMake($file, $process)) {
-					continue(1);
+				if ($Model-&gt;beforeMake($file, $process)) {
+					continue;
 				}
 			}
-			if (!$Medium = Medium::make($File-&gt;pwd(), $instructions)) {
-				trigger_error(&quot;MediaBehavior::make - Failed to make version {$version} of medium.&quot;,
-								E_USER_WARNING);
-				continue(1);
+			if (!$Medium = Medium::make($file, $instructions)) {
+				$message  = &quot;MediaBehavior::make - Failed to make version `{$version}` &quot;;
+				$message .= &quot;of file `{$file}`. &quot;;
+				trigger_error($message, E_USER_WARNING);
+				continue;
 			}
-			$Medium-&gt;store($Folder-&gt;pwd() . DS . $File-&gt;name, $overwrite);
+			$Medium-&gt;store($directory . basename($file), $overwrite);
 		}
 		return true;
 	}
+
 /**
  * Retrieve (cached) metadata of a file
  *
- * @param object $model
- * @param string $file Path to a file relative to baseDirectory or an absolute path to a file
- * @param int $level level of amount of info to add, 0 disable, 1 for basic, 2 for detailed info
+ * @param Model $Model
+ * @param string $file Path to a file relative to `baseDirectory` or an absolute path to a file
+ * @param integer $level level of amount of info to add, `0` disable, `1` for basic, `2` for detailed info
  * @return mixed Array with results or false if file is not readable
  */
-	function metadata(&amp;$model, $file, $level = 1) {
+	function metadata(&amp;$Model, $file, $level = 1) {
 		if ($level &lt; 1) {
 			return array();
 		}
-		extract($this-&gt;settings[$model-&gt;alias]);
+		extract($this-&gt;settings[$Model-&gt;alias]);
 
-		if (is_file($file)) {
-			$File = new File($file);
-		} else {
-			$File = new File($baseDirectory . $file);
-		}
-		if (!$File-&gt;exists() || !$File-&gt;readable()) {
+		list($file,) = $this-&gt;_file($Model, $file);
+		$File = new File($file);
+
+		if (!$File-&gt;readable()) {
 			return false;
 		}
 		$checksum = $File-&gt;md5();
 
-		if (isset($this-&gt;__cached[$model-&gt;alias][$checksum])) {
-			$data = $this-&gt;__cached[$model-&gt;alias][$checksum];
+		if (isset($this-&gt;__cached[$Model-&gt;alias][$checksum])) {
+			$data = $this-&gt;__cached[$Model-&gt;alias][$checksum];
 		}
 
 		if ($level &gt; 0 &amp;&amp; !isset($data[1])) {
 			$data[1] = array(
-					'size'      =&gt; $File-&gt;size(),
-					'mime_type' =&gt; MimeType::guessType($File-&gt;pwd()),
-					'checksum'  =&gt; $checksum,
-				);
+				'size'      =&gt; $File-&gt;size(),
+				'mime_type' =&gt; MimeType::guessType($File-&gt;pwd()),
+				'checksum'  =&gt; $checksum,
+			);
 		}
 		if ($level &gt; 1 &amp;&amp; !isset($data[2])) {
 			$Medium = Medium::factory($File-&gt;pwd());
 
 			if ($Medium-&gt;name === 'Audio') {
 				$data[2] = array(
-								'artist'        =&gt; $Medium-&gt;artist(),
-								'album'         =&gt; $Medium-&gt;album(),
-								'title'         =&gt; $Medium-&gt;title(),
-								'track'         =&gt; $Medium-&gt;track(),
-								'year'          =&gt; $Medium-&gt;year(),
-								'length'        =&gt; $Medium-&gt;duration(),
-								'quality'       =&gt; $Medium-&gt;quality(),
-								'sampling_rate' =&gt; $Medium-&gt;samplingRate(),
-								'bitrate'       =&gt; $Medium-&gt;bitrate(),
-								);
+					'artist'        =&gt; $Medium-&gt;artist(),
+					'album'         =&gt; $Medium-&gt;album(),
+					'title'         =&gt; $Medium-&gt;title(),
+					'track'         =&gt; $Medium-&gt;track(),
+					'year'          =&gt; $Medium-&gt;year(),
+					'length'        =&gt; $Medium-&gt;duration(),
+					'quality'       =&gt; $Medium-&gt;quality(),
+					'sampling_rate' =&gt; $Medium-&gt;samplingRate(),
+					'bitrate'       =&gt; $Medium-&gt;bitrate(),
+				);
 			} elseif ($Medium-&gt;name === 'Image') {
 				$data[2] = array(
-								'width'     =&gt; $Medium-&gt;width(),
-								'height'    =&gt; $Medium-&gt;height(),
-								'ratio'     =&gt; $Medium-&gt;ratio(),
-								'quality'   =&gt; $Medium-&gt;quality(),
-								'megapixel' =&gt; $Medium-&gt;megapixel(),
-								);
+					'width'     =&gt; $Medium-&gt;width(),
+					'height'    =&gt; $Medium-&gt;height(),
+					'ratio'     =&gt; $Medium-&gt;ratio(),
+					'quality'   =&gt; $Medium-&gt;quality(),
+					'megapixel' =&gt; $Medium-&gt;megapixel(),
+				);
 			} elseif ($Medium-&gt;name === 'Text') {
 				$data[2] = array(
-								'characters'      =&gt; $Medium-&gt;characters(),
-								'syllables'       =&gt; $Medium-&gt;syllables(),
-								'sentences'       =&gt; $Medium-&gt;sentences(),
-								'words'           =&gt; $Medium-&gt;words(),
-								'flesch_score'    =&gt; $Medium-&gt;fleschScore(),
-								'lexical_density' =&gt; $Medium-&gt;lexicalDensity(),
-								);
+					'characters'      =&gt; $Medium-&gt;characters(),
+					'syllables'       =&gt; $Medium-&gt;syllables(),
+					'sentences'       =&gt; $Medium-&gt;sentences(),
+					'words'           =&gt; $Medium-&gt;words(),
+					'flesch_score'    =&gt; $Medium-&gt;fleschScore(),
+					'lexical_density' =&gt; $Medium-&gt;lexicalDensity(),
+				);
 			} elseif ($Medium-&gt;name === 'Video') {
 				$data[2] = array(
-								'title'   =&gt; $Medium-&gt;title(),
-								'year'    =&gt; $Medium-&gt;year(),
-								'length'  =&gt; $Medium-&gt;duration(),
-								'width'   =&gt; $Medium-&gt;width(),
-								'height'  =&gt; $Medium-&gt;height(),
-								'ratio'   =&gt; $Medium-&gt;ratio(),
-								'quality' =&gt; $Medium-&gt;quality(),
-								'bitrate' =&gt; $Medium-&gt;bitrate(),
-								);
+					'title'   =&gt; $Medium-&gt;title(),
+					'year'    =&gt; $Medium-&gt;year(),
+					'length'  =&gt; $Medium-&gt;duration(),
+					'width'   =&gt; $Medium-&gt;width(),
+					'height'  =&gt; $Medium-&gt;height(),
+					'ratio'   =&gt; $Medium-&gt;ratio(),
+					'quality' =&gt; $Medium-&gt;quality(),
+					'bitrate' =&gt; $Medium-&gt;bitrate(),
+				);
 			} else {
 				$data[2] = array();
 			}
@@ -402,26 +421,41 @@ class MediaBehavior extends ModelBehavior {
 		for ($i = $level, $result = array(); $i &gt; 0; $i--) {
 			$result = array_merge($result, $data[$i]);
 		}
-		$this-&gt;__cached[$model-&gt;alias][$checksum] = $data;
+		$this-&gt;__cached[$Model-&gt;alias][$checksum] = $data;
 		return Set::filter($result);
 	}
 /**
  * Checks if an alternative text is given only if a file is submitted
  *
- * @param unknown_type $model
+ * @param unknown_type $Model
  * @param unknown_type $field
  * @return unknown
  */
-	function checkRepresent(&amp;$model, $field) {
-		if (!isset($model-&gt;data[$model-&gt;alias]['file'])) {
+	function checkRepresent(&amp;$Model, $field) {
+		if (!isset($Model-&gt;data[$Model-&gt;alias]['file'])) {
 			return true;
 		}
-		$value = current($field);
+		$value = current($field); /* empty() limitation */
 		return !empty($value);
-		if (!empty($value)) {
-			return true;
+	}
+/**
+ * Returns relative and absolute path to a file
+ *
+ * @param Model $Model
+ * @param string$file
+ * @return array
+ */
+	function _file(&amp;$Model, $file) {
+		extract($this-&gt;settings[$Model-&gt;alias]);
+
+		if (!is_file($file)) {
+			$file = ltrim($file, DS);
+			$relativeFile = $file;
+			$file = $baseDirectory . $file;
+		} else {
+			$relativeFile = str_replace($baseDirectory, null, $file);
 		}
-		return false;
+		return array($file, $relativeFile);
 	}
 }
 ?&gt;</diff>
      <filename>models/behaviors/media.php</filename>
    </modified>
    <modified>
      <diff>@@ -47,7 +47,7 @@ class TransferBehavior extends ModelBehavior {
  *
  * trustClient
  * 	false -
- * 	true  - Trust the mime type submitted together with an upload
+ * 	true  - Trust the MIME type submitted together with an upload
  *
  * destinationFile
  *  A path (withouth leading slash) relative to `baseDirectory`.
@@ -78,34 +78,34 @@ class TransferBehavior extends ModelBehavior {
  * @var array
  */
 	var $_defaultSettings = array(
-			'trustClient'     =&gt; false,
-			'destinationFile' =&gt; ':Medium.short::DS::Source.basename:',
-			'baseDirectory'   =&gt; MEDIA_TRANSFER,
-			'createDirectory' =&gt; true,
-		);
+		'trustClient'     =&gt; false,
+		'destinationFile' =&gt; ':Medium.short::DS::Source.basename:',
+		'baseDirectory'   =&gt; MEDIA_TRANSFER,
+		'createDirectory' =&gt; true,
+	);
 /**
  * Default runtime
  *
  * @var array
  */
 	var $_defaultRuntime = array(
-			'source'       =&gt; null,
-			'temporary'    =&gt; null,
-			'destination'  =&gt; null,
-			'isReady'      =&gt; false,
-			'hasPerformed' =&gt; false,
-			'markers'      =&gt; array(),
-			);
+		'source'       =&gt; null,
+		'temporary'    =&gt; null,
+		'destination'  =&gt; null,
+		'isReady'      =&gt; false,
+		'hasPerformed' =&gt; false,
+		'markers'      =&gt; array(),
+	);
 /**
  * Setup
  *
  * Merges default settings with provided config and sets default validation options
  *
- * @param object $model
+ * @param Model $Model
  * @param array $config @see _defaultSettings for configuration options
  * @return void
  */
-	function setup(&amp;$model, $config = null) {
+	function setup(&amp;$Model, $config = null) {
 		if (!is_array($config)) {
 			$config = array();
 		}
@@ -114,7 +114,7 @@ class TransferBehavior extends ModelBehavior {
 		if (isset($config['destinationFile'])
 		&amp;&amp; preg_match('/:(MEDIA|APP|TMP|WEBROOT)+/', $config['destinationFile'])) {
 			$message  = &quot;TransferBehavior::setup - &quot;;
-			$message .= &quot;The syntax of the `destinationFile` options has been changed. &quot;;
+			$message .= &quot;The syntax of the `destinationFile` option has been changed. &quot;;
 			$message .= &quot;It should hold a relative path only. &quot;;
 			$message .=  &quot;See also the `baseDirectory' option.&quot;;
 			trigger_error($message, E_USER_NOTICE);
@@ -123,165 +123,150 @@ class TransferBehavior extends ModelBehavior {
 		}
 
 		/* If present validation rules get some sane default values */
-		if (isset($model-&gt;validate['file'])) {
+		if (isset($Model-&gt;validate['file'])) {
 			$default = array('allowEmpty' =&gt; true, 'required' =&gt; false, 'last' =&gt; true);
 
-			foreach ($model-&gt;validate['file'] as &amp;$rule) {
+			foreach ($Model-&gt;validate['file'] as &amp;$rule) {
 				$rule = array_merge($default, $rule);
 			}
 		}
 
-		$this-&gt;settings[$model-&gt;alias] = $config + $this-&gt;_defaultSettings;
-		$this-&gt;runtime[$model-&gt;alias] = $this-&gt;_defaultRuntime;
+		$this-&gt;settings[$Model-&gt;alias] = $config + $this-&gt;_defaultSettings;
+		$this-&gt;runtime[$Model-&gt;alias] = $this-&gt;_defaultRuntime;
 	}
 /**
  * Run before any or if validation occurs
  *
- * @param object $model
- * @return bool true
+ * Triggers `prepare()` setting source, temporary and destination to
+ * enable validation rules to check the transfer. If that fails
+ * invalidates the model.
+ *
+ * @param Model $Model
+ * @return boolean
  */
-	function beforeValidate(&amp;$model) {
-		/*
-		 * Try to set source(,temporary) and destination
-		 * enabling validation rules to check transfer
-		 */
-		if ($this-&gt;prepare($model) === false) {
-			$model-&gt;invalidate('file', 'error'); // preparation error
+	function beforeValidate(&amp;$Model) {
+		if ($this-&gt;prepare($Model) === false) {
+			$Model-&gt;invalidate('file', 'error');
 			return false;
 		}
-
-		// ...
-
 		return true;
 	}
 /**
- * Triggers beforeEnter, performs transfer
+ * Triggers `prepare()` and performs transfer
+ *
+ * If transfer is unsuccessful save operation will abort.
  *
- * @param object $model
- * @return bool
+ * @param Model $Model
+ * @return boolean
  */
-	function beforeSave(&amp;$model) {
-		$preparation = $this-&gt;prepare($model);
+	function beforeSave(&amp;$Model) {
+		$preparation = $this-&gt;prepare($Model);
 
 		if ($preparation === false) {
-			/* Malformed-nonblank resource or other error: Implies not ready */
-			/* Failing hard here can be circumvented by using provided validations */
 			return false;
 		}
 		if ($preparation === null) {
-			/* Blank resource or file field not present: Nothing to transfer */
-			if (array_key_exists('file', $model-&gt;data[$model-&gt;alias])) {
-				unset($model-&gt;data[$model-&gt;alias]['file']);
+			if (array_key_exists('file', $Model-&gt;data[$Model-&gt;alias])) {
+				unset($Model-&gt;data[$Model-&gt;alias]['file']);
 			}
  			return true;
 		}
+		extract($this-&gt;runtime[$Model-&gt;alias], EXTR_SKIP);
+		extract($this-&gt;settings[$Model-&gt;alias], EXTR_SKIP);
 
-		extract($this-&gt;runtime[$model-&gt;alias], EXTR_SKIP);
-		extract($this-&gt;settings[$model-&gt;alias], EXTR_SKIP);
-
-		/*
-		 * Transfer is finally launched here because this way
-		 * we're sure that we don't create a zombie record on failure
-		 */
-		if (!$this-&gt;perform($model)) { /* uses source, etc. from runtime */
+		if (!$this-&gt;perform($Model)) { /* uses source, etc. from runtime */
 			return false;
 		}
-
-		$model-&gt;data[$model-&gt;alias]['file'] = $destination['dirname'] . DS . $destination['basename'];
-
-		return $model-&gt;data[$model-&gt;alias];
+		$Model-&gt;data[$Model-&gt;alias]['file'] = $destination['dirname'] . DS . $destination['basename'];
+		return $Model-&gt;data[$Model-&gt;alias];
 	}
 /**
- * Triggered before beforeValidation and before beforeSave or upon user request
+ * Triggered by `beforeValidate`, `beforeSave` or upon user request
  *
- * Prepares runtime for being used by the execute method
+ * Prepares runtime for being used by `perform()`
  *
- * @param object $model
+ * @param Model $Model
  * @param string $file Optionally provide a valid transfer resource to be used as source
  * @return mixed true if transfer is ready to be performed, false on error, null if no data was found
  */
-	function prepare(&amp;$model, $file = null) {
-		if (isset($model-&gt;data[$model-&gt;alias]['file'])) {
-			$file = $model-&gt;data[$model-&gt;alias]['file'];
+	function prepare(&amp;$Model, $file = null) {
+		if (isset($Model-&gt;data[$Model-&gt;alias]['file'])) {
+			$file = $Model-&gt;data[$Model-&gt;alias]['file'];
 		}
 		if (empty($file)) {
 			return null;
 		}
-		if ($this-&gt;runtime[$model-&gt;alias]['hasPerformed']) {
-			$this-&gt;reset($model);
+		if ($this-&gt;runtime[$Model-&gt;alias]['hasPerformed']) {
+			$this-&gt;reset($Model);
 		}
-		if ($this-&gt;runtime[$model-&gt;alias]['isReady']) {
+		if ($this-&gt;runtime[$Model-&gt;alias]['isReady']) {
 			return true;
 		}
-		/* Extract runtime after reset to get default values */
-		extract($this-&gt;settings[$model-&gt;alias], EXTR_SKIP);
-		extract($this-&gt;runtime[$model-&gt;alias], EXTR_SKIP);
+		/* Extraction must happen after reset */
+		extract($this-&gt;settings[$Model-&gt;alias], EXTR_SKIP);
+		extract($this-&gt;runtime[$Model-&gt;alias], EXTR_SKIP);
 
 		if (TransferValidation::blank($file)) {
 			/* Set explicitly null enabling allowEmpty in rules act upon emptiness */
-			return $model-&gt;data[$model-&gt;alias]['file'] = null;
+			return $Model-&gt;data[$Model-&gt;alias]['file'] = null;
 		}
 
-		if ($source = $this-&gt;_source($model, $file)) {
-			$this-&gt;runtime[$model-&gt;alias]['source'] = $source;
+		if ($source = $this-&gt;_source($Model, $file)) {
+			$this-&gt;runtime[$Model-&gt;alias]['source'] = $source;
 		} else {
 			return false;
 		}
+		/* Temporary is optional and can fail */
 		if ($source['type'] !== 'file-local') {
-			/* Temporary is allowed to fail silently */
-			$temporary = $this-&gt;runtime[$model-&gt;alias]['temporary'] = $this-&gt;_temporary($model, $file);
+			$temporary = $this-&gt;runtime[$Model-&gt;alias]['temporary'] = $this-&gt;_temporary($Model, $file);
 		}
 
-		/*
-		 * Fill Markers to enable substitution in destinationFile
-		 * Add more markers here if you need them in your path
-		 */
-		$this-&gt;_addMarker($model, 'DS', DS);
+		$this-&gt;_addMarker($Model, 'DS', DS);
 
-		$this-&gt;_addMarker($model, 'uuid', String::uuid());
-		$this-&gt;_addMarker($model, 'unixTimestamp', time());
-		$this-&gt;_addMarker($model, 'year', date('Y'));
-		$this-&gt;_addMarker($model, 'month', date('m'));
-		$this-&gt;_addMarker($model, 'day', date('d'));
+		$this-&gt;_addMarker($Model, 'uuid', String::uuid());
+		$this-&gt;_addMarker($Model, 'unixTimestamp', time());
+		$this-&gt;_addMarker($Model, 'year', date('Y'));
+		$this-&gt;_addMarker($Model, 'month', date('m'));
+		$this-&gt;_addMarker($Model, 'day', date('d'));
 
-		$filename = $this-&gt;_addMarker($model, 'Source.filename', $source['filename'], true);
-		$extension = $this-&gt;_addMarker($model, 'Source.extension', $source['extension'], true);
-		$this-&gt;_addMarker($model, 'Source.basename', empty($extension) ? $filename : $filename . '.' . $extension);
-		$this-&gt;_addMarker($model, 'Source.mimeType', $source['mimeType'], true);
-		$this-&gt;_addMarker($model, 'Source.type', $source['type']);
+		$filename = $this-&gt;_addMarker($Model, 'Source.filename', $source['filename'], true);
+		$extension = $this-&gt;_addMarker($Model, 'Source.extension', $source['extension'], true);
+		$this-&gt;_addMarker($Model, 'Source.basename', empty($extension) ? $filename : $filename . '.' . $extension);
+		$this-&gt;_addMarker($Model, 'Source.mimeType', $source['mimeType'], true);
+		$this-&gt;_addMarker($Model, 'Source.type', $source['type']);
 
-		/* Figure out medium type and map it */
-		$this-&gt;_addMarker($model, 'Medium.name', strtolower(Medium::name($source['file'], $source['mimeType'])));
-		$this-&gt;_addMarker($model, 'Medium.short', Medium::short($source['file'], $source['mimeType']));
+		$this-&gt;_addMarker($Model, 'Medium.name', strtolower(Medium::name($source['file'], $source['mimeType'])));
+		$this-&gt;_addMarker($Model, 'Medium.short', Medium::short($source['file'], $source['mimeType']));
 
-		if (isset($model-&gt;data[$model-&gt;alias])) { /* Needed for tableless Models */
-			$this-&gt;_addMarker($model, $model-&gt;alias . '.', $model-&gt;data[$model-&gt;alias], true);
-			$this-&gt;_addMarker($model, 'Model.', $model-&gt;data[$model-&gt;alias], true);
+		/* Needed for tableless Models */
+		if (isset($Model-&gt;data[$Model-&gt;alias])) {
+			$this-&gt;_addMarker($Model, $Model-&gt;alias . '.', $Model-&gt;data[$Model-&gt;alias], true);
+			$this-&gt;_addMarker($Model, 'Model.', $Model-&gt;data[$Model-&gt;alias], true);
 		}
-		$this-&gt;_addMarker($model, 'Model.name', $model-&gt;name);
-		$this-&gt;_addMarker($model, 'Model.alias', $model-&gt;alias);
+		$this-&gt;_addMarker($Model, 'Model.name', $Model-&gt;name);
+		$this-&gt;_addMarker($Model, 'Model.alias', $Model-&gt;alias);
 
-		/* Destination */
-		$file = $baseDirectory . $this-&gt;_replaceMarker($model, $destinationFile);
+		$file = $baseDirectory . $this-&gt;_replaceMarker($Model, $destinationFile);
 
-		if ($destination = $this-&gt;_destination($model, $file)) {
-			$this-&gt;runtime[$model-&gt;alias]['destination'] = $destination;
+		if ($destination = $this-&gt;_destination($Model, $file)) {
+			$this-&gt;runtime[$Model-&gt;alias]['destination'] = $destination;
 		} else {
 			return false;
 		}
 
-		/* Do error checks */
 		if ($source == $destination || $temporary == $destination) {
 			return false;
 		}
 
 		$Folder = new Folder($destination['dirname'], $createDirectory);
+
 		if (!$Folder-&gt;pwd()) {
-			trigger_error('TransferBehavior::prepare - Directory \'' . $destination['dirname'] . '\' could not be created or is not writable. Please check your permissions.', E_USER_WARNING);
+			$message  = &quot;TransferBehavior::prepare - Directory `{$destination['dirname']}` could &quot;;
+			$message .= &quot;not be created or is not writable. Please check the permissions.&quot;;
+			trigger_error($message, E_USER_WARNING);
 			return false;
 		}
-
-		return $this-&gt;runtime[$model-&gt;alias]['isReady'] = true; /* Ready ! */
+		return $this-&gt;runtime[$Model-&gt;alias]['isReady'] = true;
 	}
 /**
  * Parse data to be used as source
@@ -290,13 +275,13 @@ class TransferBehavior extends ModelBehavior {
  * @return mixed Array with parsed results on success, false on error
  * @todo evaluate errors in file uploads
  */
-	function _source(&amp;$model, $data) {
+	function _source(&amp;$Model, $data) {
 		if (TransferValidation::fileUpload($data)) {
-			return array_merge($this-&gt;info($model, $data), array('error' =&gt; $data['error']));
+			return array_merge($this-&gt;info($Model, $data), array('error' =&gt; $data['error']));
 		} elseif (MediaValidation::file($data)) {
-			return $this-&gt;info($model, $data);
+			return $this-&gt;info($Model, $data);
 		} elseif (TransferValidation::url($data, array('scheme' =&gt; 'http'))) {
-			return $this-&gt;info($model, $data);
+			return $this-&gt;info($Model, $data);
 		}
 		return false;
 	}
@@ -306,11 +291,15 @@ class TransferBehavior extends ModelBehavior {
  * @param mixed Path to file in local FS or file-upload array
  * @return mixed Array with parsed results on success, false on error
  */
-	function _temporary(&amp;$model, $data) {
-		if (TransferValidation::fileUpload($data) &amp;&amp; TransferValidation::uploadedFile($data['tmp_name'])) {
-			return array_merge($this-&gt;info($model, $data['tmp_name']), array('error' =&gt; $data['error']));
+	function _temporary(&amp;$Model, $data) {
+		if (TransferValidation::fileUpload($data)
+		&amp;&amp; TransferValidation::uploadedFile($data['tmp_name'])) {
+			return array_merge(
+				$this-&gt;info($Model, $data['tmp_name']),
+				array('error' =&gt; $data['error'])
+			);
 		} elseif (MediaValidation::file($data)) {
-			return $this-&gt;info($model, $data);
+			return $this-&gt;info($Model, $data);
 		}
 		return false;
 	}
@@ -320,41 +309,45 @@ class TransferBehavior extends ModelBehavior {
  * @param mixed Path to file in local FS
  * @return mixed Array with parsed results on success, false on error
  */
-	function _destination(&amp;$model, $data) {
-		if (MediaValidation::file($data , false)) { /* Destination file may not exist yet */
+	function _destination(&amp;$Model, $data) {
+		/* Destination file may not exist yet */
+		if (MediaValidation::file($data , false)) {
 			if (!$data = $this-&gt;_alternativeFile($data)) {
-				$this-&gt;log('TransferBehavior::_destination - Exceeded # of max. tries while finding alt. name for \'' . basename($data) . '\'');
+				$message  = &quot;TransferBehavior::_destination - &quot;;
+				$message .= &quot;Exceeded number of max. tries while finding alt. name &quot;;
+				$message .= &quot;for `&quot; . basename($data) . &quot;`&quot;;
+				trigger_error($message, E_USER_NOTICE);
 				return false;
 			}
-			return $this-&gt;info($model, $data);
+			return $this-&gt;info($Model, $data);
 		}
 		return false;
 	}
 /**
  * Performs a transfer
  *
- * @param object $model
+ * @param Model $Model
  * @param array $source
  * @param array $temporary
  * @param array $destination
- * @return bool true on success, false on failure
+ * @return boolean true on success, false on failure
  */
-	function perform(&amp;$model) {
-		$source      = $this-&gt;runtime[$model-&gt;alias]['source'];
-		$temporary   = $this-&gt;runtime[$model-&gt;alias]['temporary'];
-		$destination = $this-&gt;runtime[$model-&gt;alias]['destination'];
+	function perform(&amp;$Model) {
+		$source      = $this-&gt;runtime[$Model-&gt;alias]['source'];
+		$temporary   = $this-&gt;runtime[$Model-&gt;alias]['temporary'];
+		$destination = $this-&gt;runtime[$Model-&gt;alias]['destination'];
 
 		$typeChain = implode('&gt;&gt;', array($source['type'], $temporary['type'], $destination['type']));
 		$fileChain = implode('&gt;&gt;', array($source['file'], $temporary['file'], $destination['file']));
 
 		if ($typeChain === 'file-upload-remote&gt;&gt;uploaded-file-local&gt;&gt;file-local') {
-			return $this-&gt;runtime[$model-&gt;alias]['hasPerformed'] = move_uploaded_file($temporary['file'], $destination['file']);
+			return $this-&gt;runtime[$Model-&gt;alias]['hasPerformed'] = move_uploaded_file($temporary['file'], $destination['file']);
 		}
 		if ($typeChain === 'file-local&gt;&gt;&gt;&gt;file-local') {
-			return $this-&gt;runtime[$model-&gt;alias]['hasPerformed'] = copy($source['file'], $destination['file']);
+			return $this-&gt;runtime[$Model-&gt;alias]['hasPerformed'] = copy($source['file'], $destination['file']);
 		}
 		if ($typeChain === 'file-local&gt;&gt;file-local&gt;&gt;file-local') {
-			return $this-&gt;runtime[$model-&gt;alias]['hasPerformed'] = copy($source['file'], $temporary['file']) &amp;&amp; rename($temporary['file'], $destination['file']);
+			return $this-&gt;runtime[$Model-&gt;alias]['hasPerformed'] = copy($source['file'], $temporary['file']) &amp;&amp; rename($temporary['file'], $destination['file']);
 		}
 		if ($source['type'] === 'http-url-remote') {
 			if(!class_exists('HttpSocket')) {
@@ -365,39 +358,39 @@ class TransferBehavior extends ModelBehavior {
 			$Socket-&gt;request(array('method' =&gt; 'GET', 'uri' =&gt; $source['file']));
 
 			if (!empty($Socket-&gt;error) || $Socket-&gt;response['status']['code'] != 200) {
-				return $this-&gt;runtime[$model-&gt;alias]['hasPerformed'] = false;
+				return $this-&gt;runtime[$Model-&gt;alias]['hasPerformed'] = false;
 			}
 		}
 		if ($typeChain === 'http-url-remote&gt;&gt;&gt;&gt;file-local') {
-			return $this-&gt;runtime[$model-&gt;alias]['hasPerformed'] = file_put_contents($destination['file'], $Socket-&gt;response['body']);
+			return $this-&gt;runtime[$Model-&gt;alias]['hasPerformed'] = file_put_contents($destination['file'], $Socket-&gt;response['body']);
 		}
 		if($typeChain === 'http-url-remote&gt;&gt;file-local&gt;&gt;file-local') {
-			return $this-&gt;runtime[$model-&gt;alias]['hasPerformed'] = file_put_contents($temporary['file'], $Socket-&gt;response['body']) &amp;&amp; rename($temporary['file'], $destination['file']);
+			return $this-&gt;runtime[$Model-&gt;alias]['hasPerformed'] = file_put_contents($temporary['file'], $Socket-&gt;response['body']) &amp;&amp; rename($temporary['file'], $destination['file']);
 		}
-		return $this-&gt;runtime[$model-&gt;alias]['hasPerformed'] = false;
+		return $this-&gt;runtime[$Model-&gt;alias]['hasPerformed'] = false;
 	}
 /**
  * Resets runtime property
  *
- * @param object $model
+ * @param Model $Model
  * @return void
  */
-	function reset(&amp;$model) {
-		$this-&gt;runtime[$model-&gt;alias]['source']       = null;
-		$this-&gt;runtime[$model-&gt;alias]['temporary']    = null;
-		$this-&gt;runtime[$model-&gt;alias]['destination']  = null;
-		$this-&gt;runtime[$model-&gt;alias]['isReady']      = false;
-		$this-&gt;runtime[$model-&gt;alias]['hasPerformed'] = false;
-		$this-&gt;runtime[$model-&gt;alias]['markers']      = array();
+	function reset(&amp;$Model) {
+		$this-&gt;runtime[$Model-&gt;alias]['source']       = null;
+		$this-&gt;runtime[$Model-&gt;alias]['temporary']    = null;
+		$this-&gt;runtime[$Model-&gt;alias]['destination']  = null;
+		$this-&gt;runtime[$Model-&gt;alias]['isReady']      = false;
+		$this-&gt;runtime[$Model-&gt;alias]['hasPerformed'] = false;
+		$this-&gt;runtime[$Model-&gt;alias]['markers']      = array();
 	}
 /**
  * Convenience method which (if available) returns absolute path to last transferred file
  *
- * @param object $model
+ * @param Model $Model
  * @return mixed
  */
-	function getLastTransferredFile(&amp;$model) {
-		extract($this-&gt;runtime[$model-&gt;alias], EXTR_SKIP);
+	function getLastTransferredFile(&amp;$Model) {
+		extract($this-&gt;runtime[$Model-&gt;alias], EXTR_SKIP);
 
 		if ($hasPerformed) {
 			return $destination['file'];
@@ -409,23 +402,23 @@ class TransferBehavior extends ModelBehavior {
  *
  * @see TransferBehavior::source
  *
- * @param object $model
+ * @param Model $Model
  * @param array $field
- * @return bool
+ * @return boolean
  */
-	function checkResource(&amp;$model, $field) {
+	function checkResource(&amp;$Model, $field) {
 		return TransferValidation::resource(current($field));
 	}
 /**
  * Checks if sufficient permissions are set to access the resource
  * Source must be readable, temporary read or writable, destination writable
  *
- * @param object $model
+ * @param Model $Model
  * @param array $field
- * @return bool
+ * @return boolean
  */
-	function checkAccess(&amp;$model, $field) {
-		extract($this-&gt;runtime[$model-&gt;alias]);
+	function checkAccess(&amp;$Model, $field) {
+		extract($this-&gt;runtime[$Model-&gt;alias]);
 
 		if (MediaValidation::file($source['file'], true)) {
 			if (!MediaValidation::access($source['file'], 'r')) {
@@ -436,7 +429,6 @@ class TransferBehavior extends ModelBehavior {
 				return false;
 			}
 		}
-
 		if (!empty($temporary)) {
 			if (MediaValidation::file($temporary['file'], true)) {
 				if (!MediaValidation::access($temporary['file'], 'r')) {
@@ -448,7 +440,6 @@ class TransferBehavior extends ModelBehavior {
 				}
 			}
 		}
-
 		if (!MediaValidation::access($destination['dirname'], 'w')) {
 			return false;
 		}
@@ -457,21 +448,21 @@ class TransferBehavior extends ModelBehavior {
 /**
  * Checks if resource is located within given locations
  *
- * @param object $model
+ * @param Model $Model
  * @param array $field
  * @param mixed $allow True or * allows any location, an array containing absolute paths to locations
- * @return bool
+ * @return boolean
  */
-	function checkLocation(&amp;$model, $field, $allow = true) {
-		extract($this-&gt;runtime[$model-&gt;alias]);
-		$allow = $this-&gt;_replaceMarker($model, $allow);
+	function checkLocation(&amp;$Model, $field, $allow = true) {
+		extract($this-&gt;runtime[$Model-&gt;alias]);
+		$allow = $this-&gt;_replaceMarker($Model, $allow);
 
 		foreach (array('source', 'temporary', 'destination') as $type) {
 			if ($type == 'temporary' &amp;&amp; empty($$type)) {
-				continue(1);
+				continue;
 			}
 			if ($type == 'source' &amp;&amp; ${$type}['type'] == 'file-upload-remote') {
-				continue(1);
+				continue;
 			}
 			if (!MediaValidation::location(${$type}['file'], $allow)) {
 				return false;
@@ -482,17 +473,19 @@ class TransferBehavior extends ModelBehavior {
 /**
  * Checks if provided or potentially dangerous permissions are set
  *
- * @param object $model
+ * @param Model $Model
  * @param array $field
- * @param mixed $match True to check for potentially dangerous permissions, a string containing the 4-digit octal value of the permissions to check for an exact match, false to allow any permissions
- * @return bool
+ * @param mixed $match True to check for potentially dangerous permissions,
+ * 	a string containing the 4-digit octal value of the permissions to check for an exact match,
+ * 	false to allow any permissions
+ * @return boolean
  */
-	function checkPermission(&amp;$model, $field, $match = true) {
-		extract($this-&gt;runtime[$model-&gt;alias]);
+	function checkPermission(&amp;$Model, $field, $match = true) {
+		extract($this-&gt;runtime[$Model-&gt;alias]);
 
 		foreach (array('source', 'temporary') as $type) {
 			if ($type == 'temporary' &amp;&amp; empty($$type)) {
-				continue(1);
+				continue;
 			}
 			if (!MediaValidation::permission(${$type}['permission'], $match)) {
 				return false;
@@ -504,20 +497,20 @@ class TransferBehavior extends ModelBehavior {
  * Checks if resource doesn't exceed provided size
  *
  * Please note that the size will always be checked against
- * limitations set in php.ini for post_max_size and upload_max_filesize
- * even if $max is set to false
+ * limitations set in `php.ini` for `post_max_size` and `upload_max_filesize`
+ * even if $max is set to false.
  *
- * @param object $model
+ * @param Model $Model
  * @param array $field
  * @param mixed $max String (e.g. 8M) containing maximum allowed size, false allows any size
- * @return bool
+ * @return boolean
  */
-	function checkSize(&amp;$model, $field, $max = false) {
-		extract($this-&gt;runtime[$model-&gt;alias]);
+	function checkSize(&amp;$Model, $field, $max = false) {
+		extract($this-&gt;runtime[$Model-&gt;alias]);
 
 		foreach (array('source', 'temporary') as $type) {
 			if ($type == 'temporary' &amp;&amp; empty($$type)) {
-				continue(1);
+				continue;
 			}
 			if (!MediaValidation::size(${$type}['size'], $max)) {
 				return false;
@@ -532,17 +525,17 @@ class TransferBehavior extends ModelBehavior {
  * the image gets resized later. You can calculate the amount of memory used
  * like this: width * height * 4 + overhead
  *
- * @param object $model
+ * @param Model $Model
  * @param array $field
  * @param mixed $max String (e.g. 40000 or 200x100) containing maximum allowed amount of pixels
- * @return bool
+ * @return boolean
  */
-	function checkPixels(&amp;$model, $field, $max = false) {
-		extract($this-&gt;runtime[$model-&gt;alias]);
+	function checkPixels(&amp;$Model, $field, $max = false) {
+		extract($this-&gt;runtime[$Model-&gt;alias]);
 
 		foreach (array('source', 'temporary') as $type) { /* pixels value is optional */
 			if(($type == 'temporary' &amp;&amp; empty($$type)) || !isset(${$type}['pixels'])) {
-				continue(1);
+				continue;
 			}
 			if(!MediaValidation::pixels(${$type}['pixels'], $max)) {
 				return false;
@@ -553,18 +546,22 @@ class TransferBehavior extends ModelBehavior {
 /**
  * Checks if resource has (not) one of given extensions
  *
- * @param object $model
+ * @param Model $Model
  * @param array $field
- * @param mixed $deny True or * blocks any extension, an array containing extensions (w/o leading dot) selectively blocks, false blocks no extension
- * @param mixed $allow True or * allows any extension, an array containing extensions (w/o leading dot) selectively allows, false allows no extension
- * @return bool
+ * @param mixed $deny True or * blocks any extension,
+ * 	an array containing extensions (w/o leading dot) selectively blocks,
+ * 	false blocks no extension
+ * @param mixed $allow True or * allows any extension,
+ * 	an array containing extensions (w/o leading dot) selectively allows,
+ * 	false allows no extension
+ * @return boolean
  */
-	function checkExtension(&amp;$model, $field, $deny = false, $allow = true) {
-		extract($this-&gt;runtime[$model-&gt;alias]);
+	function checkExtension(&amp;$Model, $field, $deny = false, $allow = true) {
+		extract($this-&gt;runtime[$Model-&gt;alias]);
 
 		foreach (array('source', 'temporary', 'destination') as $type) {
 			if (($type == 'temporary' &amp;&amp; empty($$type)) || !isset(${$type}['extension'])) {
-				continue(1);
+				continue;
 			}
 			if (!MediaValidation::extension(${$type}['extension'], $deny, $allow)) {
 				return false;
@@ -573,17 +570,21 @@ class TransferBehavior extends ModelBehavior {
 		return true;
 	}
 /**
- * Checks if resource has (not) one of given mime types
+ * Checks if resource has (not) one of given MIME types
  *
- * @param object $model
+ * @param Model $Model
  * @param array $field
- * @param mixed $deny True or * blocks any mime type, an array containing mime types selectively blocks, false blocks no mime type
- * @param mixed $allow True or * allows any extension, an array containing extensions selectively allows, false allows no mime type
- * @return bool
+ * @param mixed $deny True or * blocks any MIME type,
+ * 	an array containing MIME types selectively blocks,
+ * 	false blocks no MIME type
+ * @param mixed $allow True or * allows any extension,
+ * 	an array containing extensions selectively allows,
+ * 	false allows no MIME type
+ * @return boolean
  */
-	function checkMimeType(&amp;$model, $field, $deny = false, $allow = true) {
-		extract($this-&gt;runtime[$model-&gt;alias]);
-		extract($this-&gt;settings[$model-&gt;alias], EXTR_SKIP);
+	function checkMimeType(&amp;$Model, $field, $deny = false, $allow = true) {
+		extract($this-&gt;runtime[$Model-&gt;alias]);
+		extract($this-&gt;settings[$Model-&gt;alias], EXTR_SKIP);
 
 		foreach (array('source', 'temporary') as $type) {
 			/*
@@ -595,11 +596,13 @@ class TransferBehavior extends ModelBehavior {
 			 * ------|----------|----------------------------
 			 * false | x/x,null | x/x,null    | null
 			 */
+			/* Temporary is optional */
 			if ($type === 'temporary' &amp;&amp; empty($$type)) {
-				continue(1); // some transfers dont use a temporary
+				continue;
 			}
+			/* With `trustClient` set to `false` we don't necessarily have a MIME type */
 			if (!isset(${$type}['mimeType']) &amp;&amp; !$trustClient) {
-				continue(1); // with trustClient set to false we don't necessarily have a MIME type
+				continue;
 			}
 			if (!MediaValidation::mimeType(${$type}['mimeType'], $deny, $allow)) {
 				return false;
@@ -611,42 +614,41 @@ class TransferBehavior extends ModelBehavior {
  * Gather/Return information about a resource
  *
  * @param mixed $resource Path to file in local FS, URL or file-upload array
- * @param string $what scheme,host,port,file,mime type,size,permission,dirname,basename,filename,extension or type
+ * @param string $what scheme, host, port, file, MIME type, size, permission,
+ * 	dirname, basename, filename, extension or type
  * @return mixed
  */
-	function info(&amp;$model, $resource, $what = null) {
-		extract($this-&gt;settings[$model-&gt;alias], EXTR_SKIP);
+	function info(&amp;$Model, $resource, $what = null) {
+		extract($this-&gt;settings[$Model-&gt;alias], EXTR_SKIP);
 
 		$defaultResource = array(
-							'scheme'      =&gt; null,
-							'host'        =&gt; null,
-							'port'        =&gt; null,
-							'file'        =&gt; null,
-							'mimeType'    =&gt; null,
-							'size'        =&gt; null,
-							'pixels'      =&gt; null,
-							'permisssion' =&gt; null,
-							'dirname'     =&gt; null,
-							'basename'    =&gt; null,
-							'filename'    =&gt; null,
-							'extension'   =&gt; null,
-							'type'        =&gt; null,
-							);
-
-		/* HTTP Url */
-		/* Currently http is supported only */
+			'scheme'      =&gt; null,
+			'host'        =&gt; null,
+			'port'        =&gt; null,
+			'file'        =&gt; null,
+			'mimeType'    =&gt; null,
+			'size'        =&gt; null,
+			'pixels'      =&gt; null,
+			'permisssion' =&gt; null,
+			'dirname'     =&gt; null,
+			'basename'    =&gt; null,
+			'filename'    =&gt; null,
+			'extension'   =&gt; null,
+			'type'        =&gt; null,
+		);
+
+		/* Currently HTTP is supported only */
 		if (TransferValidation::url($resource, array('scheme' =&gt; 'http'))) {
 			$resource = array_merge(
-							$defaultResource,
-							pathinfo(parse_url($resource, PHP_URL_PATH)),
-							array(
-								'scheme' =&gt; parse_url($resource, PHP_URL_SCHEME),
-								'host'   =&gt; parse_url($resource, PHP_URL_HOST),
-								'port'   =&gt; parse_url($resource, PHP_URL_PORT),
-								'file'   =&gt; $resource,
-								'type'   =&gt; 'http-url-remote',
-								)
-							);
+				$defaultResource,
+				pathinfo(parse_url($resource, PHP_URL_PATH)),
+				array(
+					'scheme' =&gt; parse_url($resource, PHP_URL_SCHEME),
+					'host'   =&gt; parse_url($resource, PHP_URL_HOST),
+					'port'   =&gt; parse_url($resource, PHP_URL_PORT),
+					'file'   =&gt; $resource,
+					'type'   =&gt; 'http-url-remote',
+			));
 
 			if (!class_exists('HttpSocket')) {
 				App::import('Core', 'HttpSocket');
@@ -656,26 +658,22 @@ class TransferBehavior extends ModelBehavior {
 
 			if (empty($Socket-&gt;error) &amp;&amp; $Socket-&gt;response['status']['code'] == 200) {
 				$resource = array_merge(
-								$resource,
-								array(
-									'size'       =&gt; $Socket-&gt;response['header']['Content-Length'],
-									'mimeType'   =&gt; $trustClient ? $Socket-&gt;response['header']['Content-Type'] : null,
-									'permission' =&gt; '0004'
-									)
-								);
+					$resource,
+					array(
+						'size'       =&gt; $Socket-&gt;response['header']['Content-Length'],
+						'mimeType'   =&gt; $trustClient ? $Socket-&gt;response['header']['Content-Type'] : null,
+						'permission' =&gt; '0004'
+				));
 			}
-
-		/* File */
 		} elseif (MediaValidation::file($resource, false)) {
 			$resource = array_merge(
-							$defaultResource,
-							pathinfo($resource),
-							array(
-								'file' =&gt; $resource,
-								'host' =&gt; 'localhost',
-								'mimeType'   =&gt; MimeType::guessType($resource, array('paranoid' =&gt; !$trustClient)),
-								)
-							);
+				$defaultResource,
+				pathinfo($resource),
+				array(
+					'file' =&gt; $resource,
+					'host' =&gt; 'localhost',
+					'mimeType'   =&gt; MimeType::guessType($resource, array('paranoid' =&gt; !$trustClient)),
+			));
 
 			if (TransferValidation::uploadedFile($resource['file'])) {
 				$resource['type'] = 'uploaded-file-local';
@@ -685,36 +683,31 @@ class TransferBehavior extends ModelBehavior {
 
 			if (is_readable($resource['file'])) {
 				/*
-				 * Because there is not good way to determine if resource is an image
+				 * Because there is not better  way to determine if resource is an image
 				 * first, we suppress a warning that would be thrown here otherwise.
 				 */
 				list($width, $height) = @getimagesize($resource['file']);
 
 				$resource = array_merge(
-								$resource,
-								array(
-									'size'       =&gt; filesize($resource['file']),
-									'permission' =&gt; substr(sprintf('%o', fileperms($resource['file'])), -4),
-									'pixels'     =&gt; $width * $height,
-									)
-								);
+					$resource,
+					array(
+						'size'       =&gt; filesize($resource['file']),
+						'permission' =&gt; substr(sprintf('%o', fileperms($resource['file'])), -4),
+						'pixels'     =&gt; $width * $height,
+				));
 			}
-
-		/* File Upload */
 		} elseif (TransferValidation::fileUpload($resource)) {
 			$resource = array_merge(
-							$defaultResource,
-							pathinfo($resource['name']),
-							array(
-								'file'       =&gt; $resource['name'],
-								'host'       =&gt; env('REMOTE_ADDR'),
-								'size'       =&gt; $resource['size'],
-								'mimeType'   =&gt; $trustClient ? $resource['type'] : null,
-								'permission' =&gt; '0004',
-								'type'       =&gt; 'file-upload-remote',
-								)
-							);
-
+				$defaultResource,
+				pathinfo($resource['name']),
+				array(
+					'file'       =&gt; $resource['name'],
+					'host'       =&gt; env('REMOTE_ADDR'),
+					'size'       =&gt; $resource['size'],
+					'mimeType'   =&gt; $trustClient ? $resource['type'] : null,
+					'permission' =&gt; '0004',
+					'type'       =&gt; 'file-upload-remote',
+			));
 		} else {
 			return null;
 		}
@@ -730,11 +723,12 @@ class TransferBehavior extends ModelBehavior {
  * Finds an alternative filename for an already existing file
  *
  * @param string $file Absolute path to file in local FS
- * @param int $tries Number of tries
+ * @param integer $tries Number of tries
  * @return mixed A string if an alt. name was found, false if number of tries were exceeded
  */
 	function _alternativeFile($file, $tries = 100) {
 		extract(pathinfo($file), EXTR_SKIP);
+
 		$newFilename = $filename;
 
 		$Folder = new Folder($dirname);
@@ -759,17 +753,17 @@ class TransferBehavior extends ModelBehavior {
 /**
  * Adds and/or overwrites marker(s)/replacement(s)
  *
- * @param object $model
+ * @param Model $Model
  * @param string $marker The name of the marker, or the prefix for mapped markers
  * @param string $replacement  String or an array mapping markers to replacements
  */
-	function _addMarker(&amp;$model, $marker, $replacement = null, $slugify = false) {
+	function _addMarker(&amp;$Model, $marker, $replacement = null, $slugify = false) {
 		if (is_array($replacement)) {
 			foreach ($replacement as $subMarker =&gt; $subReplacement) {
 				if (is_array($subReplacement)) {
-					continue(1);
+					continue;
 				}
-				$this-&gt;_addMarker($model, $marker . $subMarker, $subReplacement, $slugify);
+				$this-&gt;_addMarker($Model, $marker . $subMarker, $subReplacement, $slugify);
 			}
 			return true;
 		}
@@ -777,21 +771,20 @@ class TransferBehavior extends ModelBehavior {
 		if ($slugify) {
 			$replacement = strtolower(Inflector::slug($replacement, '_'));
 		}
-
-		return $this-&gt;runtime[$model-&gt;alias]['markers'][$marker] = $replacement;
+		return $this-&gt;runtime[$Model-&gt;alias]['markers'][$marker] = $replacement;
 	}
 /**
  * Replace with constants and dynamic replacements
  *
- * @param object $model
+ * @param Model $Model
  * @param mixed $subject Array holding multiple strings or a single string
- * @param bool $safe Make result safe for e.g. filenames
+ * @param boolean $safe Make result safe for e.g. filenames
  * @return string
  */
-	function _replaceMarker(&amp;$model, $subject) {
+	function _replaceMarker(&amp;$Model, $subject) {
 		if(is_array($subject)) {
 			foreach ($subject as $s) {
-				$result[] = $this-&gt;_replaceMarker($model, $s);
+				$result[] = $this-&gt;_replaceMarker($Model, $s);
 			}
 			return $result;
 		}
@@ -800,11 +793,20 @@ class TransferBehavior extends ModelBehavior {
 			return $subject;
 		}
 
-		$markers = Set::filter($this-&gt;runtime[$model-&gt;alias]['markers']);
-		$subject = String::insert($subject, $markers, array('before' =&gt; ':', 'after' =&gt; ':', 'clean' =&gt; true, 'replacement' =&gt; 'unknown_marker'));
+		$markers = Set::filter($this-&gt;runtime[$Model-&gt;alias]['markers']);
+		$subject = String::insert($subject, $markers, array(
+			'before' =&gt; ':', 'after' =&gt; ':',
+			'clean' =&gt; true,
+			'replacement' =&gt; 'unknown_marker'
+		));
 
 		if (strpos($subject, 'unknown_marker') !== false) {
-			trigger_error('TransferBehavior::_replaceMarker - Failed to replace all markers of subject \'' . $subject . '\'. Did you setup the Behavior correctly? Check the configuration you provided for TransferBehavior in your \'' . $model-&gt;name . '\' model.', E_USER_WARNING);
+			$message  = &quot;TransferBehavior::_replaceMarker - &quot;;
+			$message .= &quot;Failed to replace all markers of subject `{$subject}`. &quot;;
+			$message .= &quot;Did you setup the behavior correctly? &quot;;
+			$message .= &quot;Check the configuration you provided for TransferBehavior &quot;;
+			$message .= &quot;in your `{$Model-&gt;name}` model.&quot;;
+			trigger_error($message, E_USER_WARNING);
 			return false;
 		}
 		return $subject;</diff>
      <filename>models/behaviors/transfer.php</filename>
    </modified>
    <modified>
      <diff>@@ -47,30 +47,34 @@ class AttachmentTestCase extends CakeTestCase {
 		$Model = ClassRegistry::init('Movie');
 
 		$assoc = array(
-					'Attachment' =&gt; array(
-						'className' =&gt; 'Media.Attachment',
-						'foreignKey' =&gt; 'foreign_key',
-						'conditions' =&gt; array('model' =&gt; 'Movie'),
-						'dependent' =&gt; true,
-						),
-					);
+			'Attachment' =&gt; array(
+				'className' =&gt; 'Media.Attachment',
+				'foreignKey' =&gt; 'foreign_key',
+				'conditions' =&gt; array('model' =&gt; 'Movie'),
+				'dependent' =&gt; true,
+		));
 		$Model-&gt;bindModel(array('hasOne' =&gt; $assoc), false);
 
 		$Model-&gt;Attachment-&gt;Behaviors-&gt;attach('Media.Polymorphic', array(
 			'classField' =&gt; 'model',
-			'foreignKey' =&gt; 'foreign_key'));
+			'foreignKey' =&gt; 'foreign_key'
+		));
 
 		$Model-&gt;Attachment-&gt;Behaviors-&gt;attach('Media.Transfer', array(
-			'destinationFile' =&gt; ':TMP:test_suite:DS::Source.basename:'));
+			'baseDirectory' =&gt; TMP,
+			'destinationFile' =&gt; 'test_suite:DS::Source.basename:'
+		));
 
 		$Model-&gt;Attachment-&gt;Behaviors-&gt;attach('Media.Media', array(
-			'base' =&gt; $this-&gt;TestFolder-&gt;pwd()));
+			'baseDirectory' =&gt; TMP,
+			'filterDirectory' =&gt; $this-&gt;TestFolder-&gt;pwd() . 'filter' . DS
+		));
 
 		$file = $this-&gt;TestData-&gt;getFile(array('image-jpg.jpg' =&gt; 'ta.jpg'));
 		$data = array(
-					'Movie' =&gt; array('title' =&gt; 'Weekend', 'director' =&gt; 'Jean-Luc Godard'),
-					'Attachment' =&gt; array('file' =&gt; $file, 'model' =&gt; 'Movie')
-					);
+			'Movie' =&gt; array('title' =&gt; 'Weekend', 'director' =&gt; 'Jean-Luc Godard'),
+			'Attachment' =&gt; array('file' =&gt; $file, 'model' =&gt; 'Movie')
+		);
 
 		$Model-&gt;create();
 		$this-&gt;assertTrue($Model-&gt;saveAll($data, array('validate' =&gt; 'first')));
@@ -79,15 +83,15 @@ class AttachmentTestCase extends CakeTestCase {
 
 		$result = $Model-&gt;find('first', array('conditions' =&gt; array('title' =&gt; 'Weekend')));
 		$expected = array(
-				'id' =&gt; 1,
-				'model' =&gt; 'Movie',
-				'foreign_key' =&gt; 4,
-				'dirname' =&gt; null,
-				'basename' =&gt; 'ta.jpg',
-				'checksum' =&gt; '1920c29e7fbe4d1ad2f9173ef4591133',
-				'group' =&gt; null,
-				'alternative' =&gt; null,
-				);
+			'id' =&gt; 1,
+			'model' =&gt; 'Movie',
+			'foreign_key' =&gt; 4,
+			'dirname' =&gt; 'tmp/test_suite',
+			'basename' =&gt; 'ta.jpg',
+			'checksum' =&gt; '1920c29e7fbe4d1ad2f9173ef4591133',
+			'group' =&gt; null,
+			'alternative' =&gt; null,
+		);
 		$this-&gt;assertEqual($result['Attachment'], $expected);
 		unlink($file);
 	}
@@ -96,13 +100,12 @@ class AttachmentTestCase extends CakeTestCase {
 		$Model = ClassRegistry::init('Movie');
 
 		$assoc = array(
-					'Attachment' =&gt; array(
-						'className' =&gt; 'Media.Attachment',
-						'foreignKey' =&gt; 'foreign_key',
-						'conditions' =&gt; array('model' =&gt; 'Movie'),
-						'dependent' =&gt; true,
-						),
-					);
+			'Attachment' =&gt; array(
+				'className' =&gt; 'Media.Attachment',
+				'foreignKey' =&gt; 'foreign_key',
+				'conditions' =&gt; array('model' =&gt; 'Movie'),
+				'dependent' =&gt; true,
+		));
 		$Model-&gt;bindModel(array('hasMany' =&gt; $assoc), false);
 
 		$Model-&gt;Attachment-&gt;Behaviors-&gt;attach('Media.Polymorphic', array(
@@ -110,20 +113,23 @@ class AttachmentTestCase extends CakeTestCase {
 			'foreignKey' =&gt; 'foreign_key'));
 
 		$Model-&gt;Attachment-&gt;Behaviors-&gt;attach('Media.Transfer', array(
-			'destinationFile' =&gt; ':TMP:test_suite:DS::Source.basename:'));
+			'baseDirectory' =&gt; TMP,
+			'destinationFile' =&gt; 'test_suite:DS::Source.basename:'
+		));
 
 		$Model-&gt;Attachment-&gt;Behaviors-&gt;attach('Media.Media', array(
-			'base' =&gt; $this-&gt;TestFolder-&gt;pwd()));
+			'baseDirectory' =&gt; TMP,
+			'filterDirectory' =&gt; $this-&gt;TestFolder-&gt;pwd() . 'filter' . DS
+		));
 
 		$fileA = $this-&gt;TestData-&gt;getFile(array('image-jpg.jpg' =&gt; 'ta.jpg'));
 		$fileB = $this-&gt;TestData-&gt;getFile(array('image-png.png' =&gt; 'tb.png'));
 		$data = array(
-					'Movie' =&gt; array('title' =&gt; 'Weekend', 'director' =&gt; 'Jean-Luc Godard'),
-					'Attachment' =&gt; array(
-										array('file' =&gt; $fileA, 'model' =&gt; 'Movie'),
-										array('file' =&gt; $fileB, 'model' =&gt; 'Movie')
-										)
-					);
+			'Movie' =&gt; array('title' =&gt; 'Weekend', 'director' =&gt; 'Jean-Luc Godard'),
+			'Attachment' =&gt; array(
+				array('file' =&gt; $fileA, 'model' =&gt; 'Movie'),
+				array('file' =&gt; $fileB, 'model' =&gt; 'Movie')
+		));
 
 		$Model-&gt;create();
 		$result = $Model-&gt;saveAll($data, array('validate' =&gt; 'first'));
@@ -134,26 +140,25 @@ class AttachmentTestCase extends CakeTestCase {
 		$result = $Model-&gt;find('first', array('conditions' =&gt; array('title' =&gt; 'Weekend')));
 		$expected = array(
 			0 =&gt; array(
-					'id' =&gt; 1,
-					'model' =&gt; 'Movie',
-					'foreign_key' =&gt; 4,
-					'dirname' =&gt; null,
-					'basename' =&gt; 'ta.jpg',
-					'checksum' =&gt; '1920c29e7fbe4d1ad2f9173ef4591133',
-					'group' =&gt; null,
-					'alternative' =&gt; null,
-					),
+				'id' =&gt; 1,
+				'model' =&gt; 'Movie',
+				'foreign_key' =&gt; 4,
+				'dirname' =&gt; 'tmp/test_suite',
+				'basename' =&gt; 'ta.jpg',
+				'checksum' =&gt; '1920c29e7fbe4d1ad2f9173ef4591133',
+				'group' =&gt; null,
+				'alternative' =&gt; null,
+			),
 			1 =&gt; array(
-					'id' =&gt; 2,
-					'model' =&gt; 'Movie',
-					'foreign_key' =&gt; 4,
-					'dirname' =&gt; null,
-					'basename' =&gt; 'tb.png',
-					'checksum' =&gt; '7f9af648b511f2c83b1744f42254983f',
-					'group' =&gt; null,
-					'alternative' =&gt; null,
-					)
-				);
+				'id' =&gt; 2,
+				'model' =&gt; 'Movie',
+				'foreign_key' =&gt; 4,
+				'dirname' =&gt; 'tmp/test_suite',
+				'basename' =&gt; 'tb.png',
+				'checksum' =&gt; '7f9af648b511f2c83b1744f42254983f',
+				'group' =&gt; null,
+				'alternative' =&gt; null,
+		));
 		$this-&gt;assertEqual($result['Attachment'], $expected);
 	}
 
@@ -161,59 +166,64 @@ class AttachmentTestCase extends CakeTestCase {
 		$Model = ClassRegistry::init('Movie');
 
 		$assoc = array(
-					'Poster' =&gt; array(
-						'className' =&gt; 'Media.Attachment',
-						'foreignKey' =&gt; 'foreign_key',
-						'conditions' =&gt; array('model' =&gt; 'Movie', 'Poster.group' =&gt; 'poster'),
-						'dependent' =&gt; true,
-					)
-				);
+			'Poster' =&gt; array(
+				'className' =&gt; 'Media.Attachment',
+				'foreignKey' =&gt; 'foreign_key',
+				'conditions' =&gt; array('model' =&gt; 'Movie', 'Poster.group' =&gt; 'poster'),
+				'dependent' =&gt; true,
+		));
 		$Model-&gt;bindModel(array('hasOne' =&gt; $assoc), false);
 
 		$Model-&gt;Poster-&gt;Behaviors-&gt;attach('Media.Polymorphic', array(
-				'classField' =&gt; 'model',
-				'foreignKey' =&gt; 'foreign_key'));
+			'classField' =&gt; 'model',
+			'foreignKey' =&gt; 'foreign_key'
+		));
 
 		$Model-&gt;Poster-&gt;Behaviors-&gt;attach('Media.Transfer', array(
-			'destinationFile' =&gt; ':TMP:test_suite:DS:poster:DS::Source.basename:'));
+			'baseDirectory' =&gt; TMP,
+			'destinationFile' =&gt; 'test_suite:DS:poster:DS::Source.basename:'
+		));
 
 		$Model-&gt;Poster-&gt;Behaviors-&gt;attach('Media.Media', array(
-			'base' =&gt; $this-&gt;TestFolder-&gt;pwd()));
+			'baseDirectory' =&gt; TMP,
+			'filterDirectory' =&gt; $this-&gt;TestFolder-&gt;pwd() . 'filter' . DS
+		));
 
 		$assoc = array(
-					'Photo' =&gt; array(
-						'className' =&gt; 'Media.Attachment',
-						'foreignKey' =&gt; 'foreign_key',
-						'conditions' =&gt; array('model' =&gt; 'Movie', 'Photo.group' =&gt; 'photo'),
-						'dependent' =&gt; true,
-					),
-				);
+			'Photo' =&gt; array(
+				'className' =&gt; 'Media.Attachment',
+				'foreignKey' =&gt; 'foreign_key',
+				'conditions' =&gt; array('model' =&gt; 'Movie', 'Photo.group' =&gt; 'photo'),
+				'dependent' =&gt; true,
+		));
 		$Model-&gt;bindModel(array('hasMany' =&gt; $assoc), false);
 
 		$Model-&gt;Photo-&gt;Behaviors-&gt;attach('Media.Polymorphic', array(
 			'classField' =&gt; 'model',
-			'foreignKey' =&gt; 'foreign_key'));
+			'foreignKey' =&gt; 'foreign_key'
+		));
 
 		$Model-&gt;Photo-&gt;Behaviors-&gt;attach('Media.Transfer', array(
-			'destinationFile' =&gt; ':TMP:test_suite:DS:photo:DS::Source.basename:'));
+			'baseDirectory' =&gt; TMP,
+			'destinationFile' =&gt; 'test_suite:DS:photo:DS::Source.basename:'
+		));
 
 		$Model-&gt;Photo-&gt;Behaviors-&gt;attach('Media.Media', array(
-			'base' =&gt; $this-&gt;TestFolder-&gt;pwd()));
+			'baseDirectory' =&gt; TMP,
+			'filterDirectory' =&gt; $this-&gt;TestFolder-&gt;pwd() . 'filter' . DS
+		));
 
 		$fileA = $this-&gt;TestData-&gt;getFile(array('image-jpg.jpg' =&gt; 'ta.jpg'));
 		$fileB = $this-&gt;TestData-&gt;getFile(array('image-png.png' =&gt; 'tb.png'));
 		$fileC = $this-&gt;TestData-&gt;getFile(array('image-png.png' =&gt; 'tc.png'));
 
 		$data = array(
-					'Movie' =&gt; array('title' =&gt; 'Weekend', 'director' =&gt; 'Jean-Luc Godard'),
-					'Poster' =&gt; array(
-									'file' =&gt; $fileA, 'model' =&gt; 'Movie', 'group' =&gt; 'poster',
-									),
-					'Photo' =&gt; array(
-									array('file' =&gt; $fileB, 'model' =&gt; 'Movie', 'group' =&gt; 'photo'),
-									array('file' =&gt; $fileC, 'model' =&gt; 'Movie', 'group' =&gt; 'photo'),
-									)
-					);
+			'Movie' =&gt; array('title' =&gt; 'Weekend', 'director' =&gt; 'Jean-Luc Godard'),
+			'Poster' =&gt; array('file' =&gt; $fileA, 'model' =&gt; 'Movie', 'group' =&gt; 'poster'),
+			'Photo' =&gt; array(
+				array('file' =&gt; $fileB, 'model' =&gt; 'Movie', 'group' =&gt; 'photo'),
+				array('file' =&gt; $fileC, 'model' =&gt; 'Movie', 'group' =&gt; 'photo'),
+		));
 
 		$Model-&gt;create();
 		$result = $Model-&gt;saveAll($data, array('validate' =&gt; 'first'));
@@ -231,38 +241,36 @@ class AttachmentTestCase extends CakeTestCase {
 			),
 			'Actor' =&gt; array(),
 			'Poster' =&gt; array(
-					'id' =&gt; 1,
+				'id' =&gt; 1,
+				'model' =&gt; 'Movie',
+				'foreign_key' =&gt; 4,
+				'dirname' =&gt; 'tmp/test_suite/poster',
+				'basename' =&gt; 'ta.jpg',
+				'checksum' =&gt; '1920c29e7fbe4d1ad2f9173ef4591133',
+				'group' =&gt; 'poster',
+				'alternative' =&gt; null,
+			),
+			'Photo' =&gt; array(
+				0 =&gt; array(
+					'id' =&gt; 2,
 					'model' =&gt; 'Movie',
 					'foreign_key' =&gt; 4,
-					'dirname' =&gt; 'poster',
-					'basename' =&gt; 'ta.jpg',
-					'checksum' =&gt; '1920c29e7fbe4d1ad2f9173ef4591133',
-					'group' =&gt; 'poster',
+					'dirname' =&gt; 'tmp/test_suite/photo',
+					'basename' =&gt; 'tb.png',
+					'checksum' =&gt; '7f9af648b511f2c83b1744f42254983f',
+					'group' =&gt; 'photo',
 					'alternative' =&gt; null,
 				),
-			'Photo' =&gt; array(
-				0 =&gt; array(
-						'id' =&gt; 2,
-						'model' =&gt; 'Movie',
-						'foreign_key' =&gt; 4,
-						'dirname' =&gt; 'photo',
-						'basename' =&gt; 'tb.png',
-						'checksum' =&gt; '7f9af648b511f2c83b1744f42254983f',
-						'group' =&gt; 'photo',
-						'alternative' =&gt; null,
-					),
 				1 =&gt; array(
-						'id' =&gt; 3,
-						'model' =&gt; 'Movie',
-						'foreign_key' =&gt; 4,
-						'dirname' =&gt; 'photo',
-						'basename' =&gt; 'tc.png',
-						'checksum' =&gt; '7f9af648b511f2c83b1744f42254983f',
-						'group' =&gt; 'photo',
-						'alternative' =&gt; null,
-						)
-					),
-				);
+					'id' =&gt; 3,
+					'model' =&gt; 'Movie',
+					'foreign_key' =&gt; 4,
+					'dirname' =&gt; 'tmp/test_suite/photo',
+					'basename' =&gt; 'tc.png',
+					'checksum' =&gt; '7f9af648b511f2c83b1744f42254983f',
+					'group' =&gt; 'photo',
+					'alternative' =&gt; null,
+		)));
 		$this-&gt;assertEqual($result, $expected);
 	}
 }</diff>
      <filename>tests/cases/models/attachment.test.php</filename>
    </modified>
    <modified>
      <diff>@@ -44,19 +44,22 @@ class MediaBehaviorTestCase extends CakeTestCase {
 
 		$this-&gt;TestData = new TestData();
 		$this-&gt;file0 = $this-&gt;TestData-&gt;getFile(array(
-			'image-png.png' =&gt; $this-&gt;TmpFolder-&gt;pwd() . 'static/img/image-png.png'));
+			'image-png.png' =&gt; $this-&gt;TmpFolder-&gt;pwd() . 'static/img/image-png.png'
+		));
 		$this-&gt;file1 = $this-&gt;TestData-&gt;getFile(array(
-			'image-jpg.jpg' =&gt; $this-&gt;TmpFolder-&gt;pwd() . 'static/img/image-jpg.jpg'));
+			'image-jpg.jpg' =&gt; $this-&gt;TmpFolder-&gt;pwd() . 'static/img/image-jpg.jpg'
+		));
 		$this-&gt;file2 = $this-&gt;TestData-&gt;getFile(array(
-			'text-plain.txt' =&gt; $this-&gt;TmpFolder-&gt;pwd() . 'static/txt/text-plain.txt'));
+			'text-plain.txt' =&gt; $this-&gt;TmpFolder-&gt;pwd() . 'static/txt/text-plain.txt'
+		));
 
 		$this-&gt;_behaviorSettings = array(
-						'baseDirectory' =&gt; $this-&gt;TmpFolder-&gt;pwd(),
-						'makeVersions' =&gt; false,
-						'createDirectory' =&gt; false,
-						'filterDirectory' =&gt; $this-&gt;TmpFolder-&gt;pwd() . 'filter' . DS,
-						'metadataLevel' =&gt; 1
-						);
+			'baseDirectory' =&gt; $this-&gt;TmpFolder-&gt;pwd(),
+			'makeVersions' =&gt; false,
+			'createDirectory' =&gt; false,
+			'filterDirectory' =&gt; $this-&gt;TmpFolder-&gt;pwd() . 'filter' . DS,
+			'metadataLevel' =&gt; 1
+		);
 
 		$this-&gt;_mediaConfig = Configure::read('Media');
 	}
@@ -93,19 +96,23 @@ class MediaBehaviorTestCase extends CakeTestCase {
 		$Model-&gt;Behaviors-&gt;attach('Media.Media', $this-&gt;_behaviorSettings);
 
 		$file = $this-&gt;TestData-&gt;getFile(array(
-			'application-pdf.pdf' =&gt; $this-&gt;TmpFolder-&gt;pwd() . 'static/doc/application-pdf.pdf'));
+			'application-pdf.pdf' =&gt; $this-&gt;TmpFolder-&gt;pwd() . 'static/doc/application-pdf.pdf'
+		));
 		$item = array('file' =&gt; $file);
 		$Model-&gt;create();
 		$result = $Model-&gt;save($item);
 		$this-&gt;assertTrue($result);
 
 		$result = $Model-&gt;findById(5);
-		$expected = array ('Song' =&gt; array ('id' =&gt; '5',
-											'dirname' =&gt; 'static/doc',
-											'basename' =&gt; 'application-pdf.pdf',
-											'checksum' =&gt; 'f7ee91cffd90881f3d719e1bab1c4697',
-											'size' =&gt; 13903,
-											'mime_type' =&gt; 'application/pdf'));
+		$expected = array(
+			'Song' =&gt; array (
+				'id' =&gt; '5',
+					'dirname' =&gt; 'static/doc',
+					'basename' =&gt; 'application-pdf.pdf',
+					'checksum' =&gt; 'f7ee91cffd90881f3d719e1bab1c4697',
+					'size' =&gt; 13903,
+					'mime_type' =&gt; 'application/pdf'
+		));
 		$this-&gt;assertEqual($expected, $result);
 	}
 
@@ -138,15 +145,14 @@ class MediaBehaviorTestCase extends CakeTestCase {
 						 )
 					);
 		$expected[] = array(
-					$file,
-					array(
-						'overwrite' =&gt; false,
-						'directory' =&gt; $this-&gt;TmpFolder-&gt;pwd() . 'filter' . DS . 'm' . DS,
-						'name' =&gt; 'Image',
-						'version' =&gt; 'm',
-						'instructions' =&gt; array('convert' =&gt; 'image/png', 'fit' =&gt; array(10, 10))
-						 )
-					);
+			$file,
+			array(
+				'overwrite' =&gt; false,
+				'directory' =&gt; $this-&gt;TmpFolder-&gt;pwd() . 'filter' . DS . 'm' . DS,
+				'name' =&gt; 'Image',
+				'version' =&gt; 'm',
+				'instructions' =&gt; array('convert' =&gt; 'image/png', 'fit' =&gt; array(10, 10))
+		 ));
 
 		$Model-&gt;make($file);
 		$this-&gt;assertEqual($Model-&gt;beforeMakeArgs, $expected);</diff>
      <filename>tests/cases/models/behaviors/media.test.php</filename>
    </modified>
    <modified>
      <diff>@@ -38,10 +38,6 @@ class MediaValidationTest extends CakeTestCase {
 		$result = MediaValidation::mimeType($check);
 		$this-&gt;assertTrue($result);
 
-		$check = 'text/x-php';
-		$result = MediaValidation::mimeType($check);
-		$this-&gt;assertFalse($result);
-
 		$check = 'image/png';
 		$result = MediaValidation::mimeType($check,array('image/png'));
 		$this-&gt;assertFalse($result);
@@ -72,10 +68,6 @@ class MediaValidationTest extends CakeTestCase {
 		$result = MediaValidation::extension($check, false, array('tar.gz'));
 		$this-&gt;assertFalse($result);
 
-		$check = 'php';
-		$result = MediaValidation::extension($check);
-		$this-&gt;assertFalse($result);
-
 		$check = 'png';
 		$result = MediaValidation::extension($check, array('png'));
 		$this-&gt;assertFalse($result);</diff>
      <filename>tests/cases/vendors/media_validation.test.php</filename>
    </modified>
    <modified>
      <diff>@@ -25,14 +25,18 @@ App::import('Core', 'Validation');
  */
 class MediaValidation extends Validation {
 /**
- * Checks if mime type is (not) one of given mime types
+ * Checks if MIME type is (not) one of given MIME types
  *
  * @param string $check Mime type to check e.g. image/jpeg
- * @param mixed $deny True or * blocks any mime type, an array containing mime types selectively blocks, false blocks no mime type
- * @param mixed $allow True or * allows any extension, an array containing extensions selectively allows, false allows no mime type
- * @return bool
+ * @param mixed $deny True or * blocks any MIME type,
+ * 	an array containing MIME types selectively blocks,
+ * 	false blocks no MIME type
+ * @param mixed $allow True or * allows any extension,
+ * 	an array containing extensions selectively allows,
+ * 	false allows no MIME type
+ * @return boolean
  */
-	function mimeType($check, $deny = array('application/octet-stream', 'text/x-php'), $allow = true) {
+	function mimeType($check, $deny = false, $allow = true) {
 		if (!is_string($check) || !preg_match('/^[-\w.\+]+\/[-\w.\+]+$/', $check)) {
 			return false;
 		}
@@ -49,12 +53,16 @@ class MediaValidation extends Validation {
 /**
  * Checks if extension is (not) one of given extensions
  *
- * @param string $check Extension to check (w/o leading dot)
- * @param mixed $deny True or * blocks any extension, an array containing extensions (w/o leading dot) selectively blocks, false blocks no extension
- * @param mixed $allow True or * allows any extension, an array containing extensions (w/o leading dot) selectively allows, false allows no extension
- * @return bool
+ * @param string $check Extension to check (without leading dot)
+ * @param mixed $deny True or * blocks any extension,
+ * 	an array containing extensions (without a leading dot) selectively blocks,
+ * 	false blocks no extension
+ * @param mixed $allow True or * allows any extension,
+ * 	an array containing extensions (without leading dot) selectively allows,
+ * 	false allows no extension
+ * @return boolean
  */
-	function extension($check, $deny = array('bin', 'class', 'dll', 'dms', 'exe', 'lha', 'lzh', 'so', 'as', 'asp', 'sh', 'java', 'js', 'lisp', 'lua', 'pl', 'pm', 'php', 'py', 'pyc', 'vb', 'bas'), $allow = true) {
+	function extension($check, $deny = false, $allow = true) {
 		if (!is_string($check) || !preg_match('/^[\w0-9]+(\.[\w0-9]+)?$/', $check)) {
 			return false;
 		}
@@ -72,12 +80,12 @@ class MediaValidation extends Validation {
  * Checks if size is within limits
  *
  * Please note that the size will always be checked against
- * limitations set in php.ini for post_max_size and upload_max_filesize
- * even if $max is set to false
+ * limitations set in `php.ini` for `post_max_size` and `upload_max_filesize`
+ * even if $max is set to false.
  *
- * @param int $check Size to check in bytes
+ * @param integer $check Size to check in bytes
  * @param mixed $max String (e.g. 8M) containing maximum allowed size, false allows any size
- * @return bool
+ * @return boolean
  */
 	function size($check, $max = false) {
 		if (!$check = self::_toComputableSize($check)) {
@@ -110,7 +118,7 @@ class MediaValidation extends Validation {
  *
  * @param mixed $check Pixels to check e.g 200x200 or 40000
  * @param mixed $max String (e.g. 40000 or 200x100) containing maximum allowed amount of pixels
- * @return bool
+ * @return boolean
  */
 	function pixels($check, $max = false) {
 		if (strpos($check, 'x') !== false) {
@@ -127,8 +135,9 @@ class MediaValidation extends Validation {
  * Checks if path is within given locations
  *
  * @param string $check Absolute path
- * @param mixed $allow True or * allows any location, an array containing absolute paths to locations
- * @return bool
+ * @param mixed $allow True or * allows any location,
+ * 	an array containing absolute paths to locations
+ * @return boolean
  */
 	function location($check, $allow = false) {
 		$allow = self::_normalize($allow);
@@ -160,22 +169,22 @@ class MediaValidation extends Validation {
 
 			foreach ($allow as $path) {
 				if (!Folder::isAbsolute($path) || Validation::url($path)) {
-					continue(1);
+					continue;
 				}
 				if ($Check-&gt;inPath($path)) {
 					return true;
 				}
 			}
 		}
-
 		return false;
 	}
 /**
  * Checks if read/write permissions are set
  *
- * @param string $check 4-digit octal representation of file permissions, or absolute path to a file/directory
+ * @param string $check 4-digit octal representation of file permissions,
+ * 	or absolute path to a file or directory
  * @param string $type Permission r, w or rw
- * @return bool
+ * @return boolean
  */
 	function access($check, $type = 'r') {
 		if (self::file($check, true) || self::folder($check, true)) {
@@ -196,15 +205,16 @@ class MediaValidation extends Validation {
 				return false;
 			}
 		}
-
 		return true;
 	}
 /**
  * Checks if provided or potentially dangerous permissions are set
  *
  * @param string $check
- * @param mixed $match True to check for potentially dangerous permissions, a string containing the 4-digit octal value of the permissions to check for an exact match, false to allow any permissions
- * @return bool
+ * @param mixed $match True to check for potentially dangerous permissions,
+ * 	a string containing the 4-digit octal value of the permissions to check for an exact match,
+ * 	false to allow any permissions
+ * @return boolean
  */
 	function permission($check, $match = true) {
 		$match = self::_normalize($match);
@@ -221,7 +231,6 @@ class MediaValidation extends Validation {
 		if (is_numeric($match) &amp;&amp; $check != $match) {
 			return false;
 		}
-
 		return true;
 	}
 /**
@@ -229,8 +238,8 @@ class MediaValidation extends Validation {
  * Please note, that directoires are not treated as files in strict mode
  *
  * @param string $file Absolute path to file
- * @param bool $strict Enable checking for actual existence of file
- * @return bool
+ * @param boolean $strict Enable checking for actual existence of file
+ * @return boolean
  */
 	function file($check, $strict = true) {
 		if (!is_string($check)) {
@@ -242,7 +251,6 @@ class MediaValidation extends Validation {
 		if (strpos($check, DS) === false) {
 			return false;
 		}
-
 		return true;
 	}
 /**
@@ -250,8 +258,8 @@ class MediaValidation extends Validation {
  * Used mainly for $allow/$deny parameter contents
  *
  * @param string $check Absolute path to directory
- * @param bool $strict Enable checking for actual existence of directory
- * @return bool
+ * @param boolean $strict Enable checking for actual existence of directory
+ * @return boolean
  */
 	function folder($check, $strict = true) {
 		if (!is_string($check)) {
@@ -260,7 +268,6 @@ class MediaValidation extends Validation {
 		if (!is_dir($check) &amp;&amp; $strict === true) {
 			return false;
 		}
-
 		return true;
 	}
 /**
@@ -295,13 +302,13 @@ class MediaValidation extends Validation {
 		}
 	}
 /**
- * Parse php.ini style size strings
+ * Parse `php.ini` style size strings
  *
- * Slightly modified version of ini_get_size()
+ * Slightly modified version of `ini_get_size()`
  * @link posted at http://www.php.net/features.file-upload
  * @author djcassis gmail com
  *
- * @param string $sizeString Php.ini style size string e.g. 16M
+ * @param string $sizeString `php.ini` style size string e.g. `'16M'`
  * @return int Size in bytes
  */
 	function _toComputableSize($sizeString) {
@@ -313,19 +320,18 @@ class MediaValidation extends Validation {
 		}
 
 		$sizeUnit = strtoupper(substr($sizeString, -1));
-	    $size = (int) substr($sizeString, 0, -1);
+	    $size = (integer)substr($sizeString, 0, -1);
 
 	    switch ($sizeUnit) {
-	        case 'Y' : $size *= 1024; // Yotta
-	        case 'Z' : $size *= 1024; // Zetta
-	        case 'E' : $size *= 1024; // Exa
-	        case 'P' : $size *= 1024; // Peta
-	        case 'T' : $size *= 1024; // Tera
-	        case 'G' : $size *= 1024; // Giga
-	        case 'M' : $size *= 1024; // Mega
-	        case 'K' : $size *= 1024; // kilo
+			case 'Y': $size *= 1024; /* Yotta */
+			case 'Z': $size *= 1024; /* Zetta */
+			case 'E': $size *= 1024; /* Exa */
+	        case 'P': $size *= 1024; /* Peta */
+			case 'T': $size *= 1024; /* Tera */
+			case 'G': $size *= 1024; /* Giga */
+			case 'M': $size *= 1024; /* Mega */
+			case 'K': $size *= 1024; /* Kilo */
 	    }
-
 	    return $size;
 	}
 }</diff>
      <filename>vendors/media_validation.php</filename>
    </modified>
    <modified>
      <diff>@@ -24,19 +24,18 @@
  */
 class BasicImageMediumAdapter extends MediumAdapter {
 	var $require = array(
-							'mimeTypes' =&gt; array(
-								'image/jpeg',
-								'image/gif',
-								'image/png',
-								'image/tiff',
-								'image/xbm',
-								'image/wbmp',
-								'image/ms-bmp',
-								'image/xpm',
-								'image/ico',
-								'image/psd',
-								),
-							);
+		'mimeTypes' =&gt; array(
+			'image/jpeg',
+			'image/gif',
+			'image/png',
+			'image/tiff',
+			'image/xbm',
+			'image/wbmp',
+			'image/ms-bmp',
+			'image/xpm',
+			'image/ico',
+			'image/psd',
+	));
 
 	function initialize(&amp;$Medium) {
 		if (!isset($Medium-&gt;file)) {</diff>
      <filename>vendors/medium/adapter/basic_image.php</filename>
    </modified>
    <modified>
      <diff>@@ -23,11 +23,6 @@
  * @subpackage media.libs.medium.adapter
  */
 class BasicTextMediumAdapter extends MediumAdapter {
-	/**
- * Enter description here...
-	 *
-	 * @var unknown_type
-	 */
 	var $require = array('mimeTypes' =&gt; array('text/plain'));
 
 	function initialize(&amp;$Medium) {
@@ -36,11 +31,7 @@ class BasicTextMediumAdapter extends MediumAdapter {
 		}
 		return true;
 	}
-/**
- * Enter description here...
- *
- * @return unknown
- */
+
 	function characters(&amp;$Medium) {
 		return filesize($Medium-&gt;file);
 	}</diff>
      <filename>vendors/medium/adapter/basic_text.php</filename>
    </modified>
    <modified>
      <diff>@@ -26,15 +26,15 @@
 class FfmpegAudioMediumAdapter extends MediumAdapter {
 	var $require = array(
 		'mimeTypes' =&gt; array(
-				'audio/mpeg',
-				/* Ffmpeg Extension can't read meta info other than ID3! */
-				'audio/ms-wma',
-				'audio/realaudio',
-				'audio/wav',
-				'audio/ogg',
-				/* Some Ogg files may have 'application/octet-stream' mime type. */
-				'application/octet-stream',
-			),
+			'audio/mpeg',
+			/* Ffmpeg Extension can't read meta info other than ID3! */
+			'audio/ms-wma',
+			'audio/realaudio',
+			'audio/wav',
+			'audio/ogg',
+			/* Some Ogg files may have 'application/octet-stream' MIME type. */
+			'application/octet-stream',
+		),
 		'extensions' =&gt; array('ffmpeg'),
 	);
 
@@ -86,6 +86,5 @@ class FfmpegAudioMediumAdapter extends MediumAdapter {
 	function bitrate(&amp;$Medium) {
 		return $Medium-&gt;objects['ffmpeg_movie']-&gt;getBitRate();
 	}
-
 }
 ?&gt;</diff>
      <filename>vendors/medium/adapter/ffmpeg_audio.php</filename>
    </modified>
    <modified>
      <diff>@@ -25,17 +25,17 @@
  */
 class FfmpegVideoMediumAdapter extends MediumAdapter {
 	var $require = array(
-							'mimeTypes' =&gt; array(
-											'video/mpeg',
-											'video/mswmv',
-											'video/msasf',
-											'video/msvideo',
-											'video/quicktime',
-											'video/flv',
-											'video/ogg',
-											),
-							'extensions' =&gt; array('ffmpeg', 'gd'),
-							);
+		'mimeTypes' =&gt; array(
+			'video/mpeg',
+			'video/mswmv',
+			'video/msasf',
+			'video/msvideo',
+			'video/quicktime',
+			'video/flv',
+			'video/ogg',
+		),
+		'extensions' =&gt; array('ffmpeg', 'gd'),
+	);
 
 	function initialize(&amp;$Medium) {
 		if (isset($Medium-&gt;objects['ffmpeg_movie'])) {
@@ -47,12 +47,11 @@ class FfmpegVideoMediumAdapter extends MediumAdapter {
 		}
 
 		$Medium-&gt;objects['ffmpeg_movie'] = new ffmpeg_movie($Medium-&gt;file);
-
 		return true;
 	}
 
 	function convert(&amp;$Medium, $mimeType) {
-		if(Medium::name(null, $mimeType) === 'Image') {
+		if (Medium::name(null, $mimeType) === 'Image') {
 			$randomFrame = rand(1, $Medium-&gt;objects['ffmpeg_movie']-&gt;getFrameCount() - 1);
 			$resource = $Medium-&gt;objects['ffmpeg_movie']-&gt;getFrame($randomFrame)-&gt;toGDImage();
 </diff>
      <filename>vendors/medium/adapter/ffmpeg_video.php</filename>
    </modified>
    <modified>
      <diff>@@ -24,44 +24,49 @@
  */
 class GdMediumAdapter extends MediumAdapter {
 	var $require = array(
-							'mimeTypes' =&gt; array('image/gd'), /* Gets dynamically set in constructor */
-							'extensions' =&gt; array('gd'),
-							);
+		'mimeTypes' =&gt; array('image/gd'), /* Gets dynamically set in constructor */
+		'extensions' =&gt; array('gd'),
+	);
+
 	var $_Image;
+
 	var $_formatMap = array(
-						'image/jpeg' =&gt; 'jpeg',
-						'image/gif' =&gt; 'gif',
-						'image/png' =&gt; 'png',
-						'image/gd' =&gt; 'gd',
-						'image/vnd.wap.wbmp' =&gt; 'wbmp',
-						'image/xbm' =&gt; 'xbm',
-						);
+		'image/jpeg' =&gt; 'jpeg',
+		'image/gif' =&gt; 'gif',
+		'image/png' =&gt; 'png',
+		'image/gd' =&gt; 'gd',
+		'image/vnd.wap.wbmp' =&gt; 'wbmp',
+		'image/xbm' =&gt; 'xbm',
+	);
+
 	var $_format;
+
 	var $_compression;
+
 	var $_pngFilter;
 
 	function compatible(&amp;$Medium) {
 		$types = imageTypes();
-		if($types &amp; IMG_GIF) {
+		if ($types &amp; IMG_GIF) {
 			$this-&gt;require['mimeTypes'][] = 'image/gif';
 		}
-		if($types &amp; IMG_JPG) {
+		if ($types &amp; IMG_JPG) {
 			$this-&gt;require['mimeTypes'][] = 'image/jpeg';
 		}
-		if($types &amp; IMG_PNG) {
+		if ($types &amp; IMG_PNG) {
 			$this-&gt;require['mimeTypes'][] = 'image/png';
 		}
-		if($types &amp; IMG_WBMP) {
+		if ($types &amp; IMG_WBMP) {
 			$this-&gt;require['mimeTypes'][] = 'image/wbmp';
 		}
-		if($types &amp; IMG_XPM) {
+		if ($types &amp; IMG_XPM) {
 			$this-&gt;require['mimeTypes'][] = 'image/xpm';
 		}
 		return parent::compatible($Medium);
 	}
 
 	function initialize(&amp;$Medium) {
-		$this-&gt;_format = $this-&gt;_formatMap[$Medium-&gt;mimeType]; // could be a problem here...
+		$this-&gt;_format = $this-&gt;_formatMap[$Medium-&gt;mimeType];
 
 		if (isset($Medium-&gt;resources['gd'])) {
 			return true;
@@ -70,7 +75,10 @@ class GdMediumAdapter extends MediumAdapter {
 			return false;
 		}
 
-		$Medium-&gt;resources['gd'] = call_user_func_array('imageCreateFrom' . $this-&gt;_format, array($Medium-&gt;file));
+		$Medium-&gt;resources['gd'] = call_user_func_array(
+			'imageCreateFrom' . $this-&gt;_format,
+			array($Medium-&gt;file
+		));
 
 		if (!$this-&gt;_isResource($Medium-&gt;resources['gd'])) {
 			return false;
@@ -79,7 +87,6 @@ class GdMediumAdapter extends MediumAdapter {
 		if (imageIsTrueColor($Medium-&gt;resources['gd'])) {
 			imageSaveAlpha($Medium-&gt;resources['gd'], true);
 		}
-
 		return true;
 	}
 
@@ -109,7 +116,6 @@ class GdMediumAdapter extends MediumAdapter {
 				}
 				break;
 		}
-
 		return call_user_func_array('image' . $this-&gt;_format, $args);
 	}
 
@@ -123,12 +129,12 @@ class GdMediumAdapter extends MediumAdapter {
 	function compress(&amp;$Medium, $value) {
 		switch ($Medium-&gt;mimeType) {
 			case 'image/jpeg':
-				$this-&gt;_compression = intval(100 - ($value * 10));
+				$this-&gt;_compression = (integer)(100 - ($value * 10));
 				break;
 
 			case 'image/png':
 				if (version_compare(PHP_VERSION, '5.1.2', '&gt;=')) {
-					$this-&gt;_compression = intval($value);
+					$this-&gt;_compression = (integer)$value;
 				}
 				if (version_compare(PHP_VERSION, '5.1.3', '&gt;=')) {
 					$filter = ($value * 10) % 10;
@@ -138,7 +144,7 @@ class GdMediumAdapter extends MediumAdapter {
 						2 =&gt; PNG_FILTER_UP,
 						3 =&gt; PNG_FILTER_AVG,
 						4 =&gt; PNG_FILTER_PAETH,
-						);
+					);
 
 					if (array_key_exists($filter, $map)) {
 						$this-&gt;_pngFilter = $map[$filter];
@@ -158,19 +164,33 @@ class GdMediumAdapter extends MediumAdapter {
 	}
 
 	function crop(&amp;$Medium, $left, $top, $width, $height) {
-		$left   = intval($left);
-		$top    = intval($top);
-		$width  = intval($width);
-		$height = intval($height);
+		$left   = (integer)$left;
+		$top    = (integer)$top;
+		$width  = (integer)$width;
+		$height = (integer)$height;
 
 		$Image = imageCreateTrueColor($width, $height);
 
 		if ($this-&gt;_isTransparent($Medium-&gt;resources['gd'])) {
 			$Image = $this-&gt;_copyTransparency($Medium-&gt;resources['gd'], $Image);
-			imageCopyResized($Image, $Medium-&gt;resources['gd'], 0, 0, $left, $top, $width, $height, $width, $height);
+			imageCopyResized(
+				$Image,
+				$Medium-&gt;resources['gd'],
+				0, 0,
+				$left, $top,
+				$width, $height,
+				$width, $height
+			);
 		} else {
 			imageSaveAlpha($Image, true);
-			imageCopyResampled($Image, $Medium-&gt;resources['gd'], 0, 0, $left, $top, $width, $height, $width, $height);
+			imageCopyResampled(
+				$Image,
+				$Medium-&gt;resources['gd'],
+				0, 0,
+				$left, $top,
+				$width, $height,
+				$width, $height
+			);
 		}
 		if ($this-&gt;_isResource($Image)) {
 			$Medium-&gt;resources['gd'] = $Image;
@@ -180,17 +200,31 @@ class GdMediumAdapter extends MediumAdapter {
 	}
 
 	function resize(&amp;$Medium, $width, $height) {
-		$width  = intval($width);
-		$height = intval($height);
+		$width  = (integer)$width;
+		$height = (integer)$height;
 
 		$Image = imageCreateTrueColor($width, $height);
 
 		if ($this-&gt;_isTransparent($Medium-&gt;resources['gd'])) {
 			$Image = $this-&gt;_copyTransparency($Medium-&gt;resources['gd'], $Image);
-			imageCopyResized($Image, $Medium-&gt;resources['gd'], 0, 0, 0, 0, $width, $height, $this-&gt;width($Medium), $this-&gt;height($Medium));
+			imageCopyResized(
+				$Image,
+				$Medium-&gt;resources['gd'],
+				0, 0,
+				0, 0,
+				$width, $height,
+				$this-&gt;width($Medium), $this-&gt;height($Medium)
+			);
 		} else {
 			imageSaveAlpha($Image, true);
-			imageCopyResampled($Image, $Medium-&gt;resources['gd'], 0, 0, 0, 0, $width, $height, $this-&gt;width($Medium), $this-&gt;height($Medium));
+			imageCopyResampled(
+				$Image,
+				$Medium-&gt;resources['gd'],
+				0, 0,
+				0, 0,
+				$width, $height,
+				$this-&gt;width($Medium), $this-&gt;height($Medium)
+			);
 		}
 		if ($this-&gt;_isResource($Image)) {
 			$Medium-&gt;resources['gd'] = $Image;
@@ -200,21 +234,35 @@ class GdMediumAdapter extends MediumAdapter {
 	}
 
 	function cropAndResize(&amp;$Medium, $cropLeft, $cropTop, $cropWidth, $cropHeight, $resizeWidth, $resizeHeight) {
-		$cropLeft     = intval($cropLeft);
-		$cropTop      = intval($cropTop);
-		$cropWidth    = intval($cropWidth);
-		$cropHeight   = intval($cropHeight);
-		$resizeWidth  = intval($resizeWidth);
-		$resizeHeight = intval($resizeHeight);
+		$cropLeft     = (integer)$cropLeft;
+		$cropTop      = (integer)$cropTop;
+		$cropWidth    = (integer)$cropWidth;
+		$cropHeight   = (integer)$cropHeight;
+		$resizeWidth  = (integer)$resizeWidth;
+		$resizeHeight = (integer)$resizeHeight;
 
 		$Image = imageCreateTrueColor($resizeWidth, $resizeHeight);
 
 		if ($this-&gt;_isTransparent($Medium-&gt;resources['gd'])) {
 			$Image = $this-&gt;_copyTransparency($Medium-&gt;resources['gd'], $Image);
-			imageCopyResized($Image, $Medium-&gt;resources['gd'], 0, 0, $cropLeft, $cropTop, $resizeWidth, $resizeHeight, $cropWidth, $cropHeight);
+			imageCopyResized(
+				$Image,
+				$Medium-&gt;resources['gd'],
+				0, 0,
+				$cropLeft, $cropTop,
+				$resizeWidth, $resizeHeight,
+				$cropWidth, $cropHeight
+			);
 		} else {
 			imageSaveAlpha($Image, true);
-			imageCopyResampled($Image, $Medium-&gt;resources['gd'], 0, 0, $cropLeft, $cropTop, $resizeWidth, $resizeHeight, $cropWidth, $cropHeight);
+			imageCopyResampled(
+				$Image,
+				$Medium-&gt;resources['gd'],
+				0, 0,
+				$cropLeft, $cropTop,
+				$resizeWidth, $resizeHeight,
+				$cropWidth, $cropHeight
+			);
 		}
 		if ($this-&gt;_isResource($Image)) {
 			$Medium-&gt;resources['gd'] = $Image;</diff>
      <filename>vendors/medium/adapter/gd.php</filename>
    </modified>
    <modified>
      <diff>@@ -61,7 +61,7 @@ class Getid3AudioMediumAdapter extends MediumAdapter {
 			'audio/cda',
 			/*
 			 * This is a reminder since audio Medium shouldn't have 'application/octet-stream'
-			 * mime type.
+			 * MIME type.
 			 *
 			 * LA (Lossless Audio), OptimFROG, TTA, LiteWave,
 			 * RKAU, AVR (Audio Visual Research) and some Ogg files.
@@ -94,7 +94,6 @@ class Getid3AudioMediumAdapter extends MediumAdapter {
 		getid3_lib::CopyTagsToComments($Object-&gt;info);
 
 		$Medium-&gt;objects['getID3'] =&amp; $Object;
-
 		return true;
 	}
 </diff>
      <filename>vendors/medium/adapter/getid3_audio.php</filename>
    </modified>
    <modified>
      <diff>@@ -25,28 +25,27 @@
  */
 class Getid3VideoMediumAdapter extends MediumAdapter {
 	var $require = array(
-					'mimeTypes' =&gt; array(
-								'video/matroska',
-								'video/ms-wmv',
-								'video/ms-asf',
-								'video/ms-video',
-								'video/mpeg',
-								'video/quicktime',
-								'video/avi',
-								'video/mp4',
-								'video/flv',
-								'video/real-video',
-								'video/vnd.rn-realvideo',
-								'video/pn-realvideo',
-								'video/pn-multirate-realvideo',
-								'video/nsv',
-								/* Will not be used since video Medium can't have application/... mime type */
-								'application/shockwave-flash',
-								),
-					'imports' =&gt; array(
-							array('type' =&gt; 'Vendor', 'name'=&gt; 'getID3', 'file' =&gt; 'getid3/getid3.php')
-							),
-					);
+		'mimeTypes' =&gt; array(
+			'video/matroska',
+			'video/ms-wmv',
+			'video/ms-asf',
+			'video/ms-video',
+			'video/mpeg',
+			'video/quicktime',
+			'video/avi',
+			'video/mp4',
+			'video/flv',
+			'video/real-video',
+			'video/vnd.rn-realvideo',
+			'video/pn-realvideo',
+			'video/pn-multirate-realvideo',
+			'video/nsv',
+			/* Will not be used since video Medium can't have application/... MIME type */
+			'application/shockwave-flash',
+		),
+		'imports' =&gt; array(
+			array('type' =&gt; 'Vendor', 'name'=&gt; 'getID3', 'file' =&gt; 'getid3/getid3.php')
+	));
 
 	function initialize(&amp;$Medium) {
 		if (isset($Medium-&gt;objects['getID3'])) {
@@ -65,7 +64,6 @@ class Getid3VideoMediumAdapter extends MediumAdapter {
 		}
 
 		$Medium-&gt;objects['getID3'] =&amp; $Object;
-
 		return true;
 	}
 </diff>
      <filename>vendors/medium/adapter/getid3_video.php</filename>
    </modified>
    <modified>
      <diff>@@ -25,39 +25,39 @@
  */
 class ImagickMediumAdapter extends MediumAdapter {
 	var $require = array(
-						'mimeTypes' =&gt; array( /* readable */
-							'image/jpeg',
-							'image/gif',
-							'image/png',
-							'image/tiff',
-							'image/wpg',
-							'image/xbm',
-							'image/xcf',
-							'image/wbmp',
-							'image/ms-bmp',
-							'image/pcx',
-							'image/quicktime',
-							'image/svg',
-							'image/xpm',
-							'image/ico',
-							'image/psd',
-							'application/pdf',
-							),
-						 'extensions' =&gt; array('imagick'),
-						);
+		'mimeTypes' =&gt; array( /* readable */
+			'image/jpeg',
+			'image/gif',
+			'image/png',
+			'image/tiff',
+			'image/wpg',
+			'image/xbm',
+			'image/xcf',
+			'image/wbmp',
+			'image/ms-bmp',
+			'image/pcx',
+			'image/quicktime',
+			'image/svg',
+			'image/xpm',
+			'image/ico',
+			'image/psd',
+			'application/pdf',
+			),
+		 'extensions' =&gt; array('imagick'),
+	);
 
 	var $_formatMap = array( /* writable */
-						'image/jpeg' =&gt; 'jpeg',
-						'image/gif' =&gt; 'gif',
-						'image/png' =&gt; 'png',
-						'image/tiff' =&gt; 'tiff',
-						'image/wbmp' =&gt; 'wbmp',
-						'image/ms-bmp' =&gt; 'bmp',
-						'image/pcx' =&gt; 'pcx',
-						'image/ico' =&gt; 'ico',
-						'image/xbm' =&gt; 'xbm',
-						'image/psd' =&gt; 'psd',
-						);
+		'image/jpeg' =&gt; 'jpeg',
+		'image/gif' =&gt; 'gif',
+		'image/png' =&gt; 'png',
+		'image/tiff' =&gt; 'tiff',
+		'image/wbmp' =&gt; 'wbmp',
+		'image/ms-bmp' =&gt; 'bmp',
+		'image/pcx' =&gt; 'pcx',
+		'image/ico' =&gt; 'ico',
+		'image/xbm' =&gt; 'xbm',
+		'image/psd' =&gt; 'psd',
+		);
 
 	function initialize(&amp;$Medium) {
 		if (isset($Medium-&gt;objects['Imagick'])) {
@@ -73,7 +73,6 @@ class ImagickMediumAdapter extends MediumAdapter {
 		} catch (Exception $E) {
 			return false;
 		}
-
 		return true;
 	}
 
@@ -109,7 +108,6 @@ class ImagickMediumAdapter extends MediumAdapter {
 		if ($Medium-&gt;name === 'Document') { // application/pdf -&gt; image
 			return Medium::factory($Medium-&gt;objects['Imagick'], $mimeType);
 		}
-
 		return true;
 	}
 
@@ -121,11 +119,11 @@ class ImagickMediumAdapter extends MediumAdapter {
 				break;
 			case 'image/png':
 				$type = Imagick::COMPRESSION_ZIP;
-				$value = intval($value); // FIXME correct ?
+				$value = (integer)$value; // FIXME correct ?
 				break;
 			case 'image/jpeg':
 				$type = Imagick::COMPRESSION_JPEG;
-				$value = intval(100 - ($value * 10));
+				$value = (integer)(100 - ($value * 10));
 				break;
 			default:
 				return true;
@@ -139,10 +137,10 @@ class ImagickMediumAdapter extends MediumAdapter {
 	}
 
 	function crop(&amp;$Medium, $left, $top, $width, $height) {
-		$left   = intval($left);
-		$top    = intval($top);
-		$width  = intval($width);
-		$height = intval($height);
+		$left   = (integer)$left;
+		$top    = (integer)$top;
+		$width  = (integer)$width;
+		$height = (integer)$height;
 
 		try {
 			return $Medium-&gt;objects['Imagick']-&gt;cropImage($width, $height, $left, $top);
@@ -152,8 +150,8 @@ class ImagickMediumAdapter extends MediumAdapter {
 	}
 
 	function resize(&amp;$Medium, $width, $height) {
-		$width  = intval($width);
-		$height = intval($height);
+		$width  = (integer)$width;
+		$height = (integer)$height;
 
 		try {
 			return $Medium-&gt;objects['Imagick']-&gt;resizeImage($width, $height, Imagick::FILTER_LANCZOS, 1);</diff>
      <filename>vendors/medium/adapter/imagick.php</filename>
    </modified>
    <modified>
      <diff>@@ -25,38 +25,38 @@
  */
 class ImagickShellMediumAdapter extends MediumAdapter {
 	var $require = array(
-						'mimeTypes' =&gt; array( /* readable */
-							'image/jpeg',
-							'image/gif',
-							'image/png',
-							'image/tiff',
-							'image/wpg',
-							'image/xbm',
-							'image/xcf',
-							'image/wbmp',
-							'image/ms-bmp',
-							'image/pcx',
-							'image/quicktime',
-							'image/svg',
-							'image/xpm',
-							'image/ico',
-							'image/psd',
-							),
-						 'commands' =&gt; array('convert', 'identify'),
-						);
+		'mimeTypes' =&gt; array( /* readable */
+			'image/jpeg',
+			'image/gif',
+			'image/png',
+			'image/tiff',
+			'image/wpg',
+			'image/xbm',
+			'image/xcf',
+			'image/wbmp',
+			'image/ms-bmp',
+			'image/pcx',
+			'image/quicktime',
+			'image/svg',
+			'image/xpm',
+			'image/ico',
+			'image/psd',
+			),
+		 'commands' =&gt; array('convert', 'identify'),
+	);
 
 	var $_formatMap = array( /* writable */
-						'image/jpeg' =&gt; 'jpeg',
-						'image/gif' =&gt; 'gif',
-						'image/png' =&gt; 'png',
-						'image/tiff' =&gt; 'tiff',
-						'image/wbmp' =&gt; 'wbmp',
-						'image/ms-bmp' =&gt; 'bmp',
-						'image/pcx' =&gt; 'pcx',
-						'image/ico' =&gt; 'ico',
-						'image/xbm' =&gt; 'xbm',
-						'image/psd' =&gt; 'psd',
-						);
+		'image/jpeg' =&gt; 'jpeg',
+		'image/gif' =&gt; 'gif',
+		'image/png' =&gt; 'png',
+		'image/tiff' =&gt; 'tiff',
+		'image/wbmp' =&gt; 'wbmp',
+		'image/ms-bmp' =&gt; 'bmp',
+		'image/pcx' =&gt; 'pcx',
+		'image/ico' =&gt; 'ico',
+		'image/xbm' =&gt; 'xbm',
+		'image/psd' =&gt; 'psd',
+	);
 
 	var $_temporaryFormat = 'png';
 	var $_compressionType;
@@ -78,24 +78,22 @@ class ImagickShellMediumAdapter extends MediumAdapter {
 			$Medium-&gt;files['temporary'] = TMP . uniqid('medium_');
 		}
 
-		return $this-&gt;_execute(':command: :source: :format:::destination:',
-								array(
-									  'command'     =&gt; 'convert',
-									  'source'      =&gt; $Medium-&gt;file,
-									  'destination' =&gt; $Medium-&gt;files['temporary'],
-									  'format'      =&gt; $this-&gt;_temporaryFormat,
-									 )
-								 );
+		return $this-&gt;_execute(':command: :source: :format:::destination:',	array(
+			'command'     =&gt; 'convert',
+			'source'      =&gt; $Medium-&gt;file,
+			'destination' =&gt; $Medium-&gt;files['temporary'],
+			'format'      =&gt; $this-&gt;_temporaryFormat
+		 ));
 	}
 
 	function store(&amp;$Medium, $file) {
 		$args =	array(
-				  'command'      =&gt; 'convert',
-				  'source'       =&gt; $Medium-&gt;files['temporary'],
-				  'sourceFormat' =&gt; $this-&gt;_temporaryFormat,
-				  'destination'  =&gt; $file,
-				  'format'       =&gt; $this-&gt;_formatMap[$Medium-&gt;mimeType],
-				 );
+			'command'      =&gt; 'convert',
+			'source'       =&gt; $Medium-&gt;files['temporary'],
+			'sourceFormat' =&gt; $this-&gt;_temporaryFormat,
+			'destination'  =&gt; $file,
+			'format'       =&gt; $this-&gt;_formatMap[$Medium-&gt;mimeType],
+		);
 
 		if (isset($this-&gt;_compressionType)) {
 			$args['compress'] = $this-&gt;_compressionType;
@@ -130,7 +128,6 @@ class ImagickShellMediumAdapter extends MediumAdapter {
 
 			return Medium::factory(array('temporary' =&gt; $temporary), $mimeType);
 		}
-
 		return true;
 	}
 
@@ -141,41 +138,37 @@ class ImagickShellMediumAdapter extends MediumAdapter {
 				break;
 			case 'image/png':
 				$this-&gt;_compressionType = 'ZIP';
-				$this-&gt;_compression = intval($value);
+				$this-&gt;_compression = (integer)$value;
 				$this-&gt;_pngFilter = ($value * 10) % 10;
 				break;
 			case 'image/jpeg':
 				$this-&gt;_compressionType = 'JPEG';
-				$this-&gt;_compression = intval(100 - ($value * 10));
+				$this-&gt;_compression = (integer)(100 - ($value * 10));
 				break;
 		}
 		return true;
 	}
 
 	function crop(&amp;$Medium, $left, $top, $width, $height) {
-		return $this-&gt;_execute(':command: -crop :width:x:height:+:left:+:top: :source: :destination:',
-								array(
-									  'command'     =&gt; 'convert',
-									  'width'       =&gt; intval($width),
-									  'height'      =&gt; intval($height),
-									  'left'		=&gt; intval($left),
-									  'top'			=&gt; intval($top),
-									  'source'      =&gt; $Medium-&gt;files['temporary'],
-									  'destination' =&gt; $Medium-&gt;files['temporary'],
-									 )
-								 );
+		return $this-&gt;_execute(':command: -crop :width:x:height:+:left:+:top: :source: :destination:', array(
+			'command'     =&gt; 'convert',
+			'width'       =&gt; (integer)$width,
+			'height'      =&gt; (integer)$height,
+			'left'        =&gt; (integer)$left,
+			'top'         =&gt; (integer)$top,
+			'source'      =&gt; $Medium-&gt;files['temporary'],
+			'destination' =&gt; $Medium-&gt;files['temporary'],
+		));
 	}
 
 	function resize(&amp;$Medium, $width, $height) {
-		return $this-&gt;_execute(':command: -geometry :width:x:height:! :source: :destination:',
-								array(
-									  'command'     =&gt; 'convert',
-									  'width'       =&gt; intval($width),
-									  'height'      =&gt; intval($height),
-									  'source'      =&gt; $Medium-&gt;files['temporary'],
-									  'destination' =&gt; $Medium-&gt;files['temporary'],
-									 )
-								 );
+		return $this-&gt;_execute(':command: -geometry :width:x:height:! :source: :destination:', array(
+			'command'     =&gt; 'convert',
+			'width'       =&gt; (integer)$width,
+			'height'      =&gt; (integer)$height,
+			'source'      =&gt; $Medium-&gt;files['temporary'],
+			'destination' =&gt; $Medium-&gt;files['temporary'],
+		));
 	}
 
 	function cropAndResize(&amp;$Medium, $cropLeft, $cropTop, $cropWidth, $cropHeight, $resizeWidth, $resizeHeight) {
@@ -200,21 +193,17 @@ class ImagickShellMediumAdapter extends MediumAdapter {
 	}
 
 	function width(&amp;$Medium) {
-		return $this-&gt;_execute(':command: -format %w :file:',
-								array(
-									  'command'     =&gt; 'identify',
-									  'file' =&gt; $Medium-&gt;files['temporary'],
-									 )
-								 );
+		return $this-&gt;_execute(':command: -format %w :file:', array(
+			'command'     =&gt; 'identify',
+			'file' =&gt; $Medium-&gt;files['temporary'],
+		));
 	}
 
 	function height(&amp;$Medium) {
-		return $this-&gt;_execute(':command: -format %h :file:',
-								array(
-									  'command'     =&gt; 'identify',
-									  'file' =&gt; $Medium-&gt;files['temporary'],
-									 )
-								 );
+		return $this-&gt;_execute(':command: -format %h :file:', array(
+			'command'     =&gt; 'identify',
+			 'file' =&gt; $Medium-&gt;files['temporary'],
+		));
 	}
 }
 ?&gt;</diff>
      <filename>vendors/medium/adapter/imagick_shell.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
- &lt;?php
+&lt;?php
  /**
  * Jsmin Medium Adapter File
  *
@@ -24,11 +24,10 @@
  * @link       http://code.google.com/p/jsmin-php/
  */
 class JsminMediumAdapter extends MediumAdapter {
-
 	var $require = array(
-							'mimeTypes' =&gt; array('application/javascript'),
-							'imports' =&gt; array(array('type' =&gt; 'Vendor', 'name'=&gt; 'JSMin', 'file' =&gt; 'jsmin.php')),
-							);
+		'mimeTypes' =&gt; array('application/javascript'),
+		'imports' =&gt; array(array('type' =&gt; 'Vendor', 'name'=&gt; 'JSMin', 'file' =&gt; 'jsmin.php')),
+	);
 
 	function initialize(&amp;$Medium) {
 		if (isset($Medium-&gt;contents['raw'])) {
@@ -38,7 +37,6 @@ class JsminMediumAdapter extends MediumAdapter {
 		if (!isset($Medium-&gt;file)) {
 			return false;
 		}
-
 		return $Medium-&gt;contents['raw'] = file_get_contents($Medium-&gt;file);
 	}
 </diff>
      <filename>vendors/medium/adapter/jsmin.php</filename>
    </modified>
    <modified>
      <diff>@@ -25,13 +25,10 @@
  */
 class PearMp3MediumAdapter extends MediumAdapter {
 	var $require = array(
-							'mimeTypes' =&gt; array(
-									'audio/mpeg'
-									),
-							'imports' =&gt; array(
-									array('type' =&gt; 'Vendor','name'=&gt; 'MP3_Id','file' =&gt; 'MP3/Id.php')
-									),
-							);
+		'mimeTypes' =&gt; array('audio/mpeg'),
+		'imports' =&gt; array(
+			array('type' =&gt; 'Vendor','name'=&gt; 'MP3_Id','file' =&gt; 'MP3/Id.php')
+	));
 
 	function initialize(&amp;$Medium) {
 		if (isset($Medium-&gt;objects['MP3_Id'])) {
@@ -47,7 +44,6 @@ class PearMp3MediumAdapter extends MediumAdapter {
 		$Object-&gt;study();
 
 		$Medium-&gt;objects['MP3_Id'] =&amp; $Object;
-
 		return true;
 	}
 </diff>
      <filename>vendors/medium/adapter/pear_mp3.php</filename>
    </modified>
    <modified>
      <diff>@@ -25,13 +25,10 @@
  */
 class PearOggAudioMediumAdapter extends MediumAdapter {
 	var $require = array(
-							'mimeTypes' =&gt; array(
-									'audio/ogg'
-									),
-							'imports' =&gt; array(
-									array('type' =&gt; 'Vendor','name'=&gt; 'File_Ogg','file' =&gt; 'File/Ogg.php')
-									),
-							);
+		'mimeTypes' =&gt; array('audio/ogg'),
+		'imports' =&gt; array(
+			array('type' =&gt; 'Vendor','name'=&gt; 'File_Ogg','file' =&gt; 'File/Ogg.php')
+	));
 
 	function initialize(&amp;$Medium) {
 		if (isset($Medium-&gt;objects['File_Ogg_Vorbis'])) {
@@ -55,7 +52,6 @@ class PearOggAudioMediumAdapter extends MediumAdapter {
 		}
 
 		$Medium-&gt;objects['File_Ogg_Vorbis'] =&amp; $Object;
-
 		return true;
 	}
 </diff>
      <filename>vendors/medium/adapter/pear_ogg_audio.php</filename>
    </modified>
    <modified>
      <diff>@@ -25,13 +25,10 @@
  */
 class PearOggVideoMediumAdapter extends MediumAdapter {
 	var $require = array(
-							'mimeTypes' =&gt; array(
-									'video/ogg'
-									),
-							'imports' =&gt; array(
-									array('type' =&gt; 'Vendor', 'name' =&gt; 'File_Ogg', 'file' =&gt; 'File/Ogg.php')
-									),
-							);
+		'mimeTypes' =&gt; array('video/ogg'),
+		'imports' =&gt; array(
+			array('type' =&gt; 'Vendor', 'name' =&gt; 'File_Ogg', 'file' =&gt; 'File/Ogg.php')
+	));
 
 	function initialize(&amp;$Medium) {
 		if (isset($Medium-&gt;objects['File_Ogg_Theora'])) {
@@ -55,7 +52,6 @@ class PearOggVideoMediumAdapter extends MediumAdapter {
 		}
 
 		$Medium-&gt;objects['File_Ogg_Theora'] = $Object;
-
 		return true;
 	}
 </diff>
      <filename>vendors/medium/adapter/pear_ogg_video.php</filename>
    </modified>
    <modified>
      <diff>@@ -25,9 +25,10 @@
  */
 class PearTextMediumAdapter extends MediumAdapter {
 	var $require = array(
-							'mimeTypes' =&gt; array('text/plain'),
-							'imports' =&gt; array(array('type' =&gt; 'Vendor','name' =&gt; 'Text_Statistics','file' =&gt; 'Text/Statistics.php')),
-							);
+		'mimeTypes' =&gt; array('text/plain'),
+		'imports' =&gt; array(
+			array('type' =&gt; 'Vendor','name' =&gt; 'Text_Statistics','file' =&gt; 'Text/Statistics.php')
+	));
 
 	function initialize(&amp;$Medium) {
 		if (isset($Medium-&gt;objects['Text_Statistics'])) {
@@ -45,7 +46,6 @@ class PearTextMediumAdapter extends MediumAdapter {
 		}
 
 		$Medium-&gt;objects['Text_Statistics'] = @new Text_Statistics($Medium-&gt;contents['raw']);
-
 		return true;
 	}
 
@@ -69,7 +69,7 @@ class PearTextMediumAdapter extends MediumAdapter {
 	}
 
 	function lexicalDensity() {
-		return round(($this-&gt;_Text-&gt;uniqWords / $this-&gt;_Text-&gt;numWords) * 100,0);
+		return round(($this-&gt;_Text-&gt;uniqWords / $this-&gt;_Text-&gt;numWords) * 100, 0);
 	}
 }
 ?&gt;
\ No newline at end of file</diff>
      <filename>vendors/medium/adapter/pear_text.php</filename>
    </modified>
    <modified>
      <diff>@@ -24,93 +24,84 @@ App::import('Vendor', 'Media.Medium');
  * @subpackage media.libs.medium
  */
 class AudioMedium extends Medium {
-	/**
-	 * Compatible adapters
-	 *
-	 * @var array
-	 */
+/**
+ * Compatible adapters
+ *
+ * @var array
+ */
 	var $adapters = array('Getid3Audio', 'FfmpegAudio', 'PearMp3', 'PearOggAudio');
-
-	/**
-	 * Artist stored in medium metadata
-	 *
-	 * @return mixed String if metadata info exists, else null
-	 */
+/**
+ * Artist stored in medium metadata
+ *
+ * @return mixed String if metadata info exists, else null
+ */
 	function artist() {
 		return trim($this-&gt;Adapters-&gt;dispatchMethod($this, 'artist'));
 	}
-
-	/**
-	 * Title stored in medium metadata
-	 *
-	 * @return mixed String if metadata info exists, else null
-	 */
+/**
+ * Title stored in medium metadata
+ *
+ * @return mixed String if metadata info exists, else null
+ */
 	function title() {
 		return trim($this-&gt;Adapters-&gt;dispatchMethod($this, 'title'));
 	}
-
-	/**
-	 * Album name stored in medium metadata
-	 *
-	 * @return mixed String if metadata info exists, else null
-	 */
+/**
+ * Album name stored in medium metadata
+ *
+ * @return mixed String if metadata info exists, else null
+ */
 	function album() {
 		return trim($this-&gt;Adapters-&gt;dispatchMethod($this, 'album'));
 	}
-
-	/**
-	 * Year stored in medium metadata
-	 *
-	 * @return mixed Integer if metadata info exists, else null
-	 */
+/**
+ * Year stored in medium metadata
+ *
+ * @return mixed Integer if metadata info exists, else null
+ */
 	function year() {
 		return (integer)$this-&gt;Adapters-&gt;dispatchMethod($this, 'year');
 	}
-
-	/**
-	 * Track number stored in medium metadata
-	 *
-	 * @return mixed Integer if metadata info exists, else null
-	 */
+/**
+ * Track number stored in medium metadata
+ *
+ * @return mixed Integer if metadata info exists, else null
+ */
 	function track() {
 		return (integer)$this-&gt;Adapters-&gt;dispatchMethod($this, 'track');
 	}
-
-	/**
-	 * Duration in seconds
-	 *
-	 * @return integer
-	 */
+/**
+ * Duration in seconds
+ *
+ * @return integer
+ */
 	function duration() {
 		return (integer)$this-&gt;Adapters-&gt;dispatchMethod($this, 'duration');
 	}
-
-	/**
-	 * Current sampling rate of medium
-	 *
-	 * @url http://en.wikipedia.org/wiki/Sampling_rate
-	 * @return integer
-	 */
+/**
+ * Current sampling rate of medium
+ *
+ * @url http://en.wikipedia.org/wiki/Sampling_rate
+ * @return integer
+ */
 	function samplingRate() {
 		return (integer)$this-&gt;Adapters-&gt;dispatchMethod($this, 'samplingRate');
 	}
-
-	/**
-	 * Current bitrate of medium
-	 *
-	 * @url http://en.wikipedia.org/wiki/Bit_rate
-	 * @return integer
-	 */
+/**
+ * Current bitrate of medium
+ *
+ * @url http://en.wikipedia.org/wiki/Bit_rate
+ * @return integer
+ */
 	function bitrate() {
 		return (integer)$this-&gt;Adapters-&gt;dispatchMethod($this, 'bitrate');
 	}
-
-	/**
-	* Determines the quality of the medium by
-	* taking bitrate into account
-	 *
-	 * @return integer A number indicating quality between 1 (worst) and 5 (best)
-	 */
+/**
+ * Determines the quality of the medium by
+ * taking bitrate into account
+ *
+ * @return integer A number indicating quality between 1 (worst) and 5 (best)
+ */
 	function quality() {
 		if (!$bitrate = $this-&gt;bitrate()) {
 			return null;
@@ -132,7 +123,6 @@ class AudioMedium extends Medium {
 				* ($qualityMax - $qualityMin)
 				+ $qualityMin;
 		}
-
 		return (integer)round($quality);
 	}
 }</diff>
      <filename>vendors/medium/audio.php</filename>
    </modified>
    <modified>
      <diff>@@ -24,25 +24,25 @@ App::import('Vendor', 'Media.Medium');
  * @subpackage media.libs.medium
  */
 class CssMedium extends Medium {
-	/**
-	 * Compatible adapters
-	 *
-	 * @var array
-	 */
+/**
+ * Compatible adapters
+ *
+ * @var array
+ */
 	var $adapters = array('CssTidy', 'BasicText');
-	/**
-	 * Number of characters
-	 *
-	 * @return integer
-	 */
+/**
+ * Number of characters
+ *
+ * @return integer
+ */
 	function characters() {
-		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'characters');
+		return (integer)$this-&gt;Adapters-&gt;dispatchMethod($this, 'characters');
 	}
-	/**
-	 * Compresses contents. of the medium
-	 *
-	 * @return string
-	 */
+/**
+ * Compresses contents. of the medium
+ *
+ * @return string
+ */
 	function compress() {
 		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'compress');
 	}</diff>
      <filename>vendors/medium/css.php</filename>
    </modified>
    <modified>
      <diff>@@ -24,33 +24,33 @@ App::import('Vendor', 'Media.Medium');
  * @subpackage media.libs.medium
  */
 class DocumentMedium extends Medium {
-	/**
-	 * Compatible adapters
-	 *
-	 * @var array
-	 */
+/**
+ * Compatible adapters
+ *
+ * @var array
+ */
 	var $adapters = array('Imagick', 'ImagickShell');
-	/**
-	 * Current width of medium
-	 *
-	 * @return int
-	 */
+/**
+ * Current width of medium
+ *
+ * @return integer
+ */
 	function width()	{
-		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'width');
+		return (integer)$this-&gt;Adapters-&gt;dispatchMethod($this, 'width');
 	}
-	/**
-	 * Current height of medium
-	 *
-	 * @return int
-	 */
+/**
+ * Current height of medium
+ *
+ * @return integer
+ */
 	function height() {
-		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'height');
+		return (integer)$this-&gt;Adapters-&gt;dispatchMethod($this, 'height');
 	}
-	/**
-	 * Determines a (known) ratio of medium
-	 *
-	 * @return mixed if String if $known is true or float if false
-	 */
+/**
+ * Determines a (known) ratio of medium
+ *
+ * @return mixed if String if $known is true or float if false
+ */
 	function ratio($known = true) {
 		if (!$known) {
 			return $this-&gt;width() / $this-&gt;height();</diff>
      <filename>vendors/medium/document.php</filename>
    </modified>
    <modified>
      <diff>@@ -23,5 +23,6 @@ App::import('Vendor', 'Media.Medium');
  * @package    media
  * @subpackage media.libs.medium
  */
-class GenericMedium extends Medium {}
+class GenericMedium extends Medium {
+}
 ?&gt;
\ No newline at end of file</diff>
      <filename>vendors/medium/generic.php</filename>
    </modified>
    <modified>
      <diff>@@ -25,5 +25,6 @@ if (!class_exists('ImageMedium')) {
  * @package    media
  * @subpackage media.libs.medium
  */
-class IconMedium extends ImageMedium {}
+class IconMedium extends ImageMedium {
+}
 ?&gt;
\ No newline at end of file</diff>
      <filename>vendors/medium/icon.php</filename>
    </modified>
    <modified>
      <diff>@@ -24,30 +24,30 @@ App::import('Vendor', 'Media.Medium');
  * @subpackage media.libs.medium
  */
 class ImageMedium extends Medium {
-	/**
-	 * Compatible adapters
-	 *
-	 * @var array
-	 */
+/**
+ * Compatible adapters
+ *
+ * @var array
+ */
 	var $adapters = array('BasicImage', 'Imagick',  'Gd', 'ImagickShell');
-	/**
-	 * Alias for fitInside
-	 *
-	 * @param int $width
-	 * @param int $height
-	 * @return bool
-	 */
+/**
+ * Alias for fitInside
+ *
+ * @param integer $width
+ * @param integer $height
+ * @return boolean
+ */
 	function fit($width, $height) {
 		return $this-&gt;fitInside($width, $height);
 	}
-	/**
-	 * Resizes medium proportionally
-	 * keeping both sides within given dimensions
-	 *
-	 * @param int $width
-	 * @param int $height
-	 * @return bool
-	 */
+/**
+ * Resizes medium proportionally
+ * keeping both sides within given dimensions
+ *
+ * @param integer $width
+ * @param integer $height
+ * @return boolean
+ */
 	function fitInside($width, $height) {
 		$rx = $this-&gt;width() / $width;
 		$ry = $this-&gt;height() / $height;
@@ -61,17 +61,17 @@ class ImageMedium extends Medium {
 		$width = $this-&gt;width() / $r;
 		$height = $this-&gt;height() / $r;
 
-		$args = $this-&gt;_normalizeDimensions($width, $height, 'maximum'); // maximum ???
+		$args = $this-&gt;_normalizeDimensions($width, $height, 'maximum'); /* maximum ?? */
 		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'resize', $args);
 	}
-	/**
-	 * Resizes medium proportionally
-	 * keeping smaller side within corresponding dimensions
-	 *
-	 * @param int $width
-	 * @param int $height
-	 * @return bool
-	 */
+/**
+ * Resizes medium proportionally
+ * keeping smaller side within corresponding dimensions
+ *
+ * @param integer $width
+ * @param integer $height
+ * @return boolean
+ */
 	function fitOutside($width, $height) {
 		$rx = $this-&gt;width() / $width;
 		$ry = $this-&gt;height() / $height;
@@ -88,35 +88,35 @@ class ImageMedium extends Medium {
 		$args = $this-&gt;_normalizeDimensions($width, $height, 'ratio');
 		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'resize', $args);
 	}
-	/**
-	 * Crops medium to provided dimensions
-	 *
-	 * @param int $width
-	 * @param int $height
-	 * @return bool
-	 */
+/**
+ * Crops medium to provided dimensions
+ *
+ * @param integer $width
+ * @param integer $height
+ * @return boolean
+ */
 	function crop($width, $height) {
 		list($width, $height) = $this-&gt;_normalizeDimensions($width, $height, 'maximum');
 		list($left, $top) = $this-&gt;_boxify($width, $height);
 		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'crop', array($left, $top, $width, $height));
 	}
-	/**
-	 * Alias for zoomFit
-	 *
-	 * @param int $width
-	 * @param int $height
-	 * @return bool
-	 */
+/**
+ * Alias for zoomFit
+ *
+ * @param integer $width
+ * @param integer $height
+ * @return boolean
+ */
 	function zoom($width, $height) {
 		return $this-&gt;zoomFit($width, $height);
 	}
-	/**
-	 * Enlarges medium proportionally by factor 2
-	 *
-	 * @param int $width
-	 * @param int $height
-	 * @return bool
-	 */
+/**
+ * Enlarges medium proportionally by factor 2
+ *
+ * @param integer $width
+ * @param integer $height
+ * @return boolean
+ */
 	function zoomFit($width, $height) {
 		$factor = 2;
 
@@ -125,15 +125,15 @@ class ImageMedium extends Medium {
 
 		return $this-&gt;fitOutside($width, $height);
 	}
-	/**
-	 * First crops an area (given by dimensions and enlarged by factor 2)
-	 * out of the center of the medium, then resizes that cropped
-	 * area to given dimensions
-	 *
-	 * @param int $width
-	 * @param int $height
-	 * @return bool
-	 */
+/**
+ * First crops an area (given by dimensions and enlarged by factor 2)
+ * out of the center of the medium, then resizes that cropped
+ * area to given dimensions
+ *
+ * @param integer $width
+ * @param integer $height
+ * @return boolean
+ */
 	function zoomCrop($width, $height, $gravity = 'center') {
 		$factor = 2;
 
@@ -141,17 +141,21 @@ class ImageMedium extends Medium {
 		list($zoomLeft, $zoomTop) = $this-&gt;_boxify($zoomWidth, $zoomHeight, $gravity);
 		list($width, $height) = array($zoomWidth / $factor, $zoomHeight / $factor);
 
-		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'cropAndResize', array($zoomLeft, $zoomTop, $zoomWidth, $zoomHeight, $width, $height));
+		return $this-&gt;Adapters-&gt;dispatchMethod(
+			$this,
+			'cropAndResize',
+			array($zoomLeft, $zoomTop, $zoomWidth, $zoomHeight, $width, $height)
+		);
 	}
-	/**
-	 * First resizes medium so that it fills out the given dimensions,
-	 * then cuts off overlapping parts
-	 *
-	 * @param int $width
-	 * @param int $height
-	 * @param string $align
-	 * @return bool
-	 */
+/**
+ * First resizes medium so that it fills out the given dimensions,
+ * then cuts off overlapping parts
+ *
+ * @param integer $width
+ * @param integer $height
+ * @param string $align
+ * @return boolean
+ */
 	function fitCrop($width, $height, $gravity = 'center') {
 		$rx = $this-&gt;width() / $width;
 		$ry = $this-&gt;height() / $height;
@@ -169,45 +173,46 @@ class ImageMedium extends Medium {
 		list($left, $top) = $this-&gt;_boxify($width, $height, $gravity);
 		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'crop', array($left, $top, $width, $height));
 	}
-	/**
-	 * Current width of medium
-	 *
-	 * @return int
-	 */
+/**
+ * Current width of medium
+ *
+ * @return integer
+ */
 	function width()	{
-		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'width');
+		return (integer)$this-&gt;Adapters-&gt;dispatchMethod($this, 'width');
 	}
-	/**
-	 * Current height of medium
-	 *
-	 * @return int
-	 */
+/**
+ * Current height of medium
+ *
+ * @return integer
+ */
 	function height() {
-		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'height');
+		return (integer)$this-&gt;Adapters-&gt;dispatchMethod($this, 'height');
 	}
-	/**
-	 * Selects compression type and filters than compresses the medium
-	 * according to provided value
-	 *
-	 * Compressing may result in lossy quality for e.g. jpeg but
-	 * not for png images. The decimal place denotes the type of filter
-	 * used and the number as a whole the (rounded) compression value.
-	 *
-	 * @param float $value Zero for no compression at all or a value between 0 and 9.9999999 (highest compression); defaults to 1.5
-	 * @return bool
-	 */
+/**
+ * Selects compression type and filters than compresses the medium
+ * according to provided value
+ *
+ * Compressing may result in lossy quality for e.g. jpeg but
+ * not for png images. The decimal place denotes the type of filter
+ * used and the number as a whole the (rounded) compression value.
+ *
+ * @param float $value Zero for no compression at all or a value between 0 and 9.9999999
+ * 	(highest compression); defaults to 1.5
+ * @return boolean
+ */
 	function compress($value = 1.5) {
 		if ($value &lt; 0 || $value &gt;= 10) {
 			return false;
 		}
 		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'compress', array(floatval($value)));
 	}
-	/**
-	 * Determines the quality of the medium by
-	 * taking amount of megapixels into account
-	 *
-	 * @return integer A number indicating quality between 1 (worst) and 5 (best)
-	 */
+/**
+ * Determines the quality of the medium by
+ * taking amount of megapixels into account
+ *
+ * @return integer A number indicating quality between 1 (worst) and 5 (best)
+ */
 	function quality() {
 		$megapixel = $this-&gt;megapixel();
 
@@ -227,36 +232,36 @@ class ImageMedium extends Medium {
 				* ($qualityMax - $qualityMin)
 				+ $qualityMin;
 		}
-
-		return intval(round($quality));
+		return (integer)round($quality);
 	}
-	/**
-	 * Determines a (known) ratio of medium
-	 *
-	 * @return mixed String if $known is true or float if false
-	 */
+/**
+ * Determines a (known) ratio of medium
+ *
+ * @return mixed String if $known is true or float if false
+ */
 	function ratio($known = true) {
 		if (!$known) {
 			return $this-&gt;width() / $this-&gt;height();
 		}
 		return $this-&gt;_knownRatio($this-&gt;width(), $this-&gt;height());
 	}
-	/**
-	 * Determines megapixels of medium
-	 *
-	 * @return integer
-	 */
+/**
+ * Determines megapixels of medium
+ *
+ * @return integer
+ */
 	function megapixel() {
-		return intval($this-&gt;width() * $this-&gt;height() / 1000000);
+		return (integer)($this-&gt;width() * $this-&gt;height() / 1000000);
 	}
-	/**
-	 * Normalizes dimensions
-	 *
-	 * @param int $width
-	 * @param int $height
-	 * @param int $set Either &quot;ratio&quot; or &quot;maximum&quot; Maximum replaces sizes execeeding limits with medium's corresponding size
-	 * @return array An array containing width and height
-	 */
+/**
+ * Normalizes dimensions
+ *
+ * @param integer $width
+ * @param integer $height
+ * @param integer $set Either &quot;ratio&quot; or &quot;maximum&quot; Maximum replaces sizes execeeding limits
+ * 	with medium's corresponding size
+ * @return array An array containing width and height
+ */
 	function _normalizeDimensions($width, $height, $set = 'ratio') {
 		if ($width &gt; $this-&gt;width()) {
 			$width = null;
@@ -287,17 +292,16 @@ class ImageMedium extends Medium {
 				$height = $ratio * $this-&gt;height();
 			}
 		}
-
 		return array($width, $height);
 	}
-	/**
-	 * Calculates a box coordinates
-	 *
-	 * @param int $width
-	 * @param int $height
-	 * @param string $align Currently &quot;center&quot; is supported only
-	 * @return array An array containing left and top coordinates
-	 */
+/**
+ * Calculates a box coordinates
+ *
+ * @param integer $width
+ * @param integer $height
+ * @param string $align Currently &quot;center&quot; is supported only
+ * @return array An array containing left and top coordinates
+ */
 	function _boxify($width, $height, $gravity = 'center') {
 		if ($width &gt; $this-&gt;width()) {
 			$left = 0;
@@ -310,7 +314,6 @@ class ImageMedium extends Medium {
 		} else {
 			$top = ($this-&gt;height() - $height) / 2;
 		}
-
 		return array($left, $top);
 	}
 }</diff>
      <filename>vendors/medium/image.php</filename>
    </modified>
    <modified>
      <diff>@@ -24,26 +24,26 @@ App::import('Vendor', 'Media.Medium');
  * @subpackage media.libs.medium
  */
 class JsMedium extends Medium {
-	/**
-	 * Compatible adapters
-	 *
-	 * @var array
-	 */
-	var $adapters = array(/* 'JavascriptPacker', */ 'Jsmin', 'BasicText');
-	/**
-	 * Number of characters
-	 *
-	 * @return integer
-	 */
+/**
+ * Compatible adapters
+ *
+ * @var array
+ */
+	var $adapters = array('Jsmin', 'BasicText');
+/**
+ * Number of characters
+ *
+ * @return integer
+ */
 	function characters() {
-		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'characters');
+		return (integer)$this-&gt;Adapters-&gt;dispatchMethod($this, 'characters');
 	}
-	/**
-	 * Compresses contents. of the medium
-	 *
-	 * @return string
-	 */
-	function compress() {
+/**
+ * Compresses contents. of the medium
+ *
+ * @return string
+ */
+	function compress()  {
 		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'compress');
 	}
 }</diff>
      <filename>vendors/medium/js.php</filename>
    </modified>
    <modified>
      <diff>@@ -85,41 +85,41 @@ class Medium extends Object {
  */
 	var $mimeType;
 /**
- * Mapping mime type (part) to medium name
+ * Mapping MIME type (part) to medium name
  *
  * @var array
  */
 	static $_mimeTypesToNames = array(
-					'image/icon'            =&gt; 'Icon',
-					'application/pdf'       =&gt; 'Document',
-					'application/msword'    =&gt; 'Document',
-					'text/css'              =&gt; 'Css',
-					'text/javascript'       =&gt; 'Js',
-					'text/code'             =&gt; 'Generic',
-					'text/rtf'              =&gt; 'Document',
-					'text/plain'            =&gt; 'Text',
-					'image/'                =&gt; 'Image',
-					'audio/'                =&gt; 'Audio',
-					'video/'                =&gt; 'Video',
-					'text/'                 =&gt; 'Generic',
-					'/'                     =&gt; 'Generic',
-					);
+		'image/icon'            =&gt; 'Icon',
+		'application/pdf'       =&gt; 'Document',
+		'application/msword'    =&gt; 'Document',
+		'text/css'              =&gt; 'Css',
+		'text/javascript'       =&gt; 'Js',
+		'text/code'             =&gt; 'Generic',
+		'text/rtf'              =&gt; 'Document',
+		'text/plain'            =&gt; 'Text',
+		'image/'                =&gt; 'Image',
+		'audio/'                =&gt; 'Audio',
+		'video/'                =&gt; 'Video',
+		'text/'                 =&gt; 'Generic',
+		'/'                     =&gt; 'Generic',
+	);
 /**
  * Mapping medium name to short medium name
  *
  * @var array
  */
 	static $_namesToShort = array(
-					'Audio'    =&gt; 'aud',
-					'Css'      =&gt; 'css',
-					'Document' =&gt; 'doc',
-					'Generic'  =&gt; 'gen',
-					'Icon'     =&gt; 'ico',
-					'Image'    =&gt; 'img',
-					'Js'       =&gt; 'js',
-					'Text'     =&gt; 'txt',
-					'Video'    =&gt; 'vid',
-					);
+		'Audio'    =&gt; 'aud',
+		'Css'      =&gt; 'css',
+		'Document' =&gt; 'doc',
+		'Generic'  =&gt; 'gen',
+		'Icon'     =&gt; 'ico',
+		'Image'    =&gt; 'img',
+		'Js'       =&gt; 'js',
+		'Text'     =&gt; 'txt',
+		'Video'    =&gt; 'vid',
+	);
 /**
  * Constructor
  *
@@ -132,7 +132,8 @@ class Medium extends Object {
  *  array of absolute paths to files
  *
  * @param mixed $file See description above
- * @param string $mimeType A valid mime type, provide if autodetection fails upon $file or to save the cost for an extra MimeType::detectType call
+ * @param string $mimeType A valid MIME type, provide if autodetection fails upon $file
+ * 	or to save the cost for an extra MimeType::detectType call
  */
 	function __construct($file, $mimeType = null) {
 		if (is_resource($file)) {
@@ -170,8 +171,10 @@ class Medium extends Object {
 	}
 /**
  * Destructor
+ *
  * Deletes temporary files
  *
+ * @return void
  */
 	function __destruct() {
 		if (isset($this-&gt;files['temporary']) &amp;&amp; file_exists($this-&gt;files['temporary'])) {
@@ -183,6 +186,7 @@ class Medium extends Object {
  *
  * @param string $method
  * @param array $args
+ * @return void
  */
 	function __call($method, $args) {
 	}
@@ -205,14 +209,16 @@ class Medium extends Object {
 		$class = $name . 'Medium';
 
 		if (!class_exists($class)) {
-			App::import('Vendor', 'Media.' . $class, array('file' =&gt; 'medium' . DS . strtolower($name) . '.php'));
+			App::import('Vendor', 'Media.' . $class, array(
+				'file' =&gt; 'medium' . DS . strtolower($name) . '.php'
+			));
 		}
 
 		$Object = new $class($file, $mimeType);
 		return $Object;
 	}
 /**
- * Determines medium name for a file or mime type
+ * Determines medium name for a file or MIME type
  *
  * In the case of there are no arguments passed to this method
  * the values of $_mimeTypesToNames are returned
@@ -238,7 +244,7 @@ class Medium extends Object {
 		return 'Generic';
 	}
 /**
- * Determines medium short name for a file or mime type
+ * Determines medium short name for a file or MIME type
  *
  * In the case of there are no arguments passed to this method
  * the values of $_nameToShort are returned
@@ -281,14 +287,18 @@ class Medium extends Object {
 			}
 
 			if (!method_exists($Medium, $method)) {
-				trigger_error('Medium::make - Invalid instruction ' . get_class($Medium) . '::' . $method . '().', E_USER_WARNING);
+				$message  = &quot;Medium::make - Invalid instruction &quot;;
+				$message .= &quot;`&quot; . get_class($Medium) . &quot;::{$method}()`.&quot;;
+				trigger_error($message, E_USER_WARNING);
 				return false;
 			}
 
 			$result = call_user_func_array(array($Medium, $method), $args);
 
 			if ($result === false) {
-				trigger_error('Medium::make - Instruction ' . get_class($Medium) . '::' . $method . '() failed.', E_USER_WARNING);
+				$message  = &quot;Medium::make - Instruction &quot;;
+				$message .=  &quot;`&quot; . get_class($Medium) . &quot;::{$method}()` failed.&quot;;
+				trigger_error($message, E_USER_WARNING);
 				return false;
 			} elseif (is_a($result, 'Medium')) {
 				$Medium = $result;
@@ -310,7 +320,8 @@ class Medium extends Object {
 			$File-&gt;delete();
 		}
 		if ($File-&gt;exists()) {
-			trigger_error(&quot;Medium::store - File '{$file}' already exists.&quot;, E_USER_NOTICE);
+			$message = &quot;Medium::store - File `{$file}` already exists.&quot;;
+			trigger_error($message, E_USER_NOTICE);
 			return false;
 		}
 
@@ -332,7 +343,7 @@ class Medium extends Object {
  * Convert
  *
  * @param string $mimeType
- * @return bool|object false on error or a Medium object on success
+ * @return boolean|object false on error or a Medium object on success
  */
 	function convert($mimeType) {
 		$result = $this-&gt;Adapters-&gt;dispatchMethod($this, 'convert', array($mimeType));
@@ -346,7 +357,6 @@ class Medium extends Object {
 		if (is_a($result, 'Medium')) {
 			return $result;
 		}
-
 		return $this;
 	}
 /**
@@ -362,20 +372,20 @@ class Medium extends Object {
 		}
 
 		$knownRatios = array(
-						'1:1.294' =&gt; 1/1.294,
-						'1:1.545' =&gt; 1/1.1545,
-						'4:3'     =&gt; 4/3,
-						'1.375:1' =&gt; 1.375,
-						'3:2'     =&gt; 3/2,
-						'16:9'    =&gt; 16/9,
-						'1.85:1'  =&gt; 1.85,
-						'1.96:1'  =&gt; 1.96,
-						'2.35:1'  =&gt; 2.35,
-						'&#8730;2:1'    =&gt; pow(2, 1/2), /* dina4 quer */
-						'1:&#8730;2'    =&gt; 1 / (pow(2, 1/2)), /* dina4 hoch */
-						'&#934;:1'     =&gt; (1 + pow(5,1/2)) / 2, /* goldener schnitt */
-						'1:&#934;'     =&gt; 1 / ((1 + pow(5,1/2)) / 2), /* goldener schnitt */
-						);
+			'1:1.294' =&gt; 1/1.294,
+			'1:1.545' =&gt; 1/1.1545,
+			'4:3'     =&gt; 4/3,
+			'1.375:1' =&gt; 1.375,
+			'3:2'     =&gt; 3/2,
+			'16:9'    =&gt; 16/9,
+			'1.85:1'  =&gt; 1.85,
+			'1.96:1'  =&gt; 1.96,
+			'2.35:1'  =&gt; 2.35,
+			'&#8730;2:1'    =&gt; pow(2, 1/2), /* dina4 quer */
+			'1:&#8730;2'    =&gt; 1 / (pow(2, 1/2)), /* dina4 hoch */
+			'&#934;:1'     =&gt; (1 + pow(5,1/2)) / 2, /* goldener schnitt */
+			'1:&#934;'     =&gt; 1 / ((1 + pow(5,1/2)) / 2), /* goldener schnitt */
+		);
 
 		foreach ($knownRatios as $knownRatioName =&gt; &amp;$knownRatio) {
 			$knownRatio = abs(($width / $height) - $knownRatio);
@@ -447,8 +457,10 @@ class MediumAdapterCollection extends Object {
 		$class = $adapter . 'MediumAdapter';
 		$file = 'medium' . DS . 'adapter' . DS . Inflector::underscore($adapter) . '.php';
 
-		if (!class_exists($class) &amp;&amp; !App::import('Vendor', 'Media.' . $class, array('file' =&gt; $file))) {
-			$this-&gt;__errors[] = &quot;MediumAdapterCollection::attach() - Adapter $adapter not found!&quot;;
+		if (!class_exists($class)
+		&amp;&amp; !App::import('Vendor', 'Media.' . $class, array('file' =&gt; $file))) {
+			$message = &quot;MediumAdapterCollection::attach() - Adapter `{$adapter}` not found!&quot;;
+			$this-&gt;__errors[] = $message;
 			return false;
 		}
 
@@ -465,7 +477,7 @@ class MediumAdapterCollection extends Object {
 		$this-&gt;_attached = array_diff($this-&gt;_attached, (array)$name);
 		$this-&gt;_initialized = array_diff($this-&gt;_initialized, (array)$name);
 		$this-&gt;_overlay($this-&gt;_initialized);
-		$this-&gt;__messages[] = &quot;MediumCollection::detach() - Removed {$name}MediumAdapter.&quot;;
+		$this-&gt;__messages[] = &quot;MediumCollection::detach() - Removed `{$name}MediumAdapter`.&quot;;
 	}
 /**
  * Calls a method of an adapter providing it
@@ -480,33 +492,49 @@ class MediumAdapterCollection extends Object {
 
 		if (isset($this-&gt;__methods[$method])) {
 			list($method, $name) = $this-&gt;__methods[$method];
-			$this-&gt;__messages[] = &quot;MediumCollection::dispatchMethod() - Calling {$name}MediumAdapter::{$method}().&quot;;
+
+			$message  = &quot;MediumCollection::dispatchMethod() - &quot;;
+			$message .= &quot;Calling `{$name}MediumAdapter::{$method}()`.&quot;;
+			$this-&gt;__messages[] = $message;
+
 			return $this-&gt;{$name}-&gt;dispatchMethod($method, $params);
 		}
 
 		foreach ($this-&gt;_attached as $adapter) {
-			if (!method_exists($this-&gt;{$adapter}, $method)) { // optional
-				continue(1);
+			if (!method_exists($this-&gt;{$adapter}, $method)) { /* optional */
+				continue;
 			}
 
 			if (!$this-&gt;_initialized($adapter)) {
 				if ($this-&gt;_initialize($Medium, $adapter)) {
-					$this-&gt;__messages[] = &quot;MediumCollection::dispatchMethod() - Initialized {$adapter}MediumAdapter.&quot;;
+					$message  = &quot;MediumCollection::dispatchMethod() - &quot;;
+					$message .= &quot;Initialized `{$adapter}MediumAdapter`.&quot;;
+					$this-&gt;__messages[] = $message;
+
 					$this-&gt;_overlay($adapter);
 				} else {
-					$this-&gt;__errors[] = 'MediumCollection::dispatchMethod() - Adapter ' . $adapter . ' failed to initialize.';
+					$message  = &quot;MediumCollection::dispatchMethod() - &quot;;
+					$message .= &quot;Adapter `{$adapter}` failed to initialize.&quot;;
+					$this-&gt;__errors[] = $message;
+
 					$this-&gt;detach($adapter);
-					continue(1);
+					continue;
 				}
 			}
 
 			if (isset($this-&gt;__methods[$method])) {
 				list($method, $name) = $this-&gt;__methods[$method];
-				$this-&gt;__messages[] = &quot;MediumCollection::dispatchMethod() - Calling {$adapter}MediumAdapter::{$method}().&quot;;
+
+				$message  = &quot;MediumCollection::dispatchMethod() - &quot;;
+				$message .= &quot;Calling `{$adapter}MediumAdapter::{$method}()`.&quot;;
+				$this-&gt;__messages[] = $message;
+
 				return $this-&gt;{$name}-&gt;dispatchMethod($method, $params);
 			}
 		}
-		$this-&gt;__errors[] = &quot;MediumCollection::dispatchMethod() - Method {$method} not found in any attached adapter&quot;;
+		$message = &quot;MediumCollection::dispatchMethod() - &quot;;
+		$message .= &quot;Method `{$method}` not found in any attached adapter&quot;;
+		$this-&gt;__errors[] = $message;
 	}
 /**
  * Checks if $adapter is compatible and initializes it with $Medium
@@ -525,9 +553,7 @@ class MediumAdapterCollection extends Object {
 		if (!$this-&gt;{$adapter}-&gt;compatible($Medium) || !$this-&gt;{$adapter}-&gt;initialize($Medium)) {
 			return false;
 		}
-
 		$this-&gt;_initialized[] = $adapter;
-
 		return true;
 	}
 /**
@@ -602,18 +628,17 @@ class MediumAdapter extends Object {
  */
 	function compatible(&amp;$Medium) {
 		$default = array(
-				/* sourceFile must have one out of given mime types */
-				'mimeTypes' =&gt; array(),
-				/* PHP extensions which must be loaded */
-				'extensions' =&gt; array(),
-				/* Functions that must exist */
-				'functions' =&gt; array(),
-				/* Files that are required */
-				'imports' =&gt; array(),
-				/* System commands which must be whichable */
-				'commands' =&gt; array(),
-				);
-
+			/* sourceFile must have one out of given MIME types */
+			'mimeTypes' =&gt; array(),
+			/* PHP extensions which must be loaded */
+			'extensions' =&gt; array(),
+			/* Functions that must exist */
+			'functions' =&gt; array(),
+			/* Files that are required */
+			'imports' =&gt; array(),
+			/* System commands which must be whichable */
+			'commands' =&gt; array(),
+		);
 		$require = array_merge($default, $this-&gt;require);
 
 		if (!empty($require['mimeTypes'])) {
@@ -665,7 +690,9 @@ class MediumAdapter extends Object {
 		if (!$data['command'] = $this-&gt;_which($data['command'])) {
 			return false;
 		}
-		$line = String::insert($string, $data, array('before' =&gt; ':', 'after' =&gt; ':', 'clean' =&gt; true));
+		$line = String::insert($string, $data, array(
+			'before' =&gt; ':', 'after' =&gt; ':', 'clean' =&gt; true
+		));
 		exec(escapeshellcmd($line) , $output, $return);
 		return $return !== 0 ? false : (empty($output) ? true : array_pop($output));
 	}</diff>
      <filename>vendors/medium/medium.php</filename>
    </modified>
    <modified>
      <diff>@@ -24,78 +24,71 @@ App::import('Vendor', 'Media.Medium');
  * @subpackage media.libs.medium
  */
 class TextMedium extends Medium {
-	/**
-	 * Compatible adapters
-	 *
-	 * @var array
-	 */
+/**
+ * Compatible adapters
+ *
+ * @var array
+ */
 	var $adapters = array('PearText', 'BasicText');
-
-	/**
-	 * Number of characters
-	 *
-	 * @return int
-	 */
+/**
+ * Number of characters
+ *
+ * @return integer
+ */
 	function characters() {
 		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'characters');
-	}
-
-	/**
-	 * Flesch Score
-	 *
-	 * @return float
-	 */
+	 }
+/**
+ * Flesch Score
+ *
+ * @return float
+ */
 	function fleschScore() {
 		return round($this-&gt;Adapters-&gt;dispatchMethod($this, 'fleschScore'), 2);
 	}
-
-	/**
-	 * Lexical Density in percent
-	 *
- 	 * 40- 50 low (easy to read)
-	 * 60- 70 high (hard to read)
-	 *
-	 * @link http://www.usingenglish.com/glossary/lexical-density-test.html
-	 * @return int
-	 */
+/**
+ * Lexical Density in percent
+ *
+ * 40- 50 low (easy to read)
+ * 60- 70 high (hard to read)
+ *
+ * @link http://www.usingenglish.com/glossary/lexical-density-test.html
+ * @return integer
+ */
 	function lexicalDensity() {
 		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'lexicalDensity');
 	}
-
-	/**
-	 * Number of sentences
-	 *
-	 * @return int
-	 */
+/**
+ * Number of sentences
+ *
+ * @return integer
+ */
 	function sentences() {
 		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'sentences');
 	}
-
-	/**
-	 * Number of syllables
-	 *
-	 * @return int
-	 */
+/**
+ * Number of syllables
+ *
+ * @return integer
+ */
 	function syllables()	{
 		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'syllables');
 	}
-
-	/**
-	 * Truncate to given amount of characters
-	 *
-	 * @param int $characters
-	 * @return string
-	 */
+/**
+ * Truncate to given amount of characters
+ *
+ * @param integer $characters
+ * @return string
+ */
 	function truncate($characters) {
 		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'truncate', array($characters));
 	}
-
-	/**
-	 * Number of words
-	 *
-	 * @param bool $unique
-	 * @return int
-	 */
+/**
+ * Number of words
+ *
+ * @param boolean $unique
+ * @return integer
+ */
 	function words($unique = false) {
 		return $this-&gt;Adapters-&gt;dispatchMethod($this, 'words', array($unique));
 	}</diff>
      <filename>vendors/medium/text.php</filename>
    </modified>
    <modified>
      <diff>@@ -24,65 +24,59 @@ App::import('Vendor', 'Media.Medium');
  * @subpackage media.libs.medium
  */
 class VideoMedium extends Medium {
-	/**
-	 * Compatible adapters
-	 *
-	 * @var array
-	 */
+/**
+ * Compatible adapters
+ *
+ * @var array
+ */
 	var $adapters = array('Getid3Video', 'FfmpegVideo', 'PearOggVideo');
-
-	/**
-	 * Title stored in medium metadata
-	 *
-	 * @return mixed String if metadata info exists, else null
-	 */
+/**
+ * Title stored in medium metadata
+ *
+ * @return mixed String if metadata info exists, else null
+ */
 	function title() {
 		return trim($this-&gt;Adapters-&gt;dispatchMethod($this, 'title'));
 	}
-
-	/**
-	 * Year stored in medium metadata
-	 *
-	 * @return mixed Integer if metadata info exists, else null
-	 */
+/**
+ * Year stored in medium metadata
+ *
+ * @return mixed Integer if metadata info exists, else null
+ */
 	function year() {
 		return (integer)$this-&gt;Adapters-&gt;dispatchMethod($this, 'year');
 	}
-
-	/**
-	 * Current height of medium
-	 *
-	 * @return integer
-	 */
+/**
+ * Current height of medium
+ *
+ * @return integer
+ */
 	function height() {
 		return (integer)$this-&gt;Adapters-&gt;dispatchMethod($this, 'height');
 	}
-
-	/**
-	 * Current width of medium
-	 *
-	 * @return integer
-	 */
+/**
+ * Current width of medium
+ *
+ * @return integer
+ */
 	function width() {
 		return (integer)$this-&gt;Adapters-&gt;dispatchMethod($this, 'width');
 	}
-
-	/**
-	 * Current bitrate of medium
-	 *
-	 * @url http://en.wikipedia.org/wiki/Bit_rate
-	 * @return integer
-	 */
+/**
+ * Current bitrate of medium
+ *
+ * @url http://en.wikipedia.org/wiki/Bit_rate
+ * @return integer
+ */
 	function bitrate() {
 		return (integer)$this-&gt;Adapters-&gt;dispatchMethod($this, 'bitrate');
 	}
-
-	/**
-	 * Determines the quality of the medium by
-	 * taking definition and bitrate into account
-	 *
-	 * @return integer A number indicating quality between 1 (worst) and 5 (best)
-	 */
+/**
+ * Determines the quality of the medium by
+ * taking definition and bitrate into account
+ *
+ * @return integer A number indicating quality between 1 (worst) and 5 (best)
+ */
 	function quality() {
 		$definition = $this-&gt;width() * $this-&gt;height();
 		$bitrate = $this-&gt;bitrate();
@@ -121,15 +115,13 @@ class VideoMedium extends Medium {
 		} else {
 			$quality = ($quality + $qualityMax * $bitrateCoef) / ($bitrateCoef + 1);
 		}
-
 		return (integer)round($quality);
 	}
-
-	/**
-	 * Determines a (known) ratio of medium
-	 *
-	 * @return mixed String if $known is true or float if false
-	 */
+/**
+ * Determines a (known) ratio of medium
+ *
+ * @return mixed String if $known is true or float if false
+ */
 	function ratio($known = true) {
 		$width = $this-&gt;width();
 		$height = $this-&gt;height();
@@ -143,6 +135,5 @@ class VideoMedium extends Medium {
 		}
 		return $this-&gt;_knownRatio($width, $height);
 	}
-
 }
 ?&gt;</diff>
      <filename>vendors/medium/video.php</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@ uses('file');
 /**
  * Mime Glob Class
  *
- * Detection of a file's MIME Type by it's extension
+ * Detection of a file's MIME type by it's extension
  * supporting several database formats.
  *
  * @package    media
@@ -37,8 +37,8 @@ class MimeGlob extends Object {
 /**
  * Constructor
  *
- * @param mixed $file
- * @access private
+ * @param mixed $db
+ * @access public
  */
 	function __construct($db) {
 		$this-&gt;__read($db);
@@ -47,7 +47,6 @@ class MimeGlob extends Object {
  * Determine the format of given database
  *
  * @param mixed $db
- * @static
  */
 	function format($db) {
 		if (empty($db)) {
@@ -78,12 +77,12 @@ class MimeGlob extends Object {
 		return null;
 	}
 /**
- * Analyzes a filename and determines the mime type
+ * Analyzes a filename and determines the MIME type
  *
- * @param string $file Path to a file, basename of a file or in reverse mode a mime type
- * @param array $options An array holding options
- * @return mixed A string containing the mime type of the file or false if mime type
- * 	could not be determined, in reverse mode the pattern corresponding to the given mime type
+ * @param string $file Path to a file, basename of a file or in reverse mode a MIME type
+ * @param boolean $reverse Enable/disable reverse searching
+ * @return mixed A string containing the MIME type of the file or false if MIME type
+ * 	could not be determined, in reverse mode the pattern corresponding to the given MIME type
  * @access public
  */
 	function analyze($file, $reverse = false) {
@@ -132,24 +131,24 @@ class MimeGlob extends Object {
 				$line = trim(fgets($File-&gt;handle));
 
 				if (empty($line) || $line{0} === '#') {
-					continue(1);
+					continue;
 				}
 
 				$line = explode(':', $line);
 
-				if(count($line) &gt; 2) {
+				if (count($line) &gt; 2) {
 					$priority = array_shift($line);
 				} else {
 					$priority = null;
 				}
 				if (!preg_match('/(\*\.)?[a-zA-Z0-9\.]+$|/', $line[1])) {
-					continue(1);
+					continue;
 				}
 				$this-&gt;register(array(
-									'mime_type' =&gt; array_shift($line),
-									'pattern' =&gt; str_replace('*.', null, array_shift($line)),
-									'priority' =&gt; $priority
-									));
+					'mime_type' =&gt; array_shift($line),
+					'pattern' =&gt; str_replace('*.', null, array_shift($line)),
+					'priority' =&gt; $priority
+				));
 			}
 		} elseif ($format === 'Apache Module mod_mime') {
 			$File = new File($db);
@@ -159,7 +158,7 @@ class MimeGlob extends Object {
 				$line = trim(fgets($File-&gt;handle));
 
 				if (empty($line) || $line{0} === '#') {
-					continue(1);
+					continue;
 				}
 
 				$line = preg_split('/\s+/', $line);
@@ -184,8 +183,6 @@ class MimeGlob extends Object {
  * 			)
  *
  * @param array $item A valid glob item
- * @param integer $priority A value between 0 and 100.
- * 	Low numbers should be used for more generic types and higher values for specific subtypes.
  * @return boolean True if item has successfully been registered, false if not
  * @access public
  */
@@ -193,9 +190,9 @@ class MimeGlob extends Object {
 		foreach ((array)$item['pattern'] as $pattern) {
 			if (isset($this-&gt;_items[$pattern])) {
 				$this-&gt;_items[$pattern] = array_unique(array_merge(
-														$this-&gt;_items[$pattern],
-														array($item['mime_type'])
-														));
+					$this-&gt;_items[$pattern],
+					array($item['mime_type'])
+				));
 			} else {
 				$this-&gt;_items[$pattern] = array($item['mime_type']);
 			}
@@ -226,7 +223,7 @@ class MimeGlob extends Object {
  * @param string $name The basename of a file
  * @param array $items
  * @param boolean $caseSensitive
- * @return array Matched mime types keyed by patterns
+ * @return array Matched MIME types keyed by patterns
  * @access private
  */
 	function __test($name, $items, $caseSensitive = true) {</diff>
      <filename>vendors/mime_glob.php</filename>
    </modified>
    <modified>
      <diff>@@ -20,8 +20,8 @@ uses('file');
 /**
  * Mime Magic Class
  *
- * Detection of a file's MIME Type by it's contents.
- * An implementation of the mime magic functionality in pure PHP
+ * Detection of a file's MIME type by it's contents.
+ * An implementation of the MIME magic functionality in pure PHP
  * supporting several database formats.
  *
  * @package    media
@@ -38,18 +38,19 @@ class MimeMagic extends Object {
 /**
  * Constructor
  *
- * @param mixed $file
- * @access private
+ * @param mixed $db
+ * @access public
  */
 	function __construct($db) {
 		$this-&gt;__read($db);
 	}
 /**
- * Analyzes a files contents and determines the file's mime type
+ * Analyzes a files contents and determines the file's MIME type
  *
  * @param string $file An absolute path to a file
  * @param array $options An array holding options
- * @return mixed A string containing the mime type of the file or false if mime type could not be determined
+ * @return mixed A string containing the MIME type of the file
+ * 	or false if MIME type could not be determined
  * @access public
  */
 	function analyze($file, $options = array()) {
@@ -61,18 +62,16 @@ class MimeMagic extends Object {
 
 		foreach ($this-&gt;_items as $priority =&gt; $items) {
 			if ($priority &lt; $minPriority || $priority &gt; $maxPriority) {
-				continue(1);
+				continue;
 			}
 			$filtered = array_merge($filtered, $items);
 		}
-
 		return $this-&gt;__test($file, $filtered);
 	}
 /**
  * Determine the format of given database
  *
  * @param mixed $db
- * @static
  */
 	function format($db) {
 		if (empty($db)) {
@@ -110,14 +109,16 @@ class MimeMagic extends Object {
  *
  * @param array $item A valid magic item
  * @param integer $indent The nesting depth of the item
- * @param integer $priority A value between 0 and 100. Low numbers should be used for more generic types and higher values for specific subtypes.
+ * @param integer $priority A value between 0 and 100.
+ * 	Low numbers should be used for more generic types and higher values for specific subtypes.
  * @return boolean True if item has successfully been registered, false if not
  * @access public
  */
 	function register($item, $indent = 0, $priority = 50) {
 		static $keys = array();
 
-		if (!is_array($item) || !isset($item['offset'], $item['value'], $item['range_length'], $item['value_length'])) {
+		if (!is_array($item)
+		|| !isset($item['offset'], $item['value'], $item['range_length'], $item['value_length'])) {
 			return false;
 		}
 
@@ -174,7 +175,8 @@ class MimeMagic extends Object {
  * - Apache Module mod_mime_magic
  * - PHP file containing variables formatted like: $data[0] = array(item, item, item, ...)
  *
- * @param mixed $file An absolute path to a magic file in apache, freedesktop or a filename (without .php) of a file in the configs/ dir in CakePHP format
+ * @param mixed $file An absolute path to a magic file in apache, freedesktop
+ * 	or a filename (without .php) of a file in the configs/ dir in CakePHP format
  * @return mixed A format string or null if format could not be determined
  * @access private
  * @link http://httpd.apache.org/docs/2.2/en/mod/mod_mime_magic.html
@@ -209,27 +211,29 @@ class MimeMagic extends Object {
 					$chars = array(0 =&gt; $chars[1], 1 =&gt; null);
 				}
 
-				while (!feof($File-&gt;handle) &amp;&amp; !($chars[0] === &quot;\n&quot; &amp;&amp; (ctype_digit($chars[1]) || $chars[1] === '&gt;' || $chars[1] === '['))) {
+				while (!feof($File-&gt;handle) &amp;&amp; !($chars[0] === &quot;\n&quot;
+				&amp;&amp; (ctype_digit($chars[1]) || $chars[1] === '&gt;' || $chars[1] === '['))) {
 					$line .= $chars[0];
 					$chars = array(0 =&gt; $chars[1], 1 =&gt; $File-&gt;read(1));
 				}
 
 				if (preg_match('/' . $sectionRegex . '/', $line, $matches)) {
 					$section = array(
-									'priority'  =&gt; $matches[1],
-									'mime_type' =&gt; $matches[2]
-									);
+						'priority'  =&gt; $matches[1],
+						'mime_type' =&gt; $matches[2]
+					);
 				} elseif (preg_match('/' . $itemRegex . '/', $line, $matches)) {
 					$indent = empty($matches[1]) ? 0 : intval($matches[1]);
 					$wordSize = empty($matches[6]) ? 1 : intval($matches[6]);
 					$item = array(
-								'offset'       =&gt; intval($matches[2]),
-								'value_length' =&gt; current(unpack('n', $matches[3])),
-								'value'        =&gt; $this-&gt;__formatValue($matches[4], $wordSize),
-								'mask'         =&gt; empty($matches[5]) ? null : $this-&gt;__formatValue($matches[5], $wordSize),// default: all &quot;one&quot; bits
-								'range_length' =&gt; empty($matches[7]) ? 1 : intval($matches[7]),
-								'mime_type'    =&gt; $section['mime_type'],
-								);
+						'offset'       =&gt; intval($matches[2]),
+						'value_length' =&gt; current(unpack('n', $matches[3])),
+						'value'        =&gt; $this-&gt;__formatValue($matches[4], $wordSize),
+						/* default: all `one` bits */
+						'mask'         =&gt; empty($matches[5]) ? null : $this-&gt;__formatValue($matches[5], $wordSize),
+						'range_length' =&gt; empty($matches[7]) ? 1 : intval($matches[7]),
+						'mime_type'    =&gt; $section['mime_type'],
+					);
 					$this-&gt;register($item, $indent, $section['priority']);
 				}
 			}
@@ -243,23 +247,23 @@ class MimeMagic extends Object {
 				$line = trim(fgets($File-&gt;handle));
 
 				if (empty($line) || $line{0} === '#') {
-					continue(1);
+					continue;
 				}
 
 				$line = preg_replace('/(?!\B)\040+/', &quot;\t&quot;, $line);
 
 				if (!preg_match('/' . $itemRegex . '/', $line, $matches)) {
-					continue(1);
+					continue;
 				}
 
 				$item = array(
-							'offset'       =&gt; intval($matches[2]),
-							'value'        =&gt; $this-&gt;__formatValue($matches[4], $matches[3], true),
-							'mask'         =&gt; null,
-							'range_length' =&gt; 0,
-							'mime_type'    =&gt; empty($matches[5]) ? null : $matches[5],
-							'encoding'     =&gt; empty($matches[6]) ? null : $matches[6],
-							);
+					'offset'       =&gt; intval($matches[2]),
+					'value'        =&gt; $this-&gt;__formatValue($matches[4], $matches[3], true),
+					'mask'         =&gt; null,
+					'range_length' =&gt; 0,
+					'mime_type'    =&gt; empty($matches[5]) ? null : $matches[5],
+					'encoding'     =&gt; empty($matches[6]) ? null : $matches[6],
+				);
 				$item['value_length'] = strlen($item['value']);
 				$this-&gt;register($item, strlen($matches[1]), 80);
 			}
@@ -272,7 +276,7 @@ class MimeMagic extends Object {
  *
  * @param string $file Absolute path to a file
  * @param array $items
- * @return mixed A string containing the mime type of the file or false if no pattern matched
+ * @return mixed A string containing the MIME type of the file or false if no pattern matched
  * @access private
  */
 	function __test($file, $items) {
@@ -296,7 +300,7 @@ class MimeMagic extends Object {
  *
  * @param object $File An instance of the File class
  * @param array $item A magic item
- * @return mixed A string containing the mime type of the file or false if no pattern matched
+ * @return mixed A string containing the MIME type of the file or false if no pattern matched
  * @access private
  */
 	function __testRecursive(&amp;$File, $item) {
@@ -323,7 +327,8 @@ class MimeMagic extends Object {
  * Format a value for testing
  *
  * @param mixed $value Value to format
- * @param mixed $type String containing the datatype of the value or an integer indicating the word size of the value
+ * @param mixed $type String containing the datatype of the value
+ * 	or an integer indicating the word size of the value
  * @param boolean $binary Whether the value is a binary value or not
  * @param boolean $unEscape If set to true and value is not binary strips slashes from string values
  * @return mixed On success the formatted binary value or the input value
@@ -366,7 +371,10 @@ class MimeMagic extends Object {
 					return pack('d', $value);
 				case 'string':
 					if ($unEscape) {
-						$value = strtr($value, array('\ ' =&gt; ' ', '\&lt;' =&gt; '&lt;', '\&gt;' =&gt; '&gt;', '\\\r' =&gt; '\r', '\\\n' =&gt; '\n'));
+						$value = strtr($value, array(
+							'\ ' =&gt; ' ', '\&lt;' =&gt; '&lt;', '\&gt;' =&gt; '&gt;',
+							'\\\r' =&gt; '\r', '\\\n' =&gt; '\n'
+						));
 					}
 					return preg_replace('/\\\\([0-9]{1,3})/e', 'chr($1);', $value);
 				case 'beshort':</diff>
      <filename>vendors/mime_magic.php</filename>
    </modified>
    <modified>
      <diff>@@ -20,8 +20,8 @@ uses('file');
 /**
  * Mime Type Class
  *
- * Detection of a file's MIME Type by it's contents and/or extension.
- * This is the main interface for MIME Type detection wrapping
+ * Detection of a file's MIME type by it's contents and/or extension.
+ * This is the main interface for MIME type detection wrapping
  * (native) magic and glob mechanisms.
  *
  * @package    media
@@ -32,14 +32,14 @@ class MimeType extends Object {
  * Magic
  *
  * @var mixed An instance of the MimeMagic or finfo class or a string containing 'mime_magic'
- * @access public
+ * @access private
  */
 	var $__magic;
 /**
  * Glob
  *
  * @var object An instance of the MimeGlob class
- * @access public
+ * @access private
  */
 	var $__glob;
 /**
@@ -62,7 +62,8 @@ class MimeType extends Object {
  * Change configuration during runtime
  *
  * @param string $property Either &quot;magic&quot; or &quot;glob&quot;
- * @param array $config Config specifying engine and db e.g. array('engine' =&gt; 'fileinfo', 'db' =&gt; '/etc/magic')
+ * @param array $config Config specifying engine and db
+ * 	e.g. array('engine' =&gt; 'fileinfo', 'db' =&gt; '/etc/magic')
  */
 	function config($property = 'magic', $config = array()) {
 		$_this =&amp; MimeType::getInstance();
@@ -74,22 +75,23 @@ class MimeType extends Object {
 		}
 	}
 /**
- * Guesses the extension (suffix) for an existing file or a mime type
+ * Guesses the extension (suffix) for an existing file or a MIME type
  *
- * @param string $mimetype A mime type or an absolute path to file
+ * @param string $file A MIME type or an absolute path to file
  * @param array $options Currently not used
- * @return mixed A string with the first matching extension (w/o leading dot), false if nothing matched
+ * @return mixed A string with the first matching extension (w/o leading dot),
+ * 	false if nothing matched
  * @access public
  */
 	function guessExtension($file, $options = array()) {
 		$_this =&amp; MimeType::getInstance();
 		$globMatch = array();
 		$preferred = array(
-						'bz2', 'css', 'doc', 'html', 'jpg',
-						'mpeg', 'mp3', 'ogg', 'php', 'ps',
-						'rm', 'ra', 'rv', 'swf', 'tar',
-						'tiff', 'txt', 'xhtml', 'xml',
-						);
+			'bz2', 'css', 'doc', 'html', 'jpg',
+			'mpeg', 'mp3', 'ogg', 'php', 'ps',
+			'rm', 'ra', 'rv', 'swf', 'tar',
+			'tiff', 'txt', 'xhtml', 'xml',
+		);
 
 		if (is_file($file)) {
 			$mimeType = $_this-&gt;guessType($file);
@@ -110,11 +112,10 @@ class MimeType extends Object {
 		if (count($preferMatch) === 1) {
 			return array_shift($preferMatch);
 		}
-
 		return null;
 	}
 /**
- * Guesses the mime type of the file
+ * Guesses the MIME type of the file
  *
  * Empty results are currently not handled:
  * 	application/x-empty
@@ -122,11 +123,11 @@ class MimeType extends Object {
  *
  * @param string $file
  * @param options $options Valid options are:
- *	- &quot;paranoid&quot; If set to true only then content for the file is used for detection
- *	- &quot;simplify&quot; If set to true resulting mime type will be simplified
- *	- &quot;properties&quot; Used for simplification, defaults to false
- *	- &quot;experimental&quot; Used for simplification, defaults to false
- * @return mixed string with mime type on success
+ *	- `'paranoid'` If set to true only then content for the file is used for detection
+ *	- `'simplify'` If set to true resulting MIME type will be simplified
+ *	- `'properties'` Used for simplification, defaults to false
+ *	- `'experimental'` Used for simplification, defaults to false
+ * @return mixed string with MIME type on success
  * @access public
  */
 	function guessType($file, $options = array()) {
@@ -136,12 +137,11 @@ class MimeType extends Object {
 			$options = array('simplify' =&gt; $options);
 		}
 		$default = array(
-					'paranoid' =&gt; false,
-					'simplify' =&gt; false,
-					'properties' =&gt; false,
-					'experimental' =&gt; false,
-					);
-
+			'paranoid' =&gt; false,
+			'simplify' =&gt; false,
+			'properties' =&gt; false,
+			'experimental' =&gt; false,
+		);
 		extract(array_merge($default, $options), EXTR_SKIP);
 		$magicMatch = $globMatch = array();
 
@@ -149,7 +149,6 @@ class MimeType extends Object {
 			if (is_a($_this-&gt;__glob, 'MimeGlob')) {
 				$globMatch = $_this-&gt;__glob-&gt;analyze($file);
 			}
-
 			if (count($globMatch) === 1) {
 				return MimeType::simplify(array_shift($globMatch), $properties, $experimental);
 			}
@@ -191,7 +190,7 @@ class MimeType extends Object {
 		return null;
 	}
 /**
- * Simplifies a mime type string
+ * Simplifies a MIME type string
  *
  * @param string $mimeType
  * @param boolean If true removes properties
@@ -215,7 +214,7 @@ class MimeType extends Object {
 /**
  * Sets magic property
  *
- * @param array Configuration settings to take into account
+ * @param array $config Configuration settings to take into account
  * @return void
  */
 	function __loadMagic($config = array()) {
@@ -257,7 +256,7 @@ class MimeType extends Object {
 /**
  * Sets glob property
  *
- * @param array Configuration settings to take into account
+ * @param array $config Configuration settings to take into account
  * @return void
  */
 	function __loadGlob($config = array()) {
@@ -299,10 +298,9 @@ class MimeType extends Object {
 		$searchPaths = array(
 			'mime_' . $type . '.php' =&gt; array(CONFIGS),
 			'mime_' . $type . '.db' =&gt; array_merge(
-									Configure::read('vendorPaths'),
-									array(dirname(__FILE__) . DS)
-									),
-			);
+				Configure::read('vendorPaths'),
+				array(dirname(__FILE__) . DS)
+			));
 
 		foreach ($searchPaths as $basename =&gt; $paths) {
 			foreach ($paths as $path) {</diff>
      <filename>vendors/mime_type.php</filename>
    </modified>
    <modified>
      <diff>@@ -26,8 +26,26 @@ Configure::write('Cache.disable', true);
  * @subpackage media.shells
  */
 class MediaShell extends Shell {
+/**
+ * Tasks
+ *
+ * @var string
+ * @access public
+ */
 	var $tasks = array('Sync', 'Make', 'Collect');
+/**
+ * Verbose mode
+ *
+ * @var boolean
+ * @access public
+ */
 	var $verbose = false;
+/**
+ * Quiet mode
+ *
+ * @var boolean
+ * @access public
+ */
 	var $quiet = false;
 /**
  * Width of shell in number of characters per line
@@ -36,18 +54,18 @@ class MediaShell extends Shell {
  */
 	var $width = 80;
 /**
- * startup
+ * Startup
  *
  * @access public
  * @return void
  */
-	function startup() {
+	 function startup() {
 		$this-&gt;verbose = isset($this-&gt;params['verbose']);
 		$this-&gt;quiet = isset($this-&gt;params['quiet']);
 		parent::startup();
 	}
 /**
- * _welcome
+ * Welcome
  *
  * @access protected
  * @return void
@@ -59,12 +77,12 @@ class MediaShell extends Shell {
 		$this-&gt;hr();
 	}
 /**
- * main
+ * Main
  *
  * @access public
  * @return void
  */
-	function main() {
+	 function main() {
 		$this-&gt;out('[I]nitialize Media Directory');
 		$this-&gt;out('[P]rotect Transfer Directory');
 		$this-&gt;out('[S]ynchronize');
@@ -120,7 +138,7 @@ class MediaShell extends Shell {
 			MEDIA_STATIC =&gt; Medium::short(),
 			MEDIA_TRANSFER =&gt; Medium::short(),
 			MEDIA_FILTER =&gt; Medium::short(),
-			);
+		);
 
 		foreach ($dirs as $dir =&gt; $subDirs) {
 			if (is_dir($dir)) {
@@ -386,7 +404,7 @@ class MediaShell extends Shell {
 /**
  * Overridden to allow Stop messages
  *
- * @param int $status
+ * @param integer $status
  * @access protected
  * @return void
  */</diff>
      <filename>vendors/shells/media.php</filename>
    </modified>
    <modified>
      <diff>@@ -86,11 +86,11 @@ class CollectTask extends MediaShell {
 
 		foreach ($this-&gt;_map as $old =&gt; $new) {
 			$message = sprintf(
-							'%-38s %s %38s',
-							$this-&gt;shortPath($old),
-							$this-&gt;_link ? '&lt;-' : '-&gt;',
-							$this-&gt;shortPath($new)
-						);
+				'%-38s %s %38s',
+				$this-&gt;shortPath($old),
+				$this-&gt;_link ? '&lt;-' : '-&gt;',
+				$this-&gt;shortPath($new)
+			);
 			$this-&gt;out($message);
 		}
 
@@ -124,10 +124,10 @@ class CollectTask extends MediaShell {
 		}
 
 		$paths = array_merge(
-					Configure::read('vendorPaths'),
-					array(WWW_ROOT),
-					$pluginVendorPaths
-				);
+			Configure::read('vendorPaths'),
+			array(WWW_ROOT),
+			$pluginVendorPaths
+		);
 
 		foreach ($paths as $key =&gt; $path) {
 			$message = sprintf('Would you like to collect files from %s?', $this-&gt;shortPath($path));</diff>
      <filename>vendors/shells/tasks/collect.php</filename>
    </modified>
    <modified>
      <diff>@@ -170,9 +170,11 @@ class SyncTask extends MediaShell {
 		list($this-&gt;__fsMap, $this-&gt;__dbMap) = $this-&gt;_generateMaps();
 
 		foreach ($this-&gt;__dbMap as $dbItem) {
-			$message = sprintf('%-60s -&gt; %s/%s',
-								$this-&gt;shortPath($dbItem['file']),
-								$this-&gt;_Model-&gt;name, $dbItem['id']);
+			$message = sprintf(
+				'%-60s -&gt; %s/%s',
+				$this-&gt;shortPath($dbItem['file']),
+				$this-&gt;_Model-&gt;name, $dbItem['id']
+			);
 			$this-&gt;out();
 			$this-&gt;out($message);
 
@@ -209,9 +211,12 @@ class SyncTask extends MediaShell {
 		list($this-&gt;__fsMap, $this-&gt;__dbMap) = $this-&gt;_generateMaps();
 
 		foreach ($this-&gt;__fsMap as $fsItem) {
-			$message = sprintf('%-60s &lt;- %s/%s',
-								$this-&gt;shortPath($fsItem['file']),
-								$this-&gt;_Model-&gt;name, '?');
+			$message = sprintf(
+				'%-60s &lt;- %s/%s',
+				$this-&gt;shortPath($fsItem['file']),
+				$this-&gt;_Model-&gt;name,
+				'?'
+			);
 			$this-&gt;out();
 			$this-&gt;out($message);
 
@@ -253,7 +258,6 @@ class SyncTask extends MediaShell {
 		if ($this-&gt;_fixWithAlternative()) {
 			return true;
 		}
-
 		if ($this-&gt;_fixDeleteRecord()) {
 			return true;
 		}
@@ -278,9 +282,9 @@ class SyncTask extends MediaShell {
 
 		if ($input == 'y') {
 			$data = array(
-						'id' =&gt; $this-&gt;__dbItem['id'],
-						'checksum' =&gt; $this-&gt;__File-&gt;md5(),
-						);
+				'id' =&gt; $this-&gt;__dbItem['id'],
+				'checksum' =&gt; $this-&gt;__File-&gt;md5(),
+			);
 			$this-&gt;_Model-&gt;save($data);
 			$this-&gt;out('Corrected checksum');
 			return true;
@@ -323,8 +327,10 @@ class SyncTask extends MediaShell {
 		if (!$this-&gt;__alternativeFile) {
 			return false;
 		}
-		$message = sprintf('This file has an identical checksum: %s',
-							$this-&gt;shortPath($this-&gt;__alternativeFile));
+		$message = sprintf(
+			'This file has an identical checksum: %s',
+			$this-&gt;shortPath($this-&gt;__alternativeFile)
+		);
 		$this-&gt;out($message);
 		$input = $this-&gt;in('Select this file and update record?', 'y,n', $this-&gt;_answer);
 
@@ -333,10 +339,10 @@ class SyncTask extends MediaShell {
 		}
 
 		$data = array(
-					'id' =&gt; $this-&gt;__dbItem['id'],
-					'dirname' =&gt; dirname(str_replace($this-&gt;_baseDirectory, '', $this-&gt;__alternativeFile)),
-					'basename' =&gt; basename($this-&gt;__alternativeFile),
-					);
+			'id' =&gt; $this-&gt;__dbItem['id'],
+			'dirname' =&gt; dirname(str_replace($this-&gt;_baseDirectory, '', $this-&gt;__alternativeFile)),
+			'basename' =&gt; basename($this-&gt;__alternativeFile),
+		);
 		$this-&gt;_Model-&gt;save($data);
 		$this-&gt;out('Corrected dirname and basename');
 		return true;</diff>
      <filename>vendors/shells/tasks/sync.php</filename>
    </modified>
    <modified>
      <diff>@@ -29,7 +29,7 @@ class TransferValidation extends MediaValidation {
  * Checks if subject is transferable
  *
  * @param mixed $check Path to file in local FS, URL or file-upload array
- * @return bool
+ * @return boolean
  */
 	function resource($check) {
 		if (TransferValidation::fileUpload($check)
@@ -38,41 +38,36 @@ class TransferValidation extends MediaValidation {
 		 || TransferValidation::url($check)) {
 		  	return !TransferValidation::blank($check);
 		}
-
 		return false;
 	}
 /**
  * Checks if resource is not blank or empty
  *
  * @param mixed $check Array or string
- * @return bool
+ * @return boolean
  */
 	function blank($check) {
 		if (empty($check)) {
 			return true;
 		}
-
 		if (TransferValidation::fileUpload($check) &amp;&amp; $check['error'] == UPLOAD_ERR_NO_FILE) {
 			return true;
 		}
-
 		if (is_string($check) &amp;&amp; Validation::blank($check)) {
 			return true;
 		}
-
 		return false;
 	}
 /**
  * Identifies a file upload array
  *
  * @param mixed $check
- * @return bool
+ * @return boolean
  */
 	function fileUpload($check) {
 		if (!is_array($check)) {
 			return false;
 		}
-
 		if (!array_key_exists('name',$check)
 		 || !array_key_exists('type',$check)
 		 || !array_key_exists('tmp_name',$check)
@@ -80,7 +75,6 @@ class TransferValidation extends MediaValidation {
 		 || !array_key_exists('size',$check)) {
 			return false;
 		}
-
 		return true;
 	}
 /**</diff>
      <filename>vendors/transfer_validation.php</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@
 /**
  * Attachments Element File
  *
- * Element listing associated Attachments of the View's Model
+ * Element listing associated attachments of the view's model
  * Add, delete (detach) an Attachment
  *
  * Copyright (c) 2007-2009 David Persson</diff>
      <filename>views/elements/attachments.ctp</filename>
    </modified>
    <modified>
      <diff>@@ -37,42 +37,40 @@ class MediumHelper extends AppHelper {
  * @var array
  */
 	var $tags = array(
-			'object'			=&gt; '&lt;object%s&gt;%s%s&lt;/object&gt;',
-			'param' 			=&gt; '&lt;param%s/&gt;',
-			'csslink' 			=&gt; '&lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; href=&quot;%s&quot; %s/&gt;',
-			'javascriptlink' 	=&gt; '&lt;script type=&quot;text/javascript&quot; src=&quot;%s&quot;&gt;&lt;/script&gt;',
-			'rsslink'			=&gt; '&lt;link type=&quot;application/rss+xml&quot; rel=&quot;alternate&quot; href=&quot;%s&quot; title=&quot;%s&quot;/&gt;', // v2
-			);
+		'object'			=&gt; '&lt;object%s&gt;%s%s&lt;/object&gt;',
+		'param' 			=&gt; '&lt;param%s/&gt;',
+		'csslink' 			=&gt; '&lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; href=&quot;%s&quot; %s/&gt;',
+		'javascriptlink' 	=&gt; '&lt;script type=&quot;text/javascript&quot; src=&quot;%s&quot;&gt;&lt;/script&gt;',
+		'rsslink'			=&gt; '&lt;link type=&quot;application/rss+xml&quot; rel=&quot;alternate&quot; href=&quot;%s&quot; title=&quot;%s&quot;/&gt;', /* v2 */
+	);
 /**
  * Configuration settings for this helper
  *
  * @var array
  */
 	var $settings = array(
-					'map' =&gt; array(
-						'static'   =&gt; array(MEDIA_STATIC =&gt; MEDIA_STATIC_URL),
-						'transfer' =&gt; array(MEDIA_TRANSFER =&gt; MEDIA_TRANSFER_URL),
-						'filter'   =&gt; array(MEDIA_FILTER =&gt; MEDIA_FILTER_URL)
-						),
-					'directories' =&gt; array(
-						),
-					'urls' =&gt; array(
-						),
-					'versions' =&gt; array('xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl', 'c'),
-					'extensions' =&gt; array(
-						'aud' 	=&gt; array('mp3', 'ogg', 'aif', 'wma', 'wav'),
-						'css' 	=&gt; array('css'),
-						'doc' 	=&gt; array('odt', 'rtf', 'pdf', 'doc', 'png', 'jpg', 'jpeg'),
-						'gen' 	=&gt; array(),
-						'ico' 	=&gt; array('ico', 'png', 'gif', 'jpg', 'jpeg'),
-						'img' 	=&gt; array('png', 'jpg', 'jpeg' , 'gif'),
-						'js' 	=&gt; array('js'),
-						'txt' 	=&gt; array('txt'),
-						'vid' 	=&gt; array('avi', 'mpg', 'qt', 'mov', 'ogg', 'wmv',
-										'png', 'jpg', 'jpeg', 'gif', 'mp3', 'ogg',
-										'aif', 'wma', 'wav'),
-						)
-					);
+		'map' =&gt; array(
+			'static'   =&gt; array(MEDIA_STATIC =&gt; MEDIA_STATIC_URL),
+			'transfer' =&gt; array(MEDIA_TRANSFER =&gt; MEDIA_TRANSFER_URL),
+			'filter'   =&gt; array(MEDIA_FILTER =&gt; MEDIA_FILTER_URL)
+		),
+		'directories' =&gt; array(	),
+		'urls' =&gt; array(),
+		'versions' =&gt; array('xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl', 'c'),
+		'extensions' =&gt; array(
+			'aud' 	=&gt; array('mp3', 'ogg', 'aif', 'wma', 'wav'),
+			'css' 	=&gt; array('css'),
+			'doc' 	=&gt; array('odt', 'rtf', 'pdf', 'doc', 'png', 'jpg', 'jpeg'),
+			'gen' 	=&gt; array(),
+			'ico' 	=&gt; array('ico', 'png', 'gif', 'jpg', 'jpeg'),
+			'img' 	=&gt; array('png', 'jpg', 'jpeg' , 'gif'),
+			'js' 	=&gt; array('js'),
+			'txt' 	=&gt; array('txt'),
+			'vid' 	=&gt; array(
+							'avi', 'mpg', 'qt', 'mov', 'ogg', 'wmv',
+							'png', 'jpg', 'jpeg', 'gif', 'mp3', 'ogg',
+							'aif', 'wma', 'wav'
+	)));
 /**
  * Holds cached paths
  *
@@ -83,6 +81,9 @@ class MediumHelper extends AppHelper {
  * Constructor
  *
  * Sets up cache and merges user supplied settings with default settings
+ *
+ * @param array $settings
+ * @return void
  */
 	function __construct($settings = array()) {
 		$this-&gt;settings = array_merge($this-&gt;settings, $settings);
@@ -99,6 +100,8 @@ class MediumHelper extends AppHelper {
  * Destructor
  *
  * Updates cache
+ *
+ * @return void
  */
 	function __destruct() {
 		Cache::write('media_found', $this-&gt;__cached, '_cake_core_');
@@ -107,7 +110,7 @@ class MediumHelper extends AppHelper {
  * Output filtering
  *
  * @param string $content
- * @param bool $inline True to return content, false to add content to scripts_for_layout
+ * @param boolean $inline True to return content, false to add content to `scripts_for_layout`
  * @return mixed String if inline is true or null
  */
 	function output($content, $inline = true) {
@@ -119,28 +122,30 @@ class MediumHelper extends AppHelper {
 		$View-&gt;addScript($content);
 	}
 /**
- * Turns a file into a (routed) url string
+ * Turns a file path into a (routed) URL
  *
  * Reimplemented method from Helper
  *
- * @param string $file Absolut path or relative (to MEDIA) path to file
- * @param array $options For future usage
- * @return arrays
+ * @param string $path Absolute or partial path to a file
+ * @param boolean $full
+ * @return string
  */
-	function url($url = null, $full = false) {
-		if (is_array($url) || strpos($url, '://') !== false) {
-			return parent::url($url, $full);
+	function url($path = null, $full = false) {
+		if (is_array($path) || strpos($path, '://') !== false) {
+			return parent::url($path, $full);
 		}
-		if (!$url = $this-&gt;webroot($url)) {
+		if (!$path = $this-&gt;webroot($path)) {
 			return null;
 		}
-		return $full ? FULL_BASE_URL . $url : $url;
+		return $full ? FULL_BASE_URL . $path : $path;
 	}
 /**
- * Enter description here...
+ * Webroot
+ *
+ * Reimplemented method from Helper
  *
- * @param unknown_type $path
- * @return unknown
+ * @param string $path Absolute or partial path to a file
+ * @return mixed
  */
 	function webroot($path) {
 		if (!$file = $this-&gt;file($path)) {
@@ -162,19 +167,18 @@ class MediumHelper extends AppHelper {
 		return $this-&gt;webroot . str_replace(DS, '/', $path);
 	}
 /**
- * Display a file inline
+ * Generates markup to render a file inline
  *
- * @param string $file
+ * @param string $path Absolute or partial path to a file
  * @param array $options restrict: embed to display certain medium types only
  * @return string
- *
  */
 	function embed($path, $options = array()) {
 		$default = array(
 					'restrict' =&gt; array(),
 					'background' =&gt; '#000000',
-					'autoplay' =&gt; false, // also: autostart
-					'controls' =&gt; false, // also: controller
+					'autoplay' =&gt; false, /* aka `autostart` */
+					'controls' =&gt; false, /* aka `controller` */
 					'branding' =&gt; false,
 					'alt' =&gt; null,
 					'width' =&gt; null,
@@ -237,166 +241,168 @@ class MediumHelper extends AppHelper {
 			case 'image/jpeg':
 			case 'image/png':
 				$attributes = array_merge($attributes, array(
-								'alt' =&gt; $alt,
-								'width' =&gt; $width,
-								'height' =&gt; $height,
-								));
+					'alt' =&gt; $alt,
+					'width' =&gt; $width,
+					'height' =&gt; $height,
+				));
 				if (strpos($path, 'ico/') !== false) {
 					$attributes = $this-&gt;addClass($attributes, 'icon');
 				}
-				return sprintf($this-&gt;Html-&gt;tags['image'], $url, $this-&gt;_parseAttributes($attributes));
-
+				return sprintf(
+					$this-&gt;Html-&gt;tags['image'],
+					$url,
+					$this-&gt;_parseAttributes($attributes)
+				);
 			/* Windows Media */
-			case 'video/x-ms-wmv': // official
+			case 'video/x-ms-wmv': /* official */
 			case 'video/x-ms-asx':
 			case 'video/x-msvideo':
 				$attributes = array_merge($attributes, array(
-								'type' =&gt; $mimeType,
-								'width' =&gt; $width,
-								'height' =&gt; $height,
-								'data' =&gt; $url,
-								'classid' =&gt; 'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6',
-								));
+					'type' =&gt; $mimeType,
+					'width' =&gt; $width,
+					'height' =&gt; $height,
+					'data' =&gt; $url,
+					'classid' =&gt; 'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6',
+				));
 				$parameters = array(
-								'src' =&gt; $url,
-								'autostart' =&gt; $autoplay,
-								'controller' =&gt; $controls,
-								'pluginspage' =&gt; 'http://www.microsoft.com/Windows/MediaPlayer/',
-								);
-				return sprintf($this-&gt;tags['object'], $this-&gt;_parseAttributes($attributes), $this-&gt;_parseParameters($parameters), $alt);
-
+					'src' =&gt; $url,
+					'autostart' =&gt; $autoplay,
+					'controller' =&gt; $controls,
+					'pluginspage' =&gt; 'http://www.microsoft.com/Windows/MediaPlayer/',
+				);
+				break;
 			/* RealVideo */
 			case 'application/vnd.rn-realmedia':
 			case 'video/vnd.rn-realvideo':
 			case 'audio/vnd.rn-realaudio':
 				$attributes = array_merge($attributes, array(
-								'type' =&gt; $mimeType,
-								'width' =&gt; $width,
-								'height' =&gt; $height,
-								'data' =&gt; $url,
-								'classid' =&gt; 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
-								));
+					'type' =&gt; $mimeType,
+					'width' =&gt; $width,
+					'height' =&gt; $height,
+					'data' =&gt; $url,
+					'classid' =&gt; 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
+				));
 				$parameters = array(
-								'src' =&gt; $url,
-								'autostart' =&gt; $autoplay,
-								'controls' =&gt; isset($controls) ? 'ControlPanel' : null,
-								'console' =&gt; 'video' . uniqid(),
-								'loop' =&gt; $loop,
-								'bgcolor' =&gt; $background,
-								'nologo' =&gt; $branding ? false : true,
-								'nojava' =&gt; true,
-								'center' =&gt; true,
-								'backgroundcolor' =&gt; $background,
-								'pluginspage' =&gt; 'http://www.real.com/player/',
-								);
-				return sprintf($this-&gt;tags['object'], $this-&gt;_parseAttributes($attributes), $this-&gt;_parseParameters($parameters), $alt);
-
+					'src' =&gt; $url,
+					'autostart' =&gt; $autoplay,
+					'controls' =&gt; isset($controls) ? 'ControlPanel' : null,
+					'console' =&gt; 'video' . uniqid(),
+					'loop' =&gt; $loop,
+					'bgcolor' =&gt; $background,
+					'nologo' =&gt; $branding ? false : true,
+					'nojava' =&gt; true,
+					'center' =&gt; true,
+					'backgroundcolor' =&gt; $background,
+					'pluginspage' =&gt; 'http://www.real.com/player/',
+				);
+				break;
 			/* QuickTime */
 			case 'video/quicktime':
 				$attributes = array_merge($attributes, array(
-								'type' =&gt; $mimeType,
-								'width' =&gt; $width,
-								'height' =&gt; $height,
-								'data' =&gt; $url,
-								'classid' =&gt; 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
-								'codebase' =&gt; 'http://www.apple.com/qtactivex/qtplugin.cab',
-								));
+					'type' =&gt; $mimeType,
+					'width' =&gt; $width,
+					'height' =&gt; $height,
+					'data' =&gt; $url,
+					'classid' =&gt; 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
+					'codebase' =&gt; 'http://www.apple.com/qtactivex/qtplugin.cab',
+				));
 				$parameters = array(
-								'src' =&gt; $url,
-								'autoplay' =&gt; $autoplay,
-								'controller' =&gt; $controls,
-								'bgcolor' =&gt; substr($background, 1),
-								'showlogo' =&gt; $branding,
-								'pluginspage' =&gt; 'http://www.apple.com/quicktime/download/',
-								);
-				return sprintf($this-&gt;tags['object'], $this-&gt;_parseAttributes($attributes), $this-&gt;_parseParameters($parameters), $alt);
-
+					'src' =&gt; $url,
+					'autoplay' =&gt; $autoplay,
+					'controller' =&gt; $controls,
+					'bgcolor' =&gt; substr($background, 1),
+					'showlogo' =&gt; $branding,
+					'pluginspage' =&gt; 'http://www.apple.com/quicktime/download/',
+				);
+				break;
 			/* Mpeg */
 			case 'video/mpeg':
 				$attributes = array_merge($attributes, array(
-								'type' =&gt; $mimeType,
-								'width' =&gt; $width,
-								'height' =&gt; $height,
-								'data' =&gt; $url,
-								));
+					'type' =&gt; $mimeType,
+					'width' =&gt; $width,
+					'height' =&gt; $height,
+					'data' =&gt; $url,
+				));
 				$parameters = array(
-								'src' =&gt; $url,
-								'autostart' =&gt; $autoplay,
-								);
-				return sprintf($this-&gt;tags['object'], $this-&gt;_parseAttributes($attributes), $this-&gt;_parseParameters($parameters), $alt);
-
+					'src' =&gt; $url,
+					'autostart' =&gt; $autoplay,
+				);
+				break;
 			/* Flashy Flash */
 			case 'application/x-shockwave-flash':
 				$attributes = array_merge($attributes, array(
-								'type' =&gt; $mimeType,
-								'width' =&gt; $width,
-								'height' =&gt; $height,
-								'data' =&gt; $url,
-								'classid' =&gt; 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000',
-								'codebase' =&gt; 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab',
-								));
+					'type' =&gt; $mimeType,
+					'width' =&gt; $width,
+					'height' =&gt; $height,
+					'data' =&gt; $url,
+					'classid' =&gt; 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000',
+					'codebase' =&gt; 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab',
+				));
 				$parameters = array(
-								'movie' =&gt; $url,
-								'wmode' =&gt; 'transparent',
-								'bgcolor' =&gt; $background,
-								'FlashVars' =&gt; 'playerMode=embedded',
-								'quality' =&gt; 'best',
-								'scale' =&gt; 'noScale',
-								'salign' =&gt; 'TL',
-								'pluginspage' =&gt; 'http://www.adobe.com/go/getflashplayer',
-								);
-				return sprintf($this-&gt;tags['object'], $this-&gt;_parseAttributes($attributes), $this-&gt;_parseParameters($parameters), $alt);
-
+					'movie' =&gt; $url,
+					'wmode' =&gt; 'transparent',
+					'bgcolor' =&gt; $background,
+					'FlashVars' =&gt; 'playerMode=embedded',
+					'quality' =&gt; 'best',
+					'scale' =&gt; 'noScale',
+					'salign' =&gt; 'TL',
+					'pluginspage' =&gt; 'http://www.adobe.com/go/getflashplayer',
+				);
+				break;
 			case 'application/pdf':
 				$attributes = array_merge($attributes, array(
-								'type' =&gt; $mimeType,
-								'width' =&gt; $width,
-								'height' =&gt; $height,
-								'data' =&gt; $url,
-								));
+					'type' =&gt; $mimeType,
+					'width' =&gt; $width,
+					'height' =&gt; $height,
+					'data' =&gt; $url,
+				));
 				$parameters = array(
-								'src' =&gt; $url,
-								'toolbar' =&gt; $controls, // 1 or 0 vvditovvv
-								'scrollbar' =&gt; $controls,
-								'navpanes' =&gt; $controls,
-								);
-				return sprintf($this-&gt;tags['object'], $this-&gt;_parseAttributes($attributes), $this-&gt;_parseParameters($parameters), $alt);
-
+					'src' =&gt; $url,
+					'toolbar' =&gt; $controls, /* 1 or 0 */
+					'scrollbar' =&gt; $controls, /* 1 or 0 */
+					'navpanes' =&gt; $controls,
+				);
+				break;
 			case 'audio/x-wav':
 			case 'audio/mpeg':
-			case 'audio/ogg': // must use application/ogg instead?
+			case 'audio/ogg': /* must use application/ogg instead? */
 			case 'audio/x-midi':
 				$attributes = array_merge($attributes, array(
-								'type' =&gt; $mimeType,
-								'width' =&gt; $width,
-								'height' =&gt; $height,
-								'data' =&gt; $url,
-								));
+					'type' =&gt; $mimeType,
+					'width' =&gt; $width,
+					'height' =&gt; $height,
+					'data' =&gt; $url,
+				));
 				$parameters = array(
-								'src' =&gt; $url,
-								'autoplay' =&gt; $autoplay,
-								);
-				return sprintf($this-&gt;tags['object'], $this-&gt;_parseAttributes($attributes), $this-&gt;_parseParameters($parameters), $alt);
-
+					'src' =&gt; $url,
+					'autoplay' =&gt; $autoplay,
+				);
+				break;
 			default:
 				$attributes = array_merge($attributes, array(
-								'type' =&gt; $mimeType,
-								'width' =&gt; $width,
-								'height' =&gt; $height,
-								'data' =&gt; $url,
-								));
+					'type' =&gt; $mimeType,
+					'width' =&gt; $width,
+					'height' =&gt; $height,
+					'data' =&gt; $url,
+				));
 				$parameters = array(
-								'src' =&gt; $url,
-								);
-				return sprintf($this-&gt;tags['object'], $this-&gt;_parseAttributes($attributes), $this-&gt;_parseParameters($parameters), $alt);
+					'src' =&gt; $url,
+				);
+				break;
 		}
+		return sprintf(
+			$this-&gt;tags['object'],
+			$this-&gt;_parseAttributes($attributes),
+			$this-&gt;_parseParameters($parameters),
+			$alt
+		);
 	}
 /**
- * Enter description here...
+ * Generates markup to link to file
  *
- * @param unknown_type $url
- * @param unknown_type $options
- * @return unknown
+ * @param string $path Absolute or partial path to a file
+ * @param array $options
+ * @return mixed
  */
 	function link($path, $options = array()) {
 		$default = array(
@@ -439,26 +445,28 @@ class MediumHelper extends AppHelper {
 
 		$Medium = Medium::factory($file, $mimeType);
 
-		if (!empty($options['restrict']) &amp;&amp; !in_array(strtolower($Medium-&gt;name), (array) $options['restrict'])) {
+		if (!empty($options['restrict'])
+		&amp;&amp; !in_array(strtolower($Medium-&gt;name), (array) $options['restrict'])) {
 			return null;
 		}
 		unset($options['restrict']);
 
 		switch ($mimeType) {
 			case 'text/css':
-				$out = sprintf($this-&gt;tags['csslink'], $url, $this-&gt;_parseAttributes($options, null, '', ' '));
+				$out = sprintf(
+					$this-&gt;tags['csslink'],
+					$url,
+					$this-&gt;_parseAttributes($options, null, '', ' ')
+				);
 				return $this-&gt;output($out, $inline);
-
 			case 'application/javascript':
 			case 'application/x-javascript':
 				$out = sprintf($this-&gt;tags['javascriptlink'], $url);
 				return $this-&gt;output($out, $inline);
-
 			case 'application/rss+xml':
 				$options = array_merge($defaultRss,$options);
 				$out = sprintf($this-&gt;tags['rsslink'], $url, $options['title']);
 				return $this-&gt;output($out, $inline);
-
 			default:
 				return $this-&gt;Html-&gt;link(basename($file), $url);
 		}
@@ -466,8 +474,8 @@ class MediumHelper extends AppHelper {
 /**
  * Get MIME type for a path
  *
- * @param string $path
- * @return mixed
+ * @param string|array $path Absolute or partial path to a file
+ * @return string|boolean
  */
 	function mimeType($path) {
 		if ($file = $this-&gt;file($path)) {
@@ -478,8 +486,8 @@ class MediumHelper extends AppHelper {
 /**
  * Get size of file
  *
- * @param string $path
- * @return mixed False on error or integer
+ * @param string|array $path Absolute or partial path to a file
+ * @return integer|boolean False on error or integer
  */
 	function size($path)	{
 		if ($file = $this-&gt;file($path)) {
@@ -488,7 +496,7 @@ class MediumHelper extends AppHelper {
 		return false;
 	}
 /**
- * Resolves a fragmented path
+ * Resolves partial path
  *
  * Examples:
  * 	css/cake.generic         &gt;&gt;&gt; MEDIA_STATIC/css/cake.generic.css
@@ -553,8 +561,10 @@ class MediumHelper extends AppHelper {
 		$short = current(array_intersect(Medium::short(), $parts));
 
 		if (!$short) {
-			trigger_error('MediumHelper::file - You must provide a medium directory (e.g. img).',
-							E_USER_NOTICE);
+			$message  = &quot;MediumHelper::file - &quot;;
+			$message .= &quot;You've provided a partial path without a medium directory (e.g. img) &quot;;
+			$message .= &quot; which is required to resolve the path.&quot;;
+			trigger_error($message, E_USER_NOTICE);
 			return false;
 		}
 
@@ -573,10 +583,10 @@ class MediumHelper extends AppHelper {
 		return false;
 	}
 /**
- * Enter description here...
+ * Generates `param` tags
  *
- * @param unknown_type $options
- * @return unknown
+ * @param array $options
+ * @return string
  */
 	function _parseParameters($options) {
 		$parameters = array();
@@ -588,7 +598,10 @@ class MediumHelper extends AppHelper {
 			} elseif ($value === false) {
 				$value = 'false';
 			}
-			$parameters[] = sprintf($this-&gt;tags['param'], $this-&gt;_parseAttributes(array('name' =&gt; $key, 'value' =&gt; $value)));
+			$parameters[] = sprintf(
+				$this-&gt;tags['param'],
+				$this-&gt;_parseAttributes(array('name' =&gt; $key, 'value' =&gt; $value))
+			);
 		}
 		return implode(&quot;\n&quot;, $parameters);
 	}</diff>
      <filename>views/helpers/medium.php</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>vendors/medium/adapter/javascript_packer.php</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>40e31e0bea01cc95b1d841ac43f55ee5402e7234</id>
    </parent>
  </parents>
  <author>
    <name>David Persson</name>
    <email>davidpersson@gmx.de</email>
  </author>
  <url>http://github.com/davidpersson/media/commit/357b4296f543e873126e6e7af0fdec956c7f9cca</url>
  <id>357b4296f543e873126e6e7af0fdec956c7f9cca</id>
  <committed-date>2009-05-27T18:21:21-07:00</committed-date>
  <authored-date>2009-05-27T14:51:25-07:00</authored-date>
  <message>Updating docblocks and formatting

Removing JavascriptPacker adatper
Updating path login in Media Behavior
Updating tests
Fixing attachment model test broken in previous commit</message>
  <tree>5662f58b21853e08b943851df8f7e40acbba0155</tree>
  <committer>
    <name>David Persson</name>
    <email>davidpersson@gmx.de</email>
  </committer>
</commit>
