Download the PHP package mirador/mirador without Composer

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

Mirador-PHP

A php client for the Mirador Image Moderation API. To get started, you will need an API Key, available at mirador.im. For questions about keys or support with this module please email [email protected].

Installation

The module is available on Packagist, and can be installed with composer (in your composer.json):

Getting Started

Examples

To see some simple usage, check out our examples.

Classifying Files

The php client supports working with a number of data types:

Every method has an associated single-request method, e.g., classifyFile for classifyFiles. These have a similar interface but only support processing of one item at a time.

\Mirador\API\Client#classifyFiles

All classification methods share an identical interface that allows for generally flexible input. The mirador API, and the object returned by the API allow for the attribution of an arbitrary identifier to your requests, to make post-processing of results easier. However, in cases where you do not specify an ID, the client will choose one (in a way that generally makes sense).

A very simple way to classify files is by filename:

Alternatively, you can specify an id by passing in an associative array:

It's pretty easy to use this method with the $_FILES superglobal:

Working with SplFileInfo and Subclasses

classifyFiles also accepts SplFileInfo objects and subclasses (e.g., Symfony/Laravel's UploadedFile). When an id is not specified, the output of SplFileInfo::getPathname() is used as the id:

\Mirador\API\Client#classifyFile

As in the other classification methods, classifyFiles has a corresponding single-request method, classifyFile. This can be used with the same interface as its multiple-request sibling:

Since the result is returned directly, any exceptions will be thrown instead of being available in an errors array:

\Mirador\API\Client#classifyBuffers

This has an identical usage/interface to classifyFiles, except that instead of passing in filenames or file objects, you only provide already-read buffers.

This method is useful when working with a library that only gives access to POST or PUT bodies, e.g., Slim framework's $app->request()->getBody().

When not explicitly specifying an ID, the client uses the index of the item in the parameters, since we can't derive a name from a file buffer:

For this reason, when working with buffers, it's good to specify an id (if you can):

\Mirador\API\Client#classifyBuffer

This is a simple helper when only classifying one buffer, it returns a \Mirador\API\Result object or throws \Mirador\API\RequestException on error:

\Mirador\API\Client#classifyDataUris

This method exists as a convenience for simplified client-server communication when using clients that work with data uris (e.g., in web applications). For example, given this javascript (using jQuery to be concise):

We could handle that request on the server with this code:

This example shows the singular, classifyDataUri, however, the multiple -- classifyDataUris, has an identical interface.

Classifying Urls

There are a couple of requirements to be mindful of when classifying urls, they must meet the following criteria:

Given that, the interface for classifying urls is identical to that when using classifyFiles

\Mirador\API\Client#classifyUrls

Since urls are text and are generally short, our client uses the url as an id by default:

However, as with classifying files, an id can be specified by passing an array:

\Mirador\API\Client#classifyUrl

As with the other methods/data types, you can also classify a single url using the convenience method classifyUrl. This will return a \Mirador\API\Result object or throw a \Mirador\API\RequestException:

\Mirador\API\Result

The \Mirador\API\Result object reprents the classification result for a single image/url. It has the following properties:

Method Output/Results

Multiple-request methods (e.g., classifyUrls) return an object with two properties:

Contributing / Issues

Please submit any issues as issues here on github, feel free to submit a pull request, or for immediate support, contact us at [email protected]. #


All versions of mirador with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ~4.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 mirador/mirador contains the following files

Loading the files please wait ....