assets-ci
assets-ci copied to clipboard
Addition of partials modified date check & clear_cache method update
- Updated to remove the clear_cache group check, assets in groups were not being removed when new ones were generated
- Update to library to check for @include partials in SASS/SCSS
All commit request are not working correctly.... so it has conflict with other groups, other types, clearing when is not necessary That's my code working. Clear cache not tested. Group names cant end with same chars (ex. adminApp, otherApp). Have to be appOne, appTwo.
if ($files)
{
foreach ($files as $file)
{
$file_path = reduce_double_slashes(self::$cache_path.'/'.$file);
$file_info = pathinfo($file_path);
if ( ( ( $group !== null && stripos($file_path, $group .'.') !== false ) || $group === null ) && $type === 'css' )
{
if (isset($file_info['extension']) and strtolower($file_info['extension']) === 'css') unlink($file_path);
}
elseif ( ( ( $group !== null && stripos($file_path, $group .'.') !== false ) || $group === null ) && $type === 'js' )
{
if (isset($file_info['extension']) and strtolower($file_info['extension']) === 'js') unlink($file_path);
}
elseif($group === null)
{
if (isset($file_info['extension']) and (strtolower($file_info['extension']) === 'css' or strtolower($file_info['extension']) === 'js')) unlink($file_path);
if (isset($file_info['extension']) and strtolower($file_info['extension']) === 'cache') unlink($file_path);
}
}
}