method getRootPath documentation in bbn\Appui\Project
Gets the real root path from a repository's id as recorded in the options.
function($rep)
{
//if only name else get info repository
$path = '';
$repository = \is_string($rep) ? $this->repositories[$rep] : $rep;
if ((!empty($repository)
&& is_array($repository))
&& !empty($repository['root'])
&& X::hasProps($repository, ['path', 'root', 'code'], true)
) {
if (strpos($repository['root'], '/') === 0) {
$path = $repository['root'];
} else {
switch ($repository['root']) {
case 'app':
$path = $this->getAppPath();
break;
case 'lib':
$path = $this->getLibPath();
$path .= $repository['path'];
if ($repository['alias_code'] === 'bbn-project') {
$path .= '/src/';
}
break;
case 'home':
if (!defined('BBN_HOME_PATH')) {
throw new Exception(X::_("BBN_HOME_PATH is not defined"));
}
$path = BBN_HOME_PATH;
$path .= $repository['path'];
if ($repository['alias_code'] === 'bbn-project') {
$path .= '/src/';
}
break;
case 'cdn':
$path = $this->getCdnPath();
$path .= $repository['path'];
break;
case 'data':
$path = $this->getDataPath();
$path .= $repository['path'];
break;
}
}
}
if (!is_string($path)) {
throw new \Exception(X::_("Impossible to determine the path for %s", $rep));
}
if ($path && substr($path, -1) !== '/') {
$path .= '/';
}
return $path;
}
Gets the real root path from a repository's id as recorded in the options. 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