You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would you be up to add an md5 checksum to the AsseticWriter to prevent files from modifying with the same data? This would be great for development pipelines, as it'd prevent etags from being changed, and thus be able to more accurately predict when resources change.
My use case comes in from using assetic + live.js for development environments, in which I only want css to recompute and emit a new etag, while all the javascripts prevent a reload of the page.
Something like the following modifications in the AssetWriter:
protected static function write($path, $contents)
{
if (!is_dir($dir = dirname($path)) && false === @mkdir($dir, 0777, true)) {
throw new \RuntimeException('Unable to create directory '.$dir);
}
if(file_exists($path) && md5($contents) == md5(@file_get_contents($path)))
{
echo "Not modified: ".$path."\n";
return;
}
if (false === @file_put_contents($path, $contents)) {
throw new \RuntimeException('Unable to write file '.$path);
}
}
Due to the way the variables are private currently, there is no good way of extending this class, short of re-implementing it.
The text was updated successfully, but these errors were encountered:
Would you be up to add an md5 checksum to the AsseticWriter to prevent files from modifying with the same data? This would be great for development pipelines, as it'd prevent etags from being changed, and thus be able to more accurately predict when resources change.
My use case comes in from using assetic + live.js for development environments, in which I only want css to recompute and emit a new etag, while all the javascripts prevent a reload of the page.
Something like the following modifications in the AssetWriter:
Due to the way the variables are private currently, there is no good way of extending this class, short of re-implementing it.
The text was updated successfully, but these errors were encountered: