method realToId documentation in bbn\Ide\Directories
Returns the file's ID from the real file's path.
function($file)
{
$timer->start('real_to_id');
$url = self::realToUrl($file);
$dir = self::dir(self::dirFromUrl($url));
if ( !empty($dir) &&
\defined($dir['bbn_path'])
){
$bbn_p = $dir['bbn_path'] === 'BBN_APP_PATH' ? \bbn\Mvc::getAppPath() : constant($dir['bbn_path']);
if ( strpos($file, $bbn_p) === 0 ){
$f = substr($file, \strlen($bbn_p));
$timer->stop('real_to_id');
bbn\X::log($timer->results(), "directories");
return bbn\Str::parsePath($dir['bbn_path'].'/'.$f);
}
}
// OLD VERSION
/*
$dirs = $this->dirs();
$len = 0;
$bbn_path = '';
$f = '';
foreach ( $dirs as $i => $d ){
if ( !empty($d['bbn_path']) ){
$bbn_p = constant($d['bbn_path']);
if ( strpos($file, $bbn_p) === 0 ){
$p = substr($file, \strlen($bbn_p));
if ( strpos($p, $d['code']) === 0 ){
die(var_dump($file, $bbn_p, $p));
$len_tmp = \count(explode('/', $d['code']));
if ( $len_tmp > $len ){
$len = $len_tmp;
$bbn_path = $d['bbn_path'];
$f = $p;
}
}
}
}
}
return bbn\Str::parsePath($bbn_path.'/'.$f);
*/
}
Returns the file's ID from the real file's path. 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-2025
BBN Solutions