Skip to content

API for updating github submodules to latest version of chosen branch.

Notifications You must be signed in to change notification settings

bjorn-ali-goransson/gitmodules-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 

Repository files navigation

PHP .gitmodules parser

A (very small) API for parsing .gitmodules files.

Submodule object

The API returns instances of stdClass with the following properties:

  • $submodule->parent_path is the path to the directory containing the .gitmodules file where this submodule is mapped. Used for nested submodules, and translating $submodule->path to a real path.
  • $submodule->name is the name of the submodule. Not really used for anything.
  • $submodule->path is the local, relative path of the folder that has the submodule contents.
  • $submodule->url is the URL to the repo.
  • $submodule->path_exists is true if the path to the submodule exists.
  • $submodule->gitmodules_exists is true if the submodules own .gitmodules file exists. Will of course be false if path_exists is false.
  • $submodule->is_github is true if the submodule points to a GitHub repo.
  • $submodule->author is the GitHub username who owns the repo (url is parsed by Regex). Will be unset if not a GitHub repo.
  • $submodule->repo is the GitHub repo name (url is parsed by Regex). Will be unset if not a GitHub repo.

Functions

gitmodules_get_all($dir = '.')

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.

gitmodules_get_all($name, $dir = '.')

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.

About

API for updating github submodules to latest version of chosen branch.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages