2017 © Pedro Peláez
 

library git-dl

Clone a Github repository with PHP & ZipArchive. Without using Git or exec()!

image

wbadrh/git-dl

Clone a Github repository with PHP & ZipArchive. Without using Git or exec()!

  • Monday, August 7, 2017
  • by wbadrh
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Download a Github repository with PHP.

Install with composer:

$ composer require wbadrh/git-dl

Example usage:

<?php

$git = new GitDownload('/your/downloads');

$author     = 'drhino';
$repository = 'git-dl';
$branch     = 'master';

$path = $git->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., (*1)

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., (*2)

v1.0.2 - Fixes CVE-2021-32708., (*3)

v1.0.1 - Adds documentation., (*4)

v1.0.0 - Initial release., (*5)

The Versions

07/08 2017

dev-master

9999999-dev https://github.com/wbadrh/git-dl

Clone a Github repository with PHP & ZipArchive. Without using Git or exec()!

  Sources   Download

MIT

The Requires

 

repository git github download clone ziparchive

07/08 2017

1.0.1

1.0.1.0 https://github.com/wbadrh/git-dl

Clone a Github repository with PHP & ZipArchive. Without using Git or exec()!

  Sources   Download

MIT

The Requires

 

repository git github download clone ziparchive

07/08 2017

1.0.0

1.0.0.0 https://github.com/wbadrh/git-dl

Clone a Github repository with PHP & ZipArchive. Without using Git or exec()!

  Sources   Download

MIT

The Requires

 

repository git github download clone ziparchive