Download the PHP package dotsunited/cabinet without Composer

On this page you can find all versions of the php package dotsunited/cabinet. 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 cabinet

Cabinet

Build Status

Cabinet is a PHP 5.3+ library providing a simple file storage layer.

It provides a unified API for storing and retrieving files as well as getting basic informations like size and content type of a file.

This is useful if

Cabinet offers adapters for PHP streams and Amazon S3 out of the box. But you can easily write your own adapters by implementing DotsUnited\Cabinet\Adapter\AdapterInterface.

Installation

Cabinet can be installed using the Composer tool. You can either add dotsunited/cabinet to the dependencies in your composer.json, or if you want to install Cabinet as standalone, go to the main directory and run:

You can then use the composer-generated autoloader to access the Cabinet classes:

Usage

Instances of Cabinet adapters can be either created directly or using the static DotsUnited\Cabinet\Cabinet::factory() method.

Using a Cabinet Adapter constructor

You can create an instance of an adapter using its constructor. An adapter constructor takes one argument, which is an array of configuration parameters.

Using the Cabinet factory

As an alternative to using an adapter constructor directly, you can create an instance of an adapter using the static method DotsUnited\Cabinet\Cabinet::factory().

The first argument is a string that names the adapter class (for example '\DotsUnited\Cabinet\Adapter\StreamAdapter'). The second argument is the same array of parameters you would have given to the adapter constructor.

Alternatively, the first argument can be an associative array. The adapter class is then read from the 'adapter' key. Optionally, it can contain a 'config' key holding the configuration parameters. In this case, the second argument will be ignored.

Managing files

Once you created the adapter, you can store, retrieve and get informations about files with the following methods:

Import a external local file:

Write data to a file:

Read data from a file:

Get a read-only stream resource for a file:

Copy a file internally:

Rename a file internally:

Delete a file:

Check whether a file exists:

Get a files size:

Get a files MIME content type:

Get the web-accessible uri for the given file:

Adapters

Cabinet offers two adapters:

Each adapter accepts its own set of configuration parameters which can be passed as an associative array to the constructor.

DotsUnited\Cabinet\Adapter\StreamAdapter

Configuration parameters for DotsUnited\Cabinet\Adapter\StreamAdapter:

DotsUnited\Cabinet\Adapter\AmazonS3Adapter

Configuration parameters for DotsUnited\Cabinet\Adapter\AmazonS3Adapter:

Filename filters

You can manipulate the filename you pass to each method of an adapter with filters. Filters are classes which implement DotsUnited\Cabinet\Filter\FilterInterface.

You can add filters like this:

If you need multiple filters, you can use DotsUnited\Cabinet\Filter\FilterChain like this:

Examples

Cabinet provides a filter to prepend a hashed subpath to the filename and is intended to be used with the DotsUnited\Cabinet\Adapter\StreamAdapter adapter.

This spreads the files over subdirectories to ensure performance by avoiding to many files in one directory. This is done by using a configurable number of characters of the filename's MD5 as a directory name. That pretty much guarantees an even spread.

Simply register the DotsUnited\Cabinet\Filter\HashedSubpathFilter filter with the adapter:

License

Cabinet is released under the New BSD License.


All versions of cabinet with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
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 dotsunited/cabinet contains the following files

Loading the files please wait ....