mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
small rework for https://github.com/opnsense/core/issues/2379 to make sure ui_devtools can overwrite the file_exists() behaviour
This commit is contained in:
parent
bdb125e06c
commit
57267ca994
@ -52,7 +52,7 @@ $di->set('view', function () use ($config) {
|
||||
));
|
||||
// register additional volt template functions
|
||||
$volt->getCompiler()->addFunction('theme_file_or_default', 'view_fetch_themed_filename');
|
||||
$volt->getCompiler()->addFunction('file_exists', 'file_exists');
|
||||
$volt->getCompiler()->addFunction('file_exists', 'view_file_exists');
|
||||
|
||||
return $volt;
|
||||
},
|
||||
|
||||
@ -23,6 +23,16 @@ function view_fetch_themed_filename($url, $theme)
|
||||
return $url; // not found, return source
|
||||
}
|
||||
|
||||
/**
|
||||
* check if file exists, wrapper around file_exists() so services.php can define other implementation for local testing
|
||||
* @param string $filename to check
|
||||
* @return boolean
|
||||
*/
|
||||
function view_file_exists($filename)
|
||||
{
|
||||
return file_exists($filename);
|
||||
}
|
||||
|
||||
try {
|
||||
/**
|
||||
* Read the configuration
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user