final public function ls($path, $exclude = array(".DS_Store", ".git", ".svn", ".CVS"), $recursive = FALSE, $recursivelimit = 0, $showfiles = FALSE, $sort = TRUE, $long = FALSE)
    {

        //1. Search $name as a folder or as a file
        if (!$this->is($path)) { //if in path is a directory
            return array();
        }

        $dirh = @opendir($path); //directory handler
//$recursion  = 0;
        $found = [];

        if ($dirh) {
            while (false !== ($file = readdir($dirh))) {
                // remove '.' and '..'
                if ($file == '.' || $file == '..' || in_array($file, $exclude)) {
                    continue;
                }

                $recursion = 0;
                $newPath = $path . $file;

                if ($this->isFolder($newPath) && $recursive && ($recursion < $recursiveLimit)) {
                    //echo $this->is($newPath)."<br />";
                    //echo $newPath."<br />";
                    $newRecursiveLimit = ((int)$recursiveLimit > 0) ? ((int)$recursiveLimit - 1) : 0;
                    $items = $this->list($newPath, $exclude, $recursive, $newRecursiveLimit);
                    $found = array_merge($items, $found);
                }

                $found[] = $newPath;
            }
            closedir($dirh);
        }

//@TODO if long, get additional info for each path;

        return $found;
    }