PHP extension providing the accepted PSR interfaces
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests Add PSR-17 support Sep 10, 2018
.editorconfig Move release var init to PowerShell (#33) Feb 7, 2018
.gitattributes Minor improvements (#28) Dec 21, 2017
.gitignore PSR-15 support Feb 14, 2018
.travis.sh Add PSR-17 support Sep 10, 2018
.travis.yml Add PSR-17 support Sep 10, 2018
CHANGELOG.md Release v0.5.0 Sep 10, 2018
LICENSE.md Updated project documentation [ci skip] Feb 7, 2018
README.md Release v0.5.0 Sep 10, 2018
appveyor.psm1 Improved getting actual PHP version for AppVeyor (#40) Mar 5, 2018
appveyor.yml Remove unnecessary Win32 configure flags Feb 14, 2018
config.m4 Add PSR-17 support Sep 10, 2018
config.w32 Add PSR-17 support Sep 10, 2018
default.nix Allow specifing a specific version of PHP on NixOS Feb 7, 2018
package.xml Release v0.5.0 Sep 10, 2018
php5to7.h Improve editorconfig, change vim modeline to et (#25) Dec 20, 2017
php_psr.c Add PSR-17 support Sep 10, 2018
php_psr.h Release v0.5.0 Sep 10, 2018
psr_cache.c Improve editorconfig, change vim modeline to et (#25) Dec 20, 2017
psr_cache.h Improve editorconfig, change vim modeline to et (#25) Dec 20, 2017
psr_container.c Improve editorconfig, change vim modeline to et (#25) Dec 20, 2017
psr_container.h Improve editorconfig, change vim modeline to et (#25) Dec 20, 2017
psr_http_factory.c Add PSR-17 support Sep 10, 2018
psr_http_factory.h Add PSR-17 support Sep 10, 2018
psr_http_message.c Improve editorconfig, change vim modeline to et (#25) Dec 20, 2017
psr_http_message.h Improve editorconfig, change vim modeline to et (#25) Dec 20, 2017
psr_http_server_handler.c PSR-15 support Feb 14, 2018
psr_http_server_handler.h PSR-15 support Feb 14, 2018
psr_http_server_middleware.c PSR-15 support Feb 14, 2018
psr_http_server_middleware.h PSR-15 support Feb 14, 2018
psr_link.c Improve editorconfig, change vim modeline to et (#25) Dec 20, 2017
psr_link.h Improve editorconfig, change vim modeline to et (#25) Dec 20, 2017
psr_log.c Improve editorconfig, change vim modeline to et (#25) Dec 20, 2017
psr_log.h Improve editorconfig, change vim modeline to et (#25) Dec 20, 2017
psr_simple_cache.c Improve editorconfig, change vim modeline to et (#25) Dec 20, 2017
psr_simple_cache.h Improve editorconfig, change vim modeline to et (#25) Dec 20, 2017
test_mem.sh Fix invalid read in abstract logger, add FAST_ZPP usage Dec 9, 2015

README.md

php-psr

Build Status Build status Coverage Status License

This PHP extension provides the interfaces from the PSR standards as established by the PHP-FIG group. You can use interfaces provided by this extension in another extension easily - see this example.

Interfaces

Installation

Linux / macOS

Prerequisite packages are:

  • PHP development headers and tools
  • gcc >= 4.4 | clang >= 3.x | vc >= 11
  • GNU make >= 3.81
  • automake
  • autoconf

You will need the PHP development headers. If PHP was manually installed, these should be available by default. Otherwise, you will need to fetch them from a repository.

git clone https://github.com/jbboehr/php-psr.git
cd php-psr
phpize
./configure
make
make test
sudo make install

If you have specific PHP versions running:

git clone https://github.com/jbboehr/php-psr.git
cd php-psr
phpize
./configure --with-php-config=/usr/local/bin/php-config
make
make test
sudo make install

Add the extension to your php.ini:

echo extension=psr.so | tee -a /path/to/your/php.ini

Finally, restart the web server.

PECL / Windows

You may also be able to install this extension via PECL:

pecl install psr

or by downloading a DLL from PECL or windows.php.net and placing it in the appropriate directory.

Using with composer

In your project, you can prevent the installation of the unnecessary composer packages provided by this extension by adding the following to your composer.json. You will need to make sure the extension is installed and enabled in your PHP configuration. You may also want to consider leaving them installed to provide stubs to your IDE. This configuration is not suitable for a library published to packagist.

{
    "name": "sample/app",
    "require": {
        "ext-psr": "*"
    },
    "provide": {
        "psr/log": "^1",
        "psr/cache": "^1",
        "psr/http-message": "^1",
        "psr/container": "^1",
        "psr/link": "^1",
        "psr/http-server-handler": "^1",
        "psr/http-server-middleware": "^1",
        "psr/simple-cache": "^1",
        "psr/http-factory": "^1"
    },
}

This will use this PHP extension instead of downloading from packagist.

Credits

License

This project is open source software licensed under the Simplified BSD License. See the LICENSE.md file for more information.

PSR Interfaces: Copyright (c) 2012-present PHP Framework Interoperability Group.