Download the PHP package phine/psr4 without Composer

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

PSR-4

Build Status Coverage Status Latest Stable Version Total Downloads

A simple implementation of the PSR-4 standard.

Summary

The PSR-4 library provides a simple implementation of the PSR-4 standard. Also bundled with the library are classes for debugging the class autoloading process, as well as caching for improved performance.

Requirement

Installation

Via Composer:

$ composer require "phine/psr4=~1.0"

Usage

You may want to start by using the standard loading class:

With a new loader available, you will then want to map your namespace prefixes to their base directory paths.

While you may only register one namespace prefix at a time, you may specify one or more directory paths for each call to map(). To pass more than one directory path, you may simply pass an array of directory paths.

You may also chain calls to map() together:

When you are ready to use the loader, you will then need to register it:

You may register the loader at any point, such as before you begin mapping namespace prefixes to paths. Any namespace prefixes mapped after the loader is registered will be used by the loader as well.

You can now autoload classes for the namespace prefixes you registered:

Debugging

If you find that you are having problems autoloading classes, you may want to use the DebugLoader class. This class will throw an exception when either the file for the class could not be found, or if the class did not actually exist in the file that was loaded.

Using the debugging loader is as simple as using the standard loader:

Caching

When you are ready to use your project in a production environment, you may want to use a version of the loader that supports caching. Currently, only APC is supported, but additional support can be bundled with enough demand. If you need to support a caching library, you will want to mimic the code used for the bundled caching classes.

APC

You will need to create a new instance of APCLoader to use APC caching:

As part of the constructor, you need to specify a cache key prefix that will be used when storing class file paths in APC. The prefix can be whatever you need it to be.

Using the prefix PSR4-Classes- and loading the class My\Example will generate the cache key PSR4-Classes-My\Example for the class's file path.

It may be useful to know that once a class file path is cached, it will not expire or be refreshed if it no longer exists. You will need to flush the cache or using a versioning scheme for the prefix.

API Documentation

You can find the API documentation here.

License

This library is available under the MIT license.


All versions of psr4 with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
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 phine/psr4 contains the following files

Loading the files please wait ....