Download the PHP package coffreo/ceph-odm without Composer

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

Ceph ODM

Build Status codecov

This repository presents a Ceph odm based on Doctrine mapper skeleton.

Installation

The recommanded way to install this project is using composer:

Basic usage

First, you need to instanciate an Amazon S3 client:

use_path_style_endpoint is important, it allows to internally generate urls like http://my-ceph-server/mybucket instead of urls like http://mybucket.my-ceph-server/.

Once your client is instanciated, use it to create your ObjectManager:

Note that you can pass an Doctrine\Common\EventManager as create second argument if you have to deal with Doctrine events.

Create a bucket

Before creating objects, you must create a bucket for storing them into:

Create a new object

Be careful, only lowercase strings are accepted as metadata keys.

Update an object

Remove an object

Duplicate an object

You can easyly clone an object by persisting it again. The only thing to keep in mind is to detach the entity:

The object will be saved with a new id. You can also save it to another bucket:

Find an object by its identifiers

Bucket and id are the primary identifiers of objects.

In repository find methods, you must use the bucket name or a bucket object in your criteria:

Is the same thing as:

Other find methods

The previous statements only return objects that the logged user owns. For now, you can only perform a search on bucket and/or id.

Filter results by metadata

You can also use metadata as filter

Be careful, it's only a filter. It's not native, all files are retrieved, filtering is done after. Furthermore the criteria metadata => [] won't return all files without metadata. It means no metadata filter, so all the files will be returned according by the possible other criteria.

Sort results

The results can be sorted but it's not a database sort. The sort is done programmatically so it's not optimized and it's applyed after the bucket limit. By default, the results are ordered by bucket name and id. For ordering a query by a filename metadata (desc) and by id (asc):

Truncated results

For the find methods which return many files (findBy and findAll), if there is too many results (more than the limit you specified or 1000 by default), the names of the buckets where all the files couldn't be returned are returned by getBucketsTruncated:

Resume truncated queries

You can use the continue parameter to resume a previously truncated query. For instance for retrieving the files of mybucket that was not retrieved by the query above:

For making this possible, the repository keeps a pointer on the last file returned by bucket. Note that this pointer is modified when another query is done on the bucket; the calls bellow update the pointer for bucket mybucket:

This is another example for retrieving all files of the connected user:

Note that you can use findAll on the first call too.

Finally, the findByFrom method returns files starting after the given identifier:

Lazy load

When queries that return multiple results are used (i.e. queries which don't specify bucket and id), bin and metadata are not loaded directly since getting them requires to perform another specific server call per result. This library uses in these cases a lazy load strategy and retrieves bin and metadata only when getBin, getAllMetadata, getMetadata or setMetadata is called. You won't normally have to worry about it but it could be useful to be aware about it.


All versions of ceph-odm with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
doctrine/skeleton-mapper Version 0.0.1
aws/aws-sdk-php Version ^3.85
ramsey/uuid Version ^3.8
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 coffreo/ceph-odm contains the following files

Loading the files please wait ....