: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Nextend\Framework\Asset;
use Nextend\Framework\Cache\Manifest;
use Nextend\Framework\Filesystem\Filesystem;
abstract class AbstractCache {
protected $group, $files, $codes;
public function getAssetFile($group, &$files = array(), &$codes = array()) {
$cache = new Manifest($group, true, true);
$hash = $this->getHash();
return $cache->makeCache($group . "." . $this->outputFileType, $hash, array(
protected function getHash() {
foreach ($this->files as $file) {
$hash .= $this->makeFileHash($file);
foreach ($this->codes as $code) {
protected function getCacheFileName() {
foreach ($this->files as $file) {
$hash .= $this->makeFileHash($file);
foreach ($this->codes as $code) {
return md5($hash) . "." . $this->outputFileType;
public function getCachedContent($cache) {
foreach ($this->files as $file) {
$fileContents .= $this->parseFile($cache, Filesystem::readFile($file), $file) . "\n";
foreach ($this->codes as $code) {
$fileContents .= $code . "\n";
protected function makeFileHash($file) {
return $file . filemtime($file);
* @param $originalFilePath
protected function parseFile($cache, $content, $originalFilePath) {