original_string: public function real_to_url(string $file){
  
      foreach ( $this->repositories() as $i => $d ){
        if (
          // Repository's root path
          ($root = $this->get_root_path($d)) &&
          (strpos($file, $root) === 0)
        ){
  				$res = $i;
          $bits = explode('/', substr($file, \strlen($root)));
  
          // MVC
          if ( !empty($d['tabs']) ){
            $tab_path = array_shift($bits);
            $fn = array_pop($bits);
            $ext = \bbn\str::file_ext($fn);
            $fn = \bbn\str::file_ext($fn, 1)[0];
            $res .= implode('/', $bits);
            foreach ( $d['tabs'] as $k => $t ){
              if (
                empty($t['fixed']) &&
                ($t['path'] === $tab_path . '/')
              ){
                $res .= "/$fn/$t[url]";
                break;
              }
            }
          }
          // Normal file
          else {
            $res .= implode('/', $bits);
  
          }
          return \bbn\str::parse_path($res);
        }
      }
      return false;
    }
code: public function real_to_url(string $file){
  
      foreach ( $this->repositories() as $i => $d ){
        if (
          // Repository's root path
          ($root = $this->get_root_path($d)) &&
          (strpos($file, $root) === 0)
        ){
  				$res = $i;
          $bits = explode('/', substr($file, \strlen($root)));
  
          // MVC
          if ( !empty($d['tabs']) ){
            $tab_path = array_shift($bits);
            $fn = array_pop($bits);
            $ext = \bbn\str::file_ext($fn);
            $fn = \bbn\str::file_ext($fn, 1)[0];
            $res .= implode('/', $bits);
            foreach ( $d['tabs'] as $k => $t ){
              if (
                empty($t['fixed']) &&
                ($t['path'] === $tab_path . '/')
              ){
                $res .= "/$fn/$t[url]";
                break;
              }
            }
          }
          // Normal file
          else {
            $res .= implode('/', $bits);
  
          }
          return \bbn\str::parse_path($res);
        }
      }
      return false;
    }
code_tokens: public function real_to_url ( string $ file ) { foreach ( $ this -> repositories ( ) as $ i => $ d ) { if ( // Repository's root path ( $ root = $ this -> get_root_path ( $ d ) ) && ( strpos ( $ file , $ root ) === 0 ) ) { $ res = $ i ; $ bits = explode ( '/' , substr ( $ file , \ strlen ( $ root ) ) ) ; // MVC if ( ! empty ( $ d [ 'tabs' ] ) ) { $ tab_path = array_shift ( $ bits ) ; $ fn = array_pop ( $ bits ) ; $ ext = \ bbn \ str :: file_ext ( $ fn ) ; $ fn = \ bbn \ str :: file_ext ( $ fn , 1 ) [ 0 ] ; $ res .= implode ( '/' , $ bits ) ; foreach ( $ d [ 'tabs' ] as $ k => $ t ) { if ( empty ( $ t [ 'fixed' ] ) && ( $ t [ 'path' ] === $ tab_path . '/' ) ) { $ res .= "/$fn/$t[url]" ; break ; } } } // Normal file else { $ res .= implode ( '/' , $ bits ) ; } return \ bbn \ str :: parse_path ( $ res ) ; } } return false ; }
docstring: Returns the file's URL from the real file's path.
  
  @param string $file The real file's path
  @return bool|string
docstring_tokens: Returns the file s URL from the real file s path .