Download the PHP package offline/gitelephant without Composer

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

GitElephant

Latest Stable Version License Total Downloads Montly Downloads

Build Status Dependency Status Scrutinizer Quality Score Code Coverage SensioLabsInsight

GitElephant is an abstraction layer to manage your git repositories with php

This library officially supports git >= 1.8, older version are supported as well, but with some caveat.

How it works

GitElephant mostly rely on the git binary to retrieve information about the repository, read the output and create an OOP layer to interact with

Some parts are (or will be) implemented by reading directly inside the .git folder

The api is completely transparent to the end user. You don't have to worry about which method is used.

Requirements

*For php 7.1, please use GitElephant version 3.x

*For php 7.0, please use GitElephant version 2.x

*For php 5.x please use GitElephant version 1.x

This library is tested on linux, but it should work well with any unix system, as far as a git binary is available. For windows support, well.. if someone want to help?!

Installation

composer

To install GitElephant with composer you simply need to create a composer.json in your project root and add:

Then run

You have now GitElephant installed in vendor/cypresslab/gitelephant

And an handy autoload file to include in you project in vendor/autoload.php

How to use

By default GitElephant try to use the git binary on your system.

the Repository class is the main class where you can find every method you need...

Read repository

branches

tags

commits

remotes

status

If you build a GitElephant\Status\Status class, you will get a nice api for getting the actual state of the working tree and staging area.

all this methods returns a PhpCollection of StatusFile objects

a StatusFile instance has all the information about the tree node changes. File names (and new file names for renamed objects), index and working tree status, and also a "git style" description like: added to index or deleted in work tree

Manage repository

You could also use GitElephant to manage your git repositories via PHP.

Your web server user (like www-data) needs to have access to the folder of the git repository

Remote repositories

If you need to access remote repository you have to install the ssh2 extension and pass a new Caller to the repository. this is a new feature...consider this in a testing phase

A versioned tree of files

A git repository is a tree structure versioned in time. So if you need to represent a repository in a, let's say, web browser, you will need a tree representation of the repository, at a given point in history.

Tree class

The Tree class implements ArrayAccess, Countable and Iterator interfaces.

You can use it as an array of git objects.

A Object instance is a php representation of a node in a git tree

You can also pass a tree object to the repository to get its subtree

Diffs

If you want to check a Diff between two commits the Diff class comes in

The Diff class implements ArrayAccess, Countable and Iterator interfaces

You can iterate over DiffObject

A DiffObject is a class that implements ArrayAccess, Countable and Iterator interfaces. It represent a file, folder or submodule changed in the Diff.

Every DiffObject can have multiple chunks of changes. For example:

You can iterate over DiffObject to get DiffChunks. DiffChunks are the last steps of the Diff process, they are a collection of DiffChunkLine Objects

Testing

The library is fully tested with PHPUnit.

Go to the base library folder and install the dev dependencies with composer, and then run the phpunitt test suite

If you want to run the test suite you should have all the dependencies loaded.

Symfony

There is a GitElephantBundle to use this library inside a Symfony project.

Dependencies

for tests

Code style

GitElephant follows the:

Want to contribute?

You are my new hero!

Just remember:

Author

Matteo Giachino (twitter)

Many thanks to all the contributors

Thanks

Many thanks to Linus and all those who have worked/contributed in any way to git. Because it's awesome!!! I can't imagine being a developer without it.

Logo design by Stefano Lodovico

Analytics


All versions of gitelephant with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
symfony/process Version ~2.0|~3.0|~4.0
symfony/filesystem Version ~2.0|~3.0|~4.0
symfony/finder Version ~2.0|~3.0|~4.0
phpcollection/phpcollection Version ~0.4
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 offline/gitelephant contains the following files

Loading the files please wait ....