function _nlist_helper($dir, $recursive, $relativeDir)
    {
        $files = $this->_list($dir, false);

        if (!$recursive || $files === false) {
            return $files;
        }

        $result = array();
        foreach ($files as $value) {
            if ($value == '.' || $value == '..') {
                if ($relativeDir == '') {
                    $result[] = $value;
                }
                continue;
            }
            if (is_array($this->_query_stat_cache($this->_realpath($dir . '/' . $value)))) {
                $temp = $this->_nlist_helper($dir . '/' . $value, true, $relativeDir . $value . '/');
                $result = array_merge($result, $temp);
            } else {
                $result[] = $relativeDir . $value;
            }
        }

        return $result;
    }
function _nlist_helper($dir, $recursive, $relativeDir)
    {
        $files = $this->_list($dir, false);

        if (!$recursive || $files === false) {
            return $files;
        }

        $result = array();
        foreach ($files as $value) {
            if ($value == '.' || $value == '..') {
                if ($relativeDir == '') {
                    $result[] = $value;
                }
                continue;
            }
            if (is_array($this->_query_stat_cache($this->_realpath($dir . '/' . $value)))) {
                $temp = $this->_nlist_helper($dir . '/' . $value, true, $relativeDir . $value . '/');
                $result = array_merge($result, $temp);
            } else {
                $result[] = $relativeDir . $value;
            }
        }

        return $result;
    }
function _nlist_helper ( $ dir , $ recursive , $ relativeDir ) { $ files = $ this -> _list ( $ dir , false ) ; if ( ! $ recursive || $ files === false ) { return $ files ; } $ result = array ( ) ; foreach ( $ files as $ value ) { if ( $ value == '.' || $ value == '..' ) { if ( $ relativeDir == '' ) { $ result [ ] = $ value ; } continue ; } if ( is_array ( $ this -> _query_stat_cache ( $ this -> _realpath ( $ dir . '/' . $ value ) ) ) ) { $ temp = $ this -> _nlist_helper ( $ dir . '/' . $ value , true , $ relativeDir . $ value . '/' ) ; $ result = array_merge ( $ result , $ temp ) ; } else { $ result [ ] = $ relativeDir . $ value ; } } return $ result ; }
Helper method for nlist

@param string $dir
@param bool $recursive
@param string $relativeDir
@return mixed
@access private
Helper method for nlist