A Gitlab Storage filesystem for Flysystem.
This package contains a Flysystem adapter for Gitlab. Under the hood, Gitlab's Repository (files) API v4 is used.
composer require royvoetman/flysystem-gitlab-storage
// 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 functionalityAccess 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
Every project in Gitlab has its own Project ID. It can be found at to top of the frontpage of your repository. See
This will be the URL where you host your gitlab server (e.g. https://gitlab.com)
In some cases, the need arises to debug the Http Messeages returned by the Gitlab API. For this need, the adapter has a built-in debug mode
. When this mode is enabled, it will tell the adapter to prevent catching the GuzzleHttp\Exception\GuzzleException
.
To check for the current state of de adaptor the isDebugEnabled
method can be called on the adapter.
Enabling debug mode can be done with either of the following two options:
$adapter = new GitlabAdapter($client, '', true); // Third parameter defines debug mode
$adapter->setDebug(true);
Please see CHANGELOG for more information what has changed recently.
Contributions are welcome and will be fully credited. We accept contributions via Pull Requests on Github.
README.md
and any other relevant documentation are kept up-to-date.The MIT License (MIT). Please see License File for more information.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4