method checkPath documentation in bbn\File\Ftp

function($path) { if ( empty($path) ){ return '/'; } $new = explode('../',$path); $nnew = \count($new); if ( $nnew > 1 ) { $cur = explode('/',$this->dir); $ncur = \count($cur); if ( $cur[$ncur-1] == '' ) { array_pop($cur); $ncur--; } for ( $i = 1; $nnew < $i; $i++ ) { if ( $new[$i-1] == '' ) { $ncur--; if ( $ncur == 1 ) return false; else array_pop($cur); } else { $add = $new[$i-1]; if ( substr($add,-1) != '/' ) $add .= '/'; break; } } $new_path = implode('/',$cur).'/'; if ( isset($add) ) $new_path .= $add; return $new_path; } else if ( strpos($path,'/') === 0 ) return $path; else if ( $path == '.' ) return $this->dir; else if ( \strlen($path) > 0 ) { if ( substr($path,-1) != '/' ) $path .= '/'; $path = $this->dir.$path; if ( substr($path,0,1) != '/' ) $path = '/'.$path; return $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.