protected function rglob($pattern, $excludes = array()) {
        $files = array();
        foreach (glob($pattern, 0) as $item) {
            if (!empty($excludes) && in_array(ltrim($item, '\.\/'), $excludes)) {
                $this->trace("Skipping excluded item ./%s", ltrim($item, '\.\/'));
                continue;
            }
            if (is_dir($item)) {
                $this->debug("Globbing files in directory %s", $item);
                $files = array_merge($files, $this->rglob($item.'/*', $excludes));
            } else {
                array_push($files, ltrim($item, '\.\/'));
            }
        }
        return $files;
    }