protected function searchModulePath($namespace)
    {
        $targetPath = false;
        
        // Iterate trough the module directories
        foreach ($this->moduleDirectories as $directory => $excludePattern) {
            $recursiveDirectoryIterator = new \RecursiveDirectoryIterator($directory, \RecursiveDirectoryIterator::FOLLOW_SYMLINKS);
            $iterator = new \RecursiveIteratorIterator($recursiveDirectoryIterator);
            $regexIterator = new \RegexIterator($iterator, '/^.+\/Module\.json$/i');

            foreach ($regexIterator as $item) {
                // Ignore modules which are located inside a tests directory
                if ($excludePattern !== false && preg_match($excludePattern, $item->getPath())) {
                    continue;
                }
                
                $moduleNamespace = $this->getNamespaceFromModuleJson($item->getPath());
                
                if ($moduleNamespace === $namespace) {
                    $targetPath = $item->getPath();
                    break 2;
                }
            }
        }
        
        return $targetPath;
    }
protected function searchModulePath($namespace)
    {
        $targetPath = false;
        
        // Iterate trough the module directories
        foreach ($this->moduleDirectories as $directory => $excludePattern) {
            $recursiveDirectoryIterator = new \RecursiveDirectoryIterator($directory, \RecursiveDirectoryIterator::FOLLOW_SYMLINKS);
            $iterator = new \RecursiveIteratorIterator($recursiveDirectoryIterator);
            $regexIterator = new \RegexIterator($iterator, '/^.+\/Module\.json$/i');

            foreach ($regexIterator as $item) {
                // Ignore modules which are located inside a tests directory
                if ($excludePattern !== false && preg_match($excludePattern, $item->getPath())) {
                    continue;
                }
                
                $moduleNamespace = $this->getNamespaceFromModuleJson($item->getPath());
                
                if ($moduleNamespace === $namespace) {
                    $targetPath = $item->getPath();
                    break 2;
                }
            }
        }
        
        return $targetPath;
    }
protected function searchModulePath ( $ namespace ) { $ targetPath = false ; // Iterate trough the module directories foreach ( $ this -> moduleDirectories as $ directory => $ excludePattern ) { $ recursiveDirectoryIterator = new \ RecursiveDirectoryIterator ( $ directory , \ RecursiveDirectoryIterator :: FOLLOW_SYMLINKS ) ; $ iterator = new \ RecursiveIteratorIterator ( $ recursiveDirectoryIterator ) ; $ regexIterator = new \ RegexIterator ( $ iterator , '/^.+\/Module\.json$/i' ) ; foreach ( $ regexIterator as $ item ) { // Ignore modules which are located inside a tests directory if ( $ excludePattern !== false && preg_match ( $ excludePattern , $ item -> getPath ( ) ) ) { continue ; } $ moduleNamespace = $ this -> getNamespaceFromModuleJson ( $ item -> getPath ( ) ) ; if ( $ moduleNamespace === $ namespace ) { $ targetPath = $ item -> getPath ( ) ; break 2 ; } } } return $ targetPath ; }
Iterates over the available module directories and searches the
target namespace in the module directories. If the namespace is
found the function return the path to the module.

@access protected
@param string $namespace
@return string
Iterates over the available module directories and searches the target namespace in the module directories . If the namespace is found the function return the path to the module .