Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/helpers/minifiers/minify_helper.php
Show First 20 Lines • Show All 175 Lines • ▼ Show 20 Line(s) | |||||
* Deletes compression info file | * Deletes compression info file | ||||
* | * | ||||
* @todo also delete all listed there files | * @todo also delete all listed there files | ||||
* @access public | * @access public | ||||
*/ | */ | ||||
public function delete() | public function delete() | ||||
{ | { | ||||
$iterator = new DirectoryIterator($this->resourceFolder); | $iterator = new DirectoryIterator($this->resourceFolder); | ||||
/* @var $file_info DirectoryIterator */ | /** @var DirectoryIterator $file_info */ | ||||
foreach ($iterator as $file_info) { | foreach ($iterator as $file_info) { | ||||
if ( !$file_info->isDir() && preg_match('/^(c|d)_.*.(css|js)$/', $file_info->getFilename()) ) { | if ( !$file_info->isDir() && preg_match('/^(c|d)_.*.(css|js)$/', $file_info->getFilename()) ) { | ||||
unlink( $file_info->getPathname() ); | unlink( $file_info->getPathname() ); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | |||||
* | * | ||||
* @param string $string | * @param string $string | ||||
* @param string $extension | * @param string $extension | ||||
* @return void | * @return void | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
protected function compressViaPHP(&$string, $extension) | protected function compressViaPHP(&$string, $extension) | ||||
{ | { | ||||
/** @var JsMinifyHelper $minifier */ | |||||
$minifier = $this->Application->makeClass($extension == 'js' ? 'JsMinifyHelper' : 'CssMinifyHelper'); | $minifier = $this->Application->makeClass($extension == 'js' ? 'JsMinifyHelper' : 'CssMinifyHelper'); | ||||
/* @var $minifier JsMinifyHelper */ | |||||
$string = $minifier->minify($string); | $string = $minifier->minify($string); | ||||
} | } | ||||
/** | /** | ||||
* Get full paths on disk for each of given templates | * Get full paths on disk for each of given templates | ||||
* | * | ||||
* @param Array $templates | * @param Array $templates | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |