38 foreach ($values as $var => $vals) {
39 foreach ($vals as $value) {
40 if (!is_string($value)) {
41 throw new \InvalidArgumentException(
sprintf(
'All variable values must be strings, but got %s for variable "%s".', json_encode($value), $var));
47 $this->values = $values;
53 $this->writeAsset($am->
get($name));
59 foreach (VarUtils::getCombinations($asset->
getVars(), $this->values) as $combination) {
63 $this->dir.
'/'.VarUtils::resolve(
75 if (!is_dir($dir = dirname(
$path)) &&
false === @mkdir($dir, 0777,
true)) {
76 throw new \RuntimeException(
'Unable to create directory '.$dir);
80 throw new \RuntimeException(
'Unable to write file '.
$path);
92 return VarUtils::getCombinations($vars, $this->values);
sprintf('%.4f', $callTime)
get($name)
Gets an asset by name.
getNames()
Returns an array of asset names.
Writes assets to the filesystem.
static write($path, $contents)
__construct($dir, array $values=array())
Constructor.
writeAsset(AssetInterface $asset)
getCombinations(array $vars)
Not used.
writeManagerAssets(AssetManager $am)
An exception for terminatinating execution or to throw for unit testing.
An asset has a mutable URL and content and can be loaded and dumped.
setValues(array $values)
Sets the values for the asset's variables.
getValues()
Returns the current values for this asset.
dump(FilterInterface $additionalFilter=null)
Applies dump filters and returns the asset as a string.
getVars()
Returns an array of variable names for this asset.
getTargetPath()
Returns the URL for the current asset.
Class CssCacheBustingFilter.