Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixes to media package

  • Loading branch information...
commit 9b64922d1290b5e7b1e8af3e6a841c92d7d1702e 1 parent 7deeb69
@kaviththiranga authored
View
15 libraries/joomla/media/combiner.php
@@ -123,12 +123,9 @@ public static function getCombiners()
continue;
}
- // Sweet! Our class exists, so now we just need to know if it passes its test method.
- if ($class::isSupported())
- {
- // Connector names should not have file extensions.
- $combiners[] = $class;
- }
+ // Combiner names should not have file extensions.
+ $combiners[] = $class;
+
}
return $combiners;
@@ -257,10 +254,8 @@ public static function isSupported($sourceFile)
{
return true;
}
- else
- {
- return false;
- }
}
+
+ return true;
}
}
View
28 libraries/joomla/media/compressor.php
@@ -184,12 +184,9 @@ public static function getCompressors()
continue;
}
- // Sweet! Our class exists, so now we just need to know if it passes its test method.
- if ($class::isSupported())
- {
- // Connector names should not have file extensions.
- $compressors[] = $class;
- }
+ // Compressor names should not have file extensions.
+ $compressors[] = $class;
+
}
return $compressors;
@@ -198,16 +195,21 @@ public static function getCompressors()
/**
* Compress a CSS/JS file with given options
*
- * @param string $uncompressed The full file path of the source file.
- * @param array $options An asssociative array with options. Eg: force overwirte, prefix for minified files
+ * @param string $uncompressed The String to be compressed
+ * @param array $options An asssociative array with options. Eg: type, force overwirte, prefix for minified files
*
* @return string compressed string
*
* @since 12.1
*/
- public static function compressString( $uncompressed, $options = array())
+ public static function compressString( $uncompressed, $options)
{
+ if (!array_key_exists('type', $options))
+ {
+ throw new RuntimeException(JText::sprintf('JMEDIA_ERROR_COMPRESSOR_TYPE_NOT_DEFINED'));
+ }
$compressor = self::getInstance($options);
+ $compressor->clear();
$compressor->setUncompressed($uncompressed);
try
@@ -218,7 +220,7 @@ public static function compressString( $uncompressed, $options = array())
{
return false;
}
- return $compressor->getCompressed;
+ return $compressor->getCompressed();
}
/**
@@ -357,11 +359,9 @@ public static function isSupported($sourceFile)
{
return true;
}
- else
- {
- return false;
- }
}
+
+ return false;
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.