GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jbboehr/php-psr: PHP extension providing the accepted PSR interfaces

BranchesTags
Open more actions menu

Latest commit

 

History

199 Commits
199 Commits

Folders and files

NameName
Last commit message
Last commit date
.ci
.ci
 
 
.github
.github
 
 
nix
nix
 
 
tests
tests
 
 
.dockerignore
.dockerignore
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
config.m4
config.m4
 
 
config.w32
config.w32
 
 
flake.lock
flake.lock
 
 
flake.nix
flake.nix
 
 
package.xml
package.xml
 
 
php_psr.c
php_psr.c
 
 
php_psr.h
php_psr.h
 
 
psr_cache.c
psr_cache.c
 
 
psr_cache.h
psr_cache.h
 
 
psr_container.c
psr_container.c
 
 
psr_container.h
psr_container.h
 
 
psr_event_dispatcher.c
psr_event_dispatcher.c
 
 
psr_event_dispatcher.h
psr_event_dispatcher.h
 
 
psr_http_client.c
psr_http_client.c
 
 
psr_http_client.h
psr_http_client.h
 
 
psr_http_factory.c
psr_http_factory.c
 
 
psr_http_factory.h
psr_http_factory.h
 
 
psr_http_message.c
psr_http_message.c
 
 
psr_http_message.h
psr_http_message.h
 
 
psr_http_server_handler.c
psr_http_server_handler.c
 
 
psr_http_server_handler.h
psr_http_server_handler.h
 
 
psr_http_server_middleware.c
psr_http_server_middleware.c
 
 
psr_http_server_middleware.h
psr_http_server_middleware.h
 
 
psr_link.c
psr_link.c
 
 
psr_link.h
psr_link.h
 
 
psr_log.c
psr_log.c
 
 
psr_log.h
psr_log.h
 
 
psr_private.h
psr_private.h
 
 
psr_simple_cache.c
psr_simple_cache.c
 
 
psr_simple_cache.h
psr_simple_cache.h
 
 

Repository files navigation

php-psr

GitHub Build Status GitHub Windows Build Status Appveyor 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.

As of v1.2 of the extension, classes are defined in the PsrExt namespace and aliased into the Psr namespace.

Interfaces

PSR Reference
PSR-3 psr/log *
PSR-6 psr/cache
PSR-7 psr/http-message
PSR-11 psr/container
PSR-13 psr/link
PSR-14 psr/event-dispatcher
PSR-15 psr/http-server-handler
PSR-15 psr/http-server-middleware
PSR-16 psr/simple-cache
PSR-17 psr/http-factory
PSR-18 psr/http-client

Installation

Linux / macOS

Prerequisite packages are:

  • PHP development headers and tools, php >= 7.3
  • 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
/usr/local/bin/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.

Nix / NixOS

nix-env -i -f https://github.com/jbboehr/php-psr/archive/master.tar.gz

with a custom version of PHP:

nix-env -i -f https://github.com/jbboehr/php-psr/archive/master.tar.gz --arg php '(import <nixpkgs> {}).php71'

or, in a .nix file:

(import <nixpkgs> {}).callPackage (import (fetchTarball {
  url = https://github.com/jbboehr/php-psr/archive/v1.2.0.tar.gz;
  sha256 = "1c4jc09d46ac43kkckil8l76is973czwp0g6vhpnv5105l7z3zgi";
})) {}

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.

Note: LoggerInterfaceTest and TestLogger from psr/log are not implemented. If you use these classes, you should keep psr/log installed (discussion).

{
    "name": "sample/app",
    "require": {
        "ext-psr": "*"
    },
    "provide": {
        "psr/log": "1.0.0",
        "psr/cache": "1.0.0",
        "psr/http-message": "1.0.0",
        "psr/container": "1.1.1",
        "psr/link": "1.0.0",
        "psr/event-dispatcher": "1.0.0",
        "psr/http-server-handler": "1.0.0",
        "psr/http-server-middleware": "1.0.0",
        "psr/simple-cache": "1.0.0",
        "psr/http-factory": "1.0.0",
        "psr/http-client": "1.0.0"
    },
}

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

Credits

  • @sergeyklay - Appveyor and documentation improvements
  • @flyinghail - PSR-14, PSR-15, PSR-17, and PSR-18 support
  • @Jan-E - Original appveyor template
  • All Contributors

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.

About

PHP extension providing the accepted PSR interfaces

Topics

cdeus-vultphpphp-extensionphp-extensionsphp-figphp8psr

Resources

Readme
License
Activity

Stars

238 stars

Watchers

19 watching

Forks

33 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.