Skip to content

RoyVoetman/flysystem-gitlab-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flysystem Gitlab storage

A Gitlab Storage filesystem for Flysystem.

Latest Version MIT Licensed Total Downloads

This package contains a Flysystem adapter for Gitlab. Under the hood, Gitlab's Repository (files) API v4 is used.

Installation

composer require royvoetman/flysystem-gitlab-storage

Integrations

Usage

// Create a Gitlab Client to talk with the API $client = new Client('personal-access-token', 'project-id', 'branch', 'base-url'); // Create the Adapter that implentents Flysystems AdapterInterface $adapter = new GitlabAdapter($client)); // Create FileSystem $filesystem = new Filesystem($adapter); // write a file $filesystem->write('path/to/file.txt', 'contents'); // update a file $filesystem->update('path/to/file.txt', 'new contents'); // read a file $contents = $filesystem->read('path/to/file.txt'); // check if a file exists $exists = $filesystem->has('path/to/file.txt'); // delete a file $filesystem->delete('path/to/file.txt'); // rename a file $filesystem->rename('filename.txt', 'newname.txt'); // copy a file $filesystem->copy('filename.txt', 'duplicate.txt'); // delete a directory $filesystem->deleteDir('path/to/directory'); // see http://flysystem.thephpleague.com/api/ for full list of available functionality

Access token (required for private projects)

Gitlab supports server side API authentication with Personal Access tokens

For more information on how to create your own Personal Access token: Gitlab Docs

Project ID

Every project in Gitlab has its own Project ID. It can be found at to top of the frontpage of your repository. See

Base URL

This will be the URL where you host your gitlab server (e.g. https://gitlab.com)

Changelog

Please see CHANGELOG for more information what has changed recently.

License

The MIT License (MIT). Please see License File for more information.

About

Gitlab Storage filesystem for Flysystem (https://flysystem.thephpleague.com/docs/).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages