mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 21:49:01 +01:00
29 lines
496 B
PHP
29 lines
496 B
PHP
<?php
|
|
|
|
if ( ! function_exists('elixir'))
|
|
{
|
|
/**
|
|
* Get the path to a versioned Elixir file.
|
|
*
|
|
* @param string $file
|
|
* @return string
|
|
*/
|
|
function elixir($file)
|
|
{
|
|
static $manifest = null;
|
|
|
|
if (is_null($manifest))
|
|
{
|
|
$manifest = json_decode(file_get_contents(public_path().'/build/rev-manifest.json'), true);
|
|
}
|
|
|
|
if (isset($manifest[$file]))
|
|
{
|
|
return '/build/'.$manifest[$file];
|
|
}
|
|
|
|
throw new InvalidArgumentException("File {$file} not defined in asset manifest.");
|
|
}
|
|
|
|
}
|