I need to to a git checkout in pure PHP. I already tried this ( http://www.phpclasses.org/package/5310-PHP-Retrieve-project-files-from-GIT-repositories.html ) with HTTP and SASL, but I didn't really work. Then I took a look at GLIP ( https://github.com/patrikf/glip ), but that doesn't seem to have any functionality like this. Basically I need to
-replicate/clone a remote git repository
-"extract" master branch files into a specified directory
The main problem with PHP GIT is, that it just didn't supported all possible changes you could do in a commit. Only new files, no moving around of files. And it was also unable to extract files.
/edit: git is not installed and I also cannot install git
You can try with
Git Streamwrapper for PHP is a PHP library that allows PHP code to interact with one or multiple Git repositories from within an application. The library consists of a Git repository abstraction that can be used to programatically access Git repositories and of a stream wrapper that can be hooked into the PHP stream infrastructure to allow the developer to use file and directory access functions directly on files in a Git repository. The library provides means to access status information on a Git repository, such as the log, the current repository status or commit information, as well.
It requires Git to be installed on the machine though and is in beta as of this writing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With