Download the PHP package cedricziel/flysystem-gcs without Composer

On this page you can find all versions of the php package cedricziel/flysystem-gcs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package flysystem-gcs

flysystem-gcs - Flysystem Adapter for Google Cloud Storage

build status

Flysystem Adapter for Google cloud storage using the gcloud PHP library

Installation

Using composer:

How-To

Authentication

This library utilizes the PHP library google/cloud, which in turn uses google/auth.

Why is this important? It's important, because if you're authenticated locally, through the gcloud command-line utility, or running on a Google Cloud Platform VM, in many cases you are already authenticated, and you don't need to do anything at all, in regards to authentication.

For any other case, you will most probably want to export the environment variable GOOGLE_APPLICATION_CREDENTIALS with a value of the absolute path to your service account credentials that is authorized to use the Storage: Full Access oAuth2 scope, and you're all set.

All examples, including tests, make use of this behaviour.

If that's not what you want, you can create your own StorageClient object that's authenticated differently and pass it to the adapter class constructor as first argument.

Demo

There's a demo project that shows simple operations in a file system manager.

Public URLs to StorageObjects

The Adapter ships with 2 different methods to generate public URLs:

Read below to know when you will want to use the one or the other.

Flysystem Plugin

The standard way to generate public urls with this adapter would be to add a flysystem plugin to your FilesystemInterface instance.

The plugins needs a piece of configuration, telling it whether and which bucket to use in combination with the standard accessible https://storage.googleapis.com/bucket/object.url, or with a custom CNAME URL such as http://storage.my-domain.com.

Notice that GCS public access via CNAMEs is http only (no https).

Example: Standard public URL to bucket

Supposed you have a bucket my-application-bucket, configure the plugin as follows:

Example: Standard public URL to bucket with directory prefix

Supposed you have a bucket my-application-bucket with a directory prefix of my/prefix, append the prefix separated by a slash to the bucket name:

Example: Custom domain to bucket

Supposed you have setup a CNAME assets.example.com pointing to the public endpoint mentioned in the documentation, you would configure the plugin as follows:

Example: Custom domain to bucket with directory prefix

Supposed you have setup a CNAME assets.example.com pointing to the public endpoint mentioned in the documentation, and your filesystem uses a directory prefix of my/prefix you need to append the prefix to the url in the configuration and would configure the plugin as follows:

getUrl on the adapter / Laravel 5

The Storage services used in Laravel 5 do not use flysystem plugins.

The Laravel 5 specific flysystem instance checks if there's a getUrl method on the adapter object.

This method is implemented on the Adapter, which is why you can add the adapter directly and use it right away:

Development

Some tests require actual access to GCS. They can be configured through the environment.

variable meaning
GOOGLE_APPLICATION_CREDENTIALS absolute path to the service account credentials *.json file
GOOGLE_CLOUD_BUCKET name of the GCS bucket to perform the tests on
GOOGLE_CLOUD_PROJECT the cloud project id to use

Code Style

You can use PHP-CS-Fixer to format the code:

License

MIT


All versions of flysystem-gcs with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
google/cloud-storage Version ^1.3
league/flysystem Version ^1.0.40
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cedricziel/flysystem-gcs contains the following files

Loading the files please wait ....