Download the PHP package cpliakas/git-wrapper without Composer

On this page you can find all versions of the php package cpliakas/git-wrapper. 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-wrapper

PHP Wrapper around GIT

Total Downloads Latest Stable Version

Git Wrapper provides a readable API that abstracts challenges of executing Git commands from within a PHP process for you.

Install

Usage

All command methods adhere to the following paradigm:

Replace command with the Git command being executed, e.g. checkout, push, etc. The $arg* parameters are a variable number of arguments as they would be passed to the Git command line tool. $options is an optional array of command line options in the following format:

Logging

Use the logger listener with PSR-3 compatible loggers such as Monolog to log commands that are executed.

Gotchas

There are a few "gotchas" that are out of scope for this library to solve but might prevent a successful implementation of running Git via PHP.

Missing HOME Environment Variable

Sometimes the HOME environment variable is not set in the Git process that is spawned by PHP. This will cause many Git operations to fail. It is advisable to set the HOME environment variable to a path outside of the document root that the web server has write access to. Note that this environment variable is only set for the process running Git and NOT the PHP process that is spawns it.

It is important that the storage is persistent as the ~/.gitconfig file will be written to this location. See the following "gotcha" for why this is important.

Missing Identity And Configurations

Many repositories require that a name and email address are specified. This data is set by running git config [name] [value] on the command line, and the configurations are usually stored in the ~/.gitconfig file. When executing Git via PHP, however, the process might have a different home directory than the user who normally runs git via the command line. Therefore no identity is sent to the repository, and it will likely throw an error.

Commits To Repositories With No Changes

Running git commit on a repository with no changes fails with exception. To prevent that, check changes like:

Permissions Of The GIT_SSH Wrapper Script

On checkout, the bin/git-ssh-wrapper.sh script should be executable. If it is not, git commands will fail if a non-default private key is specified.

Timeout

There is a default timeout of 60 seconds. This might cause "issues" when you use the clone feature of bigger projects or with slow internet.


All versions of git-wrapper with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
symfony/process Version ^4.4|^5.1
symfony/event-dispatcher Version ^4.4|^5.1
nette/utils Version ^3.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 cpliakas/git-wrapper contains the following files

Loading the files please wait ....