https://github.com/drhino/git-dl
Clones a Github repository with PHP & ZipArchive. Without using Git or exec().
https://github.com/drhino/git-dl
composer-library github php zipfile
Last synced: 3 days ago
JSON representation
Clones a Github repository with PHP & ZipArchive. Without using Git or exec().
- Host: GitHub
- URL: https://github.com/drhino/git-dl
- Owner: drhino
- License: mit
- Created: 2017-08-07T01:07:59.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-06-26T01:23:13.000Z (almost 3 years ago)
- Last Synced: 2024-08-19T20:04:42.809Z (9 months ago)
- Topics: composer-library, github, php, zipfile
- Language: PHP
- Homepage:
- Size: 19.5 KB
- Stars: 8
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Download a Github repository with PHP.
### Install with composer:
```sh
$ composer require wbadrh/git-dl
```### Example usage:
```php
clone($author, $repository, $branch);// Prints: 'Saved to: /your/downloads/drhino/git-dl'
echo "Saved to: $path";```
## How does it work?
The zip-archive is downloaded from Github. Then unpacked with ZipArchive.
From version 1.1.x and above; A stream is used to keep a low memory footprint.
After a succesful unpack, the downloaded archive is removed.
Cloning an existing repository updates to the latest version.## Changelog:
v1.1.0
- Uses a stream for writing.
- The PHP cURL extension is no longer used.
- Supports both Flysystem 1 and 3 (PHP 7 and 8).
- Returns the directory path on success.
- Throws Exception.v1.0.2
- Fixes CVE-2021-32708.v1.0.1
- Adds documentation.v1.0.0
- Initial release.