Download the PHP package boxuk/describr without Composer

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

Describr

Describr is an object-oriented library for describing files. It uses a plugins to determine as much information as it can about a file.

Describr can be run from the command line via a supplied script, or it can be integrated into any PHP project to gather information about a variety of file types. You can write your own plugins, and a few of the file types Describr supports "out of the box" with the bundled plugins include:

If there's a file you want to interrogate and its type isn't supported, you can add a plugin to {describr root}/lib/BoxUK/Describr/Plugins and it will automatically be picked up and ready for use!

Requirements:

Plugins may have their own requirements. Some of the requirements for bundled plugins are:

Installation

It's easy to get Describring! If you just want to use it without writing plugins, you can install through our PEAR channel, pear.boxuk.net (check our Box UK Labs page for details on that), but we're assuming that because you're here on our Github you want to get stuck in and grab the source. Great! Here's how you do it:

  1. Install Zend Framework version 1.(latest). Probably best installed via PEAR so it's automatically on your PHP path, else you'll need to add it to the path manually.
  2. Download or checkout PHP-reader 1.8.1 or better and add it to your PHP include path.
  3. Grab the source from Github by cloning the repo (or downloading the zip).

What if I can't add things to my php include path?

If, in stages (1) and (2), you weren't able to add Zend and PHP-Reader to your PHP include path, you can do the following:

In the root of Describr, copy {describr root}/lib/bootstrap.custom.php-sample to {describr root}/lib/bootstrap.custom.php. You'll now need to edit {describr root}/lib/bootstrap.custom.php and provide a path to PHP-Reader. You might also need to set a path to Zend Framework in there too.

If you don't include the Zend Framework and PHP-Reader, Describr will still work but you will not be able to use it to get much information about audio/video files.

Using Describr

It's time to test that Describr is installed and ready to rock! We've provided a simple command line executable script to help you do this, so if you're on Linux/OSX/Unix, chmod {describr root}/bin/describr to be executable. On Windows, you should just be able to run {describr root}/bin/describr.bat:

If you don't see the above, head back to the Installation section and see if there's anything you've missed. Failing that, there's a Troubleshooting section below

and then you should be able to do something like:

So, we're up and running! Unless we're not, in which case:

Troubleshooting

Please check that:

  1. Make sure you've chmodded {describr}/bin/describr to be executable if you're on Linux/Unix/OSX:

  2. Zend Framework and PHP-Reader are both on the PHP include path OR you are using a custom bootstrap.php. In the latter case, check that {describr root}lib/bootstrap.custom.php exists and $describr_pathToPHPReaderLibrary is set correctly. It must point to the "library" or "src" directory (depending on the version of php-reader you're using) - the one that contains the directory "Zend"
  3. Zend Framework should be installed. Installing this by PEAR is probably the cleanest way to do this, but if you are not able to use PEAR (e.g. you're on restrictive shared hosting, you can add the following to {describr root}/lib/bootstrap.custom.php:

Of course, you will have to adjust the paths to point to where Zend is installed. This is only as a last resort, it's better to use PEAR.

Any other problems, please put in an issue on the Github project for Describr and we'll try to help you out. As much info as possible, please!

Plugins

Describr is based around plugins. Each plugin has a list of file types that it knows how to describe. The built-in plugins live in {describr root}/lib/BoxUK/Describr/Plugins/BoxUK. Each plugin has one class that implements Plugin, mainly by extending AbstractPlugin.

Plugin dependencies

You specify the dependencies for each plugin in the plugin's code. Here's an example from ImagePlugin.php:

If the dependencies of a plugin are not met (i.e. checkDependencies() fails), that plugin cannot be used, and will fail silently and record an error when it finds a file it can match but can't report on because of missing dependencies:

Creating a plugin

Let's create a trivial plugin. This plugin will just estimate the number of tags in an XML file by counting the < characters and dividing by two - of course, you'd probably not do this in a production application but it should serve to illustrate Describr plugins!

We create a file {describr root}/lib/BoxUK/Describr/Plugins/Custom/XmlPlugin.php with the following contents:

Notice we haven't specified any dependencies here - it's all vanilla PHP.

Now, if we run our test script against Describr's own build.xml (for example), the XML plugin should automatically be used!

Accessing through your project

Using Describr on the command line is all well and good for getting going and testing plugins, but the meat of it is using it in a project to tell you about files. You can do something like:

This will give you a BoxUK\Describr\MediaFileAttributes object, which you can interrogate to find out which plugins said what about the file! The toArray method gives you what we've used so far in the command line scripts, or you can access it plugin-by-plugin for more fine-grained and powerful control.

Get involved!

If you find this project useful, or you've found a cool way of using it, let us know! If you've written any useful plugins, then by all means submit a pull request and we'll take a look!


All versions of describr with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
ext-fileinfo Version *
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 boxuk/describr contains the following files

Loading the files please wait ....