method getEnvironment documentation in bbn\Appui\Project
function($appPath = NULL)
{
if (!$appPath) {
$appPath = $this->getAppPath();
}
if (!$appPath) {
throw new \Exception(X::_("No application path given"));
}
$file_environment = $appPath . 'cfg/environment';
if ($this->fs->isFile($file_environment . '.json')) {
$envs = \json_decode($this->fs->getContents($file_environment . '.json'), true);
}
elseif ($this->fs->isFile($file_environment . '.yml')) {
try {
$envs = yaml_parse($this->fs->getContents($file_environment . '.yml'));
} catch (\Exception $e) {
throw new \Exception(
"Impossible to parse the file $file_environment.yaml"
. PHP_EOL . $e->getMessage()
);
}
if ($envs === false) {
throw new \Exception(X::_("Impossible to parse the file $file_environment.yaml"));
}
}
if (!empty($envs)) {
foreach ($envs as $env) {
if ($env['app_path'] === X::dirname($appPath) . '/') {
return $env;
}
}
}
return null;
}
BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2023
BBN Solutions