public function exists(string $path){
    if ( !empty($path) ){
      $dir = dirname($path);
      $ext = \bbn\str::file_ext($path);
      $file = basename($path);
      if ( \is_array($files = $this->listFiles($dir)) ){
        foreach ( $files as $f ){
          if ( $f['basename'] === $file ){
            return true;
          }
        }
      }
    }
    return false;
  }
public function exists(string $path){
    if ( !empty($path) ){
      $dir = dirname($path);
      $ext = \bbn\str::file_ext($path);
      $file = basename($path);
      if ( \is_array($files = $this->listFiles($dir)) ){
        foreach ( $files as $f ){
          if ( $f['basename'] === $file ){
            return true;
          }
        }
      }
    }
    return false;
  }
public function exists ( string $ path ) { if ( ! empty ( $ path ) ) { $ dir = dirname ( $ path ) ; $ ext = \ bbn \ str :: file_ext ( $ path ) ; $ file = basename ( $ path ) ; if ( \ is_array ( $ files = $ this -> listFiles ( $ dir ) ) ) { foreach ( $ files as $ f ) { if ( $ f [ 'basename' ] === $ file ) { return true ; } } } } return false ; }
Checks if a file is present in a folder on the server

@param string $path The file or dir relative or full path
@return bool
Checks if a file is present in a folder on the server