public function search($query, $page = 0) {
        $list = [
                'list'      => [],
                'manage'    => 'https://www.dropbox.com/home',
                'logouturl' => 'https://www.dropbox.com/logout',
                'message'   => get_string('logoutdesc', 'repository_dropbox'),
                'dynload'   => true,
            ];

        // Note - we deliberately do not catch the coding exceptions here.
        try {
            $result = $this->dropbox->search($query);
        } 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->matches) or !is_array($result->matches)) {
            return $list;
        }

        $list['list'] = $this->process_entries($result->matches);
        return $list;
    }
public function search($query, $page = 0) {
        $list = [
                'list'      => [],
                'manage'    => 'https://www.dropbox.com/home',
                'logouturl' => 'https://www.dropbox.com/logout',
                'message'   => get_string('logoutdesc', 'repository_dropbox'),
                'dynload'   => true,
            ];

        // Note - we deliberately do not catch the coding exceptions here.
        try {
            $result = $this->dropbox->search($query);
        } 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->matches) or !is_array($result->matches)) {
            return $list;
        }

        $list['list'] = $this->process_entries($result->matches);
        return $list;
    }
public function search ( $ query , $ page = 0 ) { $ list = [ 'list' => [ ] , 'manage' => 'https://www.dropbox.com/home' , 'logouturl' => 'https://www.dropbox.com/logout' , 'message' => get_string ( 'logoutdesc' , 'repository_dropbox' ) , 'dynload' => true , ] ; // Note - we deliberately do not catch the coding exceptions here. try { $ result = $ this -> dropbox -> search ( $ query ) ; } 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 -> matches ) or ! is_array ( $ result -> matches ) ) { return $ list ; } $ list [ 'list' ] = $ this -> process_entries ( $ result -> matches ) ; return $ list ; }
Get dropbox files in the specified path.

@param   string      $query      The search query
@param   int         $page       The page number
@return  array
Get dropbox files in the specified path .