2017 © Pedro Peláez
 

library flysystem-git

Flysystem adapter for git repositories

image

shadiakiki1986/flysystem-git

Flysystem adapter for git repositories

  • Thursday, November 24, 2016
  • by shadiakiki1986
  • Repository
  • 1 Watchers
  • 3 Stars
  • 239 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 5 % Grown

The README.md

flysystem-git

Build Status, (*1)

Adapter for flysystem that interfaces to any git repository served with a node-git-rest-api server via git-rest-api-client-php, (*2)

Usage

Install from packagist, (*3)

composer install shadiakiki1986/flysystem-git

Launch a node-git-rest-api server, (*4)

docker run -p 8081:8081 -it shadiakiki1986/docker-node-git-rest-api

Example, (*5)

<?php
require_once 'vendor/autoload.php';

use League\Flysystem\Filesystem;

// prepare adapter
// http://github.com/shadiakiki1986/git-rest-api-client-php
$git = new \GitRestApi\Client('http://localhost:8081');

// for read-write, include the correct username/password below
$remote = 'https://someone:somepass@github.com/shadiakiki1986/git-data-repo-testDataRepo';
$repo = $git->cloneRemote($remote,1); // passing 1 for clone --depth to save some time for repositories with a long history

// for writing to the remote repo, i.e. if "push" variable below is true, need to set username and email
// not needed if read-only usage
$repo->putConfig('user.name','phpunit test flysystem-git');
$repo->putConfig('user.email','shadiakiki1986@gmail.com');

// initialize filesystem for further usage
$push = false; // set to false to make read/write possible without pushing to remote. Set to true to push to remote
$pull = true; // set to true to skip pulling from the remote repository at each transaction in order to save on time
$adapter = new \shadiakiki1986\Flysystem\Git($repo,$push,$pull);
$filesystem = new Filesystem($adapter);

// read a file
$contents = $filesystem->read('bla');

// if username/password above are correct, can also update the file
$filesystem->update('bla','some new content');

// write to a new file
$filesystem->write('new folder/new file','content of file');

The Versions

24/11 2016

dev-master

9999999-dev

Flysystem adapter for git repositories

  Sources   Download

The Requires

 

The Development Requires

by Shadi Akiki

24/11 2016

0.0.8

0.0.8.0

Flysystem adapter for git repositories

  Sources   Download

The Requires

 

The Development Requires

by Shadi Akiki

23/11 2016

0.0.7

0.0.7.0

Flysystem adapter for git repositories

  Sources   Download

The Requires

 

The Development Requires

by Shadi Akiki

23/11 2016

0.0.6

0.0.6.0

Flysystem adapter for git repositories

  Sources   Download

The Requires

 

The Development Requires

by Shadi Akiki

23/11 2016

0.0.5

0.0.5.0

Flysystem adapter for git repositories

  Sources   Download

The Requires

 

The Development Requires

by Shadi Akiki

22/11 2016

0.0.4

0.0.4.0

Flysystem adapter for git repositories

  Sources   Download

The Requires

 

The Development Requires

by Shadi Akiki

22/11 2016

0.0.3

0.0.3.0

Flysystem adapter for git repositories

  Sources   Download

The Requires

 

The Development Requires

by Shadi Akiki

22/11 2016

0.0.2

0.0.2.0

Flysystem adapter for git repositories

  Sources   Download

The Requires

 

The Development Requires

by Shadi Akiki

21/11 2016

0.0.1

0.0.1.0

Flysystem adapter for git-rest-ap

  Sources   Download

The Requires

 

The Development Requires

by Shadi Akiki