public function listDirectory($directory, $recursive = false)
    {
        $results = $this->scanDirectory($directory, $recursive);

        if (false === $results) {
            throw new \RuntimeException(sprintf(
                'Unable to list directory "%s", maybe it is not a directory '.
                'or it does not exist.',
                $directory
            ));
        }

        return array(
            'files'       => $results[0],
            'directories' => $results[1]
        );
    }
public function listDirectory($directory, $recursive = false)
    {
        $results = $this->scanDirectory($directory, $recursive);

        if (false === $results) {
            throw new \RuntimeException(sprintf(
                'Unable to list directory "%s", maybe it is not a directory '.
                'or it does not exist.',
                $directory
            ));
        }

        return array(
            'files'       => $results[0],
            'directories' => $results[1]
        );
    }
public function listDirectory ( $ directory , $ recursive = false ) { $ results = $ this -> scanDirectory ( $ directory , $ recursive ) ; if ( false === $ results ) { throw new \ RuntimeException ( sprintf ( 'Unable to list directory "%s", maybe it is not a directory ' . 'or it does not exist.' , $ directory ) ) ; } return array ( 'files' => $ results [ 0 ] , 'directories' => $ results [ 1 ] ) ; }
Lists files and directories of the specified directory

The returned array is of the form:

array(
'files'       => array(...),
'directories' => array(...)
)

@param  string $directory
@param  Boolean $recursive

@return array
Lists files and directories of the specified directory