kernel/private/classes/clusterfilehandlers/dfsbackends/mysqli.php
public function _getFileList( $scopes = false, $excludeScopes = false, $limit = false, $path = false )
    {
        $filePathList = array();
        $tables = array_unique( array( $this->metaDataTable, $this->metaDataTableCache ) );

        foreach ( $tables as $table )
        {
            $query = 'SELECT name FROM ' . $table;

            if ( is_array( $scopes ) && count( $scopes ) > 0 )
            {
                $query .= ' WHERE scope ';
                if ( $excludeScopes )
                    $query .= 'NOT ';
                $query .= "IN ('" . implode( "', '", $scopes ) . "')";
            }
            if ( $path != false && $scopes == false)
            {
                 $query .= " WHERE name LIKE '" . $path . "%'";
            }
            else if ( $path != false)
            {
                 $query .= " AND name LIKE '" . $path . "%'";
            }
            if ( $limit && array_sum($limit) )
            {
                $query .= " LIMIT {$limit[0]}, {$limit[1]}";
            }
            $rslt = $this->_query( $query, "_getFileList( array( " . implode( ', ', is_array( $scopes ) ? $scopes : array() ) . " ), $excludeScopes )" );
            if ( !$rslt )
            {
                eZDebug::writeError( 'Unable to get file list', __METHOD__ );
                throw new Exception(
                    "dfs/mysqli DB error: " . mysqli_error( $this->db ) . "\nSQL Query: $query",
                    mysqli_errno( $this->db )
                );
            }

            while ( $row = mysqli_fetch_row( $rslt ) )
            {
                $filePathList[] = $row[0];
            }

            mysqli_free_result( $rslt );
        }

        return $filePathList;
    }
public function _getFileList( $scopes = false, $excludeScopes = false, $limit = false, $path = false )
    {
        $filePathList = array();
        $tables = array_unique( array( $this->metaDataTable, $this->metaDataTableCache ) );

        foreach ( $tables as $table )
        {
            $query = 'SELECT name FROM ' . $table;

            if ( is_array( $scopes ) && count( $scopes ) > 0 )
            {
                $query .= ' WHERE scope ';
                if ( $excludeScopes )
                    $query .= 'NOT ';
                $query .= "IN ('" . implode( "', '", $scopes ) . "')";
            }
            if ( $path != false && $scopes == false)
            {
                 $query .= " WHERE name LIKE '" . $path . "%'";
            }
            else if ( $path != false)
            {
                 $query .= " AND name LIKE '" . $path . "%'";
            }
            if ( $limit && array_sum($limit) )
            {
                $query .= " LIMIT {$limit[0]}, {$limit[1]}";
            }
            $rslt = $this->_query( $query, "_getFileList( array( " . implode( ', ', is_array( $scopes ) ? $scopes : array() ) . " ), $excludeScopes )" );
            if ( !$rslt )
            {
                eZDebug::writeError( 'Unable to get file list', __METHOD__ );
                throw new Exception(
                    "dfs/mysqli DB error: " . mysqli_error( $this->db ) . "\nSQL Query: $query",
                    mysqli_errno( $this->db )
                );
            }

            while ( $row = mysqli_fetch_row( $rslt ) )
            {
                $filePathList[] = $row[0];
            }

            mysqli_free_result( $rslt );
        }

        return $filePathList;
    }
public function _getFileList ( $ scopes = false , $ excludeScopes = false , $ limit = false , $ path = false ) { $ filePathList = array ( ) ; $ tables = array_unique ( array ( $ this -> metaDataTable , $ this -> metaDataTableCache ) ) ; foreach ( $ tables as $ table ) { $ query = 'SELECT name FROM ' . $ table ; if ( is_array ( $ scopes ) && count ( $ scopes ) > 0 ) { $ query .= ' WHERE scope ' ; if ( $ excludeScopes ) $ query .= 'NOT ' ; $ query .= "IN ('" . implode ( "', '" , $ scopes ) . "')" ; } if ( $ path != false && $ scopes == false ) { $ query .= " WHERE name LIKE '" . $ path . "%'" ; } else if ( $ path != false ) { $ query .= " AND name LIKE '" . $ path . "%'" ; } if ( $ limit && array_sum ( $ limit ) ) { $ query .= " LIMIT {$limit[0]}, {$limit[1]}" ; } $ rslt = $ this -> _query ( $ query , "_getFileList( array( " . implode ( ', ' , is_array ( $ scopes ) ? $ scopes : array ( ) ) . " ), $excludeScopes )" ) ; if ( ! $ rslt ) { eZDebug :: writeError ( 'Unable to get file list' , __METHOD__ ) ; throw new Exception ( "dfs/mysqli DB error: " . mysqli_error ( $ this -> db ) . "\nSQL Query: $query" , mysqli_errno ( $ this -> db ) ) ; } while ( $ row = mysqli_fetch_row ( $ rslt ) ) { $ filePathList [ ] = $ row [ 0 ] ; } mysqli_free_result ( $ rslt ) ; } return $ filePathList ; }
Returns the list of cluster files, filtered by the optional params

@param array|bool $scopes filter by array of scopes to include in the list
@param bool $excludeScopes if true, $scopes param acts as an exclude filter
@param array|bool $limit limits the search to offset limit[0], limit limit[1]
@param bool|string $path filter to include entries only including $path

@return array|false the db list of entries of false if none found
Returns the list of cluster files filtered by the optional params