original_string: public function get_listing($path = '', $page = '1') {
          if (empty($path) || $path == '/') {
              $path = '';
          } else {
              $path = file_correct_filepath($path);
          }
  
          $list = [
                  'list'      => [],
                  'manage'    => 'https://www.dropbox.com/home',
                  'logouturl' => 'https://www.dropbox.com/logout',
                  'message'   => get_string('logoutdesc', 'repository_dropbox'),
                  'dynload'   => true,
                  'path'      => $this->process_breadcrumbs($path),
              ];
  
          // Note - we deliberately do not catch the coding exceptions here.
          try {
              $result = $this->dropbox->get_listing($path);
          } catch (\repository_dropbox\authentication_exception $e) {
              // The token has expired.
              return $this->print_login();
          } catch (\repository_dropbox\dropbox_exception $e) {
              // There was some other form of non-coding failure.
              // This could be a rate limit, or it could be a server-side error.
              // Just return early instead.
              return $list;
          }
  
          if (!is_object($result) || empty($result)) {
              return $list;
          }
  
          if (empty($result->entries) or !is_array($result->entries)) {
              return $list;
          }
  
          $list['list'] = $this->process_entries($result->entries);
          return $list;
      }
code: public function get_listing($path = '', $page = '1') {
          if (empty($path) || $path == '/') {
              $path = '';
          } else {
              $path = file_correct_filepath($path);
          }
  
          $list = [
                  'list'      => [],
                  'manage'    => 'https://www.dropbox.com/home',
                  'logouturl' => 'https://www.dropbox.com/logout',
                  'message'   => get_string('logoutdesc', 'repository_dropbox'),
                  'dynload'   => true,
                  'path'      => $this->process_breadcrumbs($path),
              ];
  
          // Note - we deliberately do not catch the coding exceptions here.
          try {
              $result = $this->dropbox->get_listing($path);
          } catch (\repository_dropbox\authentication_exception $e) {
              // The token has expired.
              return $this->print_login();
          } catch (\repository_dropbox\dropbox_exception $e) {
              // There was some other form of non-coding failure.
              // This could be a rate limit, or it could be a server-side error.
              // Just return early instead.
              return $list;
          }
  
          if (!is_object($result) || empty($result)) {
              return $list;
          }
  
          if (empty($result->entries) or !is_array($result->entries)) {
              return $list;
          }
  
          $list['list'] = $this->process_entries($result->entries);
          return $list;
      }
code_tokens: public function get_listing ( $ path = '' , $ page = '1' ) { if ( empty ( $ path ) || $ path == '/' ) { $ path = '' ; } else { $ path = file_correct_filepath ( $ path ) ; } $ list = [ 'list' => [ ] , 'manage' => 'https://www.dropbox.com/home' , 'logouturl' => 'https://www.dropbox.com/logout' , 'message' => get_string ( 'logoutdesc' , 'repository_dropbox' ) , 'dynload' => true , 'path' => $ this -> process_breadcrumbs ( $ path ) , ] ; // Note - we deliberately do not catch the coding exceptions here. try { $ result = $ this -> dropbox -> get_listing ( $ path ) ; } catch ( \ repository_dropbox \ authentication_exception $ e ) { // The token has expired. return $ this -> print_login ( ) ; } catch ( \ repository_dropbox \ dropbox_exception $ e ) { // There was some other form of non-coding failure. // This could be a rate limit, or it could be a server-side error. // Just return early instead. return $ list ; } if ( ! is_object ( $ result ) || empty ( $ result ) ) { return $ list ; } if ( empty ( $ result -> entries ) or ! is_array ( $ result -> entries ) ) { return $ list ; } $ list [ 'list' ] = $ this -> process_entries ( $ result -> entries ) ; return $ list ; }
docstring: Get dropbox files.
  
  @inheritDocs
docstring_tokens: Get dropbox files .