A (very small) API for parsing .gitmodules files.
The API returns instances of stdClass with the following properties:
$submodule->parent_pathis the path to the directory containing the .gitmodules file where this submodule is mapped. Used for nested submodules, and translating$submodule->pathto a real path.$submodule->nameis the name of the submodule. Not really used for anything.$submodule->pathis the local, relative path of the folder that has the submodule contents.$submodule->urlis the URL to the repo.$submodule->path_existsis true if the path to the submodule exists.$submodule->gitmodules_existsis true if the submodules own .gitmodules file exists. Will of course be false if path_exists is false.$submodule->is_githubis true if the submodule points to a GitHub repo.$submodule->authoris the GitHub username who owns the repo (url is parsed by Regex). Will be unset if not a GitHub repo.$submodule->repois the GitHub repo name (url is parsed by Regex). Will be unset if not a GitHub repo.
Returns an array of all Submodule objects referenced in the .gitmodules file located in the directory $dir (defaults to current working directory. No trailing slash is necessary.
Returns the Submodule objects named $name referenced in the .gitmodules file located in the directory $dir (defaults to current working directory. No trailing slash is necessary.