Author: rande
Date: 2010-03-17 20:46:54 +0100 (Wed, 17 Mar 2010)
New Revision: 28590
Modified:
plugins/swCombinePlugin/trunk/lib/task/swOptimizeCreateFilesTask.class.php
Log:
[swCombinePlugin] fix wrong type hinting
Modified:
plugins/swCombinePlugin/trunk/lib/task/swOptimizeCreateFilesTask.class.php
===================================================================
--- plugins/swCombinePlugin/trunk/lib/task/swOptimizeCreateFilesTask.class.php
2010-03-17 19:42:53 UTC (rev 28589)
+++ plugins/swCombinePlugin/trunk/lib/task/swOptimizeCreateFilesTask.class.php
2010-03-17 19:46:54 UTC (rev 28590)
@@ -150,7 +150,7 @@
$assets = $this->view_handler->exposeAddAssets('stylesheet',
$stylesheets, false);
$this->combineAndOptimize('stylesheet', $assets);
}
-
+
// Generate js module files
$javascripts =
$this->view_handler->exposeMergeConfigValue('javascripts', $view);
if(count($javascripts) > 0)
@@ -158,7 +158,6 @@
$assets = $this->view_handler->exposeAddAssets('javascript',
$javascripts, false);
$this->combineAndOptimize('javascript', $assets);
}
-
}
}
}
@@ -203,7 +202,8 @@
if(count($combine->getFiles()) == 0)
{
- $this->logSection('combine', ' ~ no files to add');
+ $this->logSection('combine', ' ~ no files to add : '.$type);
+
return;
}
@@ -212,27 +212,29 @@
$force_name_to ? $force_name_to :
$this->view_handler->getCombinedName($type, $combined)
);
+
if(is_file($path))
{
$this->logSection('combine', 'duplicate file, nothing to do');
return;
}
-
+
$content = $combine->getContentsFromFiles();
// save combined file
if(!$this->saveContents($path, $content))
{
- $this->logSection('combine', ' ~ content is empty');
+ $this->logSection('combine', ' ~ content is empty : '.$type);
return;
}
-
+
// optimize file with the provided driver
$driver = $this->getDriver($type);
$driver->processFile($path, true);
$results = $driver->getResults();
+
$this->logSection('file+', sprintf(' > %s', $force_name_to ?
$force_name_to : $this->view_handler->getCombinedName($type, $combined)));
$this->logSection('optimize', sprintf(' > from %.2fKB to %.2fKB, ratio
-%s%%',
@@ -248,12 +250,14 @@
* @param string $type name associated to the driver : javascript or
stylesheet
* @param swDriveBase
*/
- public function getDriver(string $type)
+ public function getDriver($type)
{
+
$driver = $this->view_parameters->get('configuration['.$type.'][driver]',
false);
if(!class_exists($driver))
{
+
throw new sfException('Invalid driver class : '.$driver);
}
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.