Download the PHP package alembic/mime without Composer

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

PHP-Mime

SensioLabsInsight Packagist (Composer) MIT License

Comprehensive MIME type mapping API, PHP clone of broofa/node-mime. MIME database from jshttp/mime-db.

Data sources

This library uses the mime-db repository. The updates are automatically pulled from their repository, using bin/pull-mime-db.php [out] [--with-apache].

By default this library exposes merged nginx + mime-db "custom types" (119 usable mimes) and extensions. Those are the most commons types of the Internet. The library also includes the Apache types. A lot of Apache types are, in most part, useless and they are very numerous (884 usable mimes), so, in order to reduce the memory footprint, Apache types are not loaded by default.

If you're searching for a library with more options and features, check hoaproject/Mime. If you need something simple, this library is for you ! For example, this library is perfect to implement a HTTP server that serves static files with a mime type based on the extension - since MIME scanning is too slow.

Install & Usage

composer require alembic/mime

Note: All the methods exposed below can be called statically or with an instance of the Mime class (more practical in DI environments). Please note that, even when using instance calls, the MIMEs database is shared because it is static.

API — Queries

Mime::lookup($path [, $fallback])

Get the mime type associated with a file, if no mime type is found $fallback (Mime::$defaultType by default, which is application/octet-stream) is returned. Performs a case-insensitive lookup using the extension in $path (the substring after the last '.'). E.g.

Mime::$defaultType

The mime type returned when Mime::lookup fails to find the extension searched for (default is the standard application/octet-stream).

Mime::extension($type)

Get the preferred extension for $type.

Mime::$defaultExtension

The extension returned when Mime::extension fails to find the type searched for (warning, default is null).

API — Defining Types

Custom type mappings can be added on a per-project basis via the following APIs.

Mime::define()

Add custom mime/extension mappings.

As said before, the first entry in the extensions array is returned by Mime::extension(). E.g.

Mime::load($filepath)

Load mappings from an Apache ".types" file or a Nginx file containing a types block. The format (Nginx or Apache) is automagically detected based on the content. Since the library uses file_get_contents(), the $filepath argument could be a filesystem path, an FTP path, an URL, whatever. If the file couldn't be loaded (wrong path or insufficient privileges), it throws a \RuntimeException.

The Apache .types file or the Nginx types block format is simple — see the examples directory for examples.

Mime::apacheExtend()

Loads the packaged database of merged mime-db+nginx+Apache MIME types and extensions. The basic database (mime-db+nginx) is loaded by default and weighs 8 KiB, when the all-in-one database loaded by this method weighs 70 KiB.


All versions of mime with dependencies

PHP Build Version
Package Version
No informations.
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 alembic/mime contains the following files

Loading the files please wait ....