src/mg/Ding/Bean/Factory/Driver/AnnotationDiscovererDriver.php
private function _getCandidateFilesForClassScanning($path)
    {
        $cacheKey = "$path.candidatefiles";
        $result = false;
        $files = $this->_cache->fetch($cacheKey, $result);
        if ($result === true) {
            return $files;
        }
        $files = array();
        if (is_dir($path)) {
            foreach (scandir($path) as $entry) {
                if ($entry == '.' || $entry == '..') {
                    continue;
                }
                $entry = "$path/$entry";
                foreach ($this->_getCandidateFilesForClassScanning($entry) as $file) {
                    $files[] = $file;
                }
            }
        } else if ($this->_isScannable($path)) {
            $files[] = realpath($path);
        }
        $this->_cache->store($cacheKey, $files);
        return $files;
    }
private function _getCandidateFilesForClassScanning($path)
    {
        $cacheKey = "$path.candidatefiles";
        $result = false;
        $files = $this->_cache->fetch($cacheKey, $result);
        if ($result === true) {
            return $files;
        }
        $files = array();
        if (is_dir($path)) {
            foreach (scandir($path) as $entry) {
                if ($entry == '.' || $entry == '..') {
                    continue;
                }
                $entry = "$path/$entry";
                foreach ($this->_getCandidateFilesForClassScanning($entry) as $file) {
                    $files[] = $file;
                }
            }
        } else if ($this->_isScannable($path)) {
            $files[] = realpath($path);
        }
        $this->_cache->store($cacheKey, $files);
        return $files;
    }
Returns all files elegible for scanning for classes.

@param string $path Absolute path to a directory or filename.

@return string[]