Download the PHP package ggioffreda/git-guardian without Composer

On this page you can find all versions of the php package ggioffreda/git-guardian. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package git-guardian

Git Guardian Component

This component helps querying remote services, like BitBucket and GitHub to get a list of repositories and helps cloning them locally for use or backup. It provides an command line interface utility, read below for more information.

The requirements are specified in the composer.json file:

Build Status

Installation

This component is available for installation through composer. From command line run:

$ composer require "ggioffreda/git-guardian" "~0.1"

Or add the following to your composer.json in the require section:

"require": {
    "ggioffreda/git-guardian": "~0.1"
}

For more information check the project page on Packagist.

API

You can use the Gioffreda\Component\GitGuardian\GitGuardian class to bulk clone your repositories into a destination. The following is an example on how to do so:

The GitGuardian class emits a range of events that allows you to monitor the status:

Remote Adapter

You can use the Gioffreda\Component\GitGuardian\Adapter\BitBucketRemote class to fetch the list of repositories owned by a specified user. If you provide the OAuth2 client ID and secret you can fetch the private ones as well. Here's an example on own to use the class:

You can listen to the discovery event of a repo to get the original raw definition fetched from the service by listening to the event git_remote.repository_discovery, for example to show a message in your console or to get more information about the repository than what you can get from the returned Gioffreda\Component\GitGuardian\Adapter\BitBucketRepository object.

Available events emitted by the remote adapter are:

Command Line Interface

You can use the provided command bin/git-guardian to clone your repositories or list the known ones that you've already cloned locally. The command line interface is built using the Symfony Console Component and can be easily integrated in your Symfony project.

Cloning all repositories

To clone all the repositories that belongs to a user, or users if you specify more than one you can use the built in command git:guardian:clone-all.

For example to clone locally your BitBucket repositories, including your private ones, run the built-in command like so:

$ ./bin/git-guardian git:guardian:clone-all \
    --client-id=SbAnN_example --client-secret=1JEfYU1nYhkoC_example \
    ggioffreda

This will clone all repositories of the given user locally. You can specify the destination directory. You can provide more than one username or team name and the below command will clone all repositories that belongs to those users or teams. This is an example:

$ ./bin/git-guardian git:guardian:clone-all \
    --client-id=SbAnN_example --client-secret=1JEfYU1nYhkoC_example \
    ggioffreda myorganisation mycompany myfriend

The command above will clone not only the public repositories for those users or teams, it will clone everything you have access to. If you do not provide the client ID and secret the command will clone only public repositories:

$ ./bin/git-guardian git:guardian:clone-all -v \
    ggioffreda myorganisation mycompany myfriend

The -v switch will ask for verbose output so you can see what's going on while the command runs.

Another example for cloning locally your GitHub repositories, including your private ones, is:

$ ./bin/git-guardian git:guardian:clone \
    --adapter=GitHub --personal-token=6a67fbb73cd_example \
    ggioffreda

The way GitHub authenticates is slightly different, so you have to provide your personal access token and your username as first user in the list of users/organisations you want to clone. This will clone all private repositories you have access to as well as the public ones for any other users you give on the command line. Since GitHub handles users and organisations differently you have to provide them as follows:

$ ./bin/git-guardian git:guardian:clone \
    --adapter=GitHub --personal-token=6a67fbb73cd_example \
    ggioffreda orgs/mycompany users/myfriend

You can clone just the public repositories without providing your personal access token, like so:

$ ./bin/git-guardian git:guardian:clone \
    --adapter=GitHub users/ggioffreda orgs/mycompany users/myfriend

Note that now your username requires to be identified as user and not organisation, otherwise the command will throw an error.

The help looks like below:

List all known repositories

To list all known repositories you can run:

$ ./bin/git-guardian git:guardian:list-known

You can specify a different adapter, the destination where the repositories have been cloned and a different format. Available formats are:

Resources

You can run the unit tests with the following command (requires phpunit):

$ cd path/to/Gioffreda/Component/Git/
$ composer.phar install
$ phpunit

License

This software is distributed under the following licenses: GNU GPL v2, MIT License. You may choose the one that best suits your needs.


All versions of git-guardian with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
ggioffreda/git Version >=0.1.3,<1.0
symfony/console Version >=2.4,<4.0
guzzlehttp/guzzle Version ~6.0
symfony/filesystem Version >=2.4,<4.0
league/event Version >=2.0,<3.0
symfony/finder Version >=2.4,<4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ggioffreda/git-guardian contains the following files

Loading the files please wait ....