-
Notifications
You must be signed in to change notification settings - Fork 18
/
compat_l5.php
50 lines (47 loc) · 1.09 KB
/
compat_l5.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
if (!function_exists('config_path')) {
/**
* Return the path to config files.
*
* @param null $str
*
* @return string
*/
function config_path($str = null)
{
return rtrim(realpath(__DIR__.'/config/'.$str), '/');
}
}
if (!function_exists('public_path')) {
/**
* Return the path to public dir.
*
* @param null $str
*
* @return string
*/
function public_path($str = null)
{
return rtrim(realpath(__DIR__.'/public/'.$str), '/');
}
}
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.");
}
}