feature 2963 & feature 2985 : more flexibility for FileCombiner (keep API compatibility)

git-svn-id: http://piwigo.org/svn/trunk@25547 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
mistic100
2013-11-18 08:53:24 +00:00
parent 7726147445
commit 54343578e9

View File

@@ -1366,7 +1366,7 @@ final class FileCombiner
private $is_css;
private $combinables;
function FileCombiner($type, $combinables)
function FileCombiner($type, $combinables=array())
{
$this->type = $type;
$this->is_css = $type=='css';
@@ -1386,8 +1386,15 @@ final class FileCombiner
function add($combinables)
{
foreach($combinables as $combinable)
$this->combinables[] = $combinable;
if ($combinables instanceof Combinable)
{
$this->combinables[] = $combinables;
}
else
{
foreach($combinables as $combinable)
$this->combinables[] = $combinable;
}
}
function combine()