PHP Standard Recommendation

Last updated

The PHP Standard Recommendation (PSR) is a PHP specification published by the PHP Framework Interop Group. Similar to Java Specification Request for Java, it serves the standardization of programming concepts in PHP. The aim is to enable interoperability of components and to provide a common technical basis for implementation of proven concepts for optimal programming and testing practices. The PHP-FIG is formed by several PHP frameworks founders. [1]

Each PSR is suggested by members and voted according to an established protocol to act consistently and in line with their agreed upon processes. [2]

NumberNameDescriptionEditorCoordinatorSponsorStatus
PSR-0Autoloading StandardIt describes the mandatory requirements that must be adhered to for autoloader interoperability. [3] N/AN/AN/ADeprecated and substituted by PSR-4 [4]
PSR-1Basic Coding StandardIt comprises what should be considered the standard coding elements that are required to ensure a high level of technical interoperability between shared PHP code. [5] N/AN/AN/AAccepted [4]
PSR-2Coding Style GuideIt considers PSR-1 and it is intended to reduce cognitive friction when scanning code from different authors. It does so by enumerating a shared set of rules and expectations about how to format PHP code. [6] N/AN/AN/ADeprecated [7] [4] [8]
PSR-3Logger InterfaceIt describes a common interface for logging libraries. [9] Jordi BoggianoN/AN/AAccepted [4]
PSR-4Autoloading StandardIt describes a specification for autoloading classes from file paths. It is fully interoperable, and can be used in addition to any other autoloading specification, including PSR-0. This PSR also describes where to place files that will be auto loaded according to the specification. [10] Paul M. JonesPhil SturgeonLarry GarfieldAccepted [4]
PSR-5PHPDoc StandardThe main purpose of this PSR is to provide a complete and formal definition of the PHPDoc standard. This PSR deviates from its predecessor, the de facto PHPDoc Standard associated with phpDocumentor 1.x, to provide support for newer features in the PHP language and to address some of the shortcomings of its predecessor. [11] Mike van RielPhil SturgeonDonald GilbertDraft [4]
PSR-6Caching InterfaceThe goal of this PSR is to allow developers to create cache-aware libraries that can be integrated into existing frameworks and systems without the need for custom development. [12] Larry GarfieldPaul DragoonisRobert HafnerAccepted [4]
PSR-7HTTP Message InterfaceIt describes common interfaces for representing HTTP messages as described in RFC 7230 and RFC 7231, and URIs for use with HTTP messages as described in RFC 3986. [13] Matthew Weier O'PhinneyBeau SimensenPaul M. JonesAccepted [4]
PSR-8Huggable InterfaceIt establishes a common way for objects to express mutual appreciation and support by hugging. This allows objects to support each other in a constructive fashion, furthering cooperation between different PHP projects. [14] Larry GarfieldCal EvansPaul M. JonesAbandoned [4]
PSR-9Security DisclosureIt gives project leads a clearly defined approach to enabling end users to discover security disclosures using a clearly defined structured format for these disclosures. [15] Lukas Kahwe SmithKorvin SzantoLarry GarfieldAbandoned [4]
PSR-10Security AdvisoriesIt gives researchers, project leads, upstream project leads and end users a defined and structured process for disclosing security vulnerabilities. [16] Lukas Kahwe SmithLarry GarfieldKorvin SzantoAbandoned [4]
PSR-11Container InterfaceIt describes a common interface for dependency injection containers. The goal is to standardize how frameworks and libraries make use of a container to obtain objects and parameters (called entries in the rest of this document). [17] Matthieu Napoli, David NégrierPaul M. JonesJeremy LindblomAccepted [4]
PSR-12Extended Coding Style GuideIt extends, expands and replaces PSR-2, the coding style guide and requires adherence to PSR-1, the basic coding standard. [18] Michael CullumKorvin SzantoAlexander MakarovAccepted [4]
PSR-13Hypermedia LinksIt describes common interfaces for representing a hypermedia link. [19] Larry GarfieldMatthew Weier O’PhinneyMarc AlexanderAccepted [4]
PSR-14Event ManagerIt describes common interfaces for dispatching and handling events. [20] Larry GarfieldAccepted [4]
PSR-15HTTP Server Request HandlersIt describes common interfaces for HTTP server request handlers and HTTP server middleware components that use HTTP messages. [21] Woody GilkMatthew Weier O’PhinneyAccepted [4]
PSR-16Simple CacheIt describes a simple yet extensible interface for a cache item and a cache driver. [22] Paul DragoonisJordi BoggianoFabien PotencierAccepted [4]
PSR-17HTTP FactoriesIt describes a common standard for factories that create PSR-7 compliant HTTP objects. [23] Woody GilkMatthew Weier O’PhinneyAccepted [4]
PSR-18HTTP ClientIt describes a common interface for sending HTTP requests and receiving HTTP responses. [24] Tobias NyholmSara GolemonAccepted [4]
PSR-19PHPDoc tagsIt provides a complete catalog of tags in the PHPDoc standard. [25] Chuck BurgessDraft [4]
PSR-20ClockIt provides a standard way of accessing the clock - allowing interopability during testing, when testing behavior that has timing based side effects. [26] Chris SeufertChuck BurgessAccepted [4]
PSR-21InternationalizationTBD. [27] Navarr BarnierDraft [4]
PSR-22Application TracingTBD. [28] Adam AllportDraft [4]


The PHP-FIG official website has the PSR documentation that follows the RFC 2119 written by Scott Bradner in March 1997 at Harvard University.

Related Research Articles

<span class="mw-page-title-main">Eclipse (software)</span> Software development environment

Eclipse is an integrated development environment (IDE) used in computer programming. It contains a base workspace and an extensible plug-in system for customizing the environment. It is the second-most-popular IDE for Java development, and, until 2016, was the most popular. Eclipse is written mostly in Java and its primary use is for developing Java applications, but it may also be used to develop applications in other programming languages via plug-ins, including Ada, ABAP, C, C++, C#, Clojure, COBOL, D, Erlang, Fortran, Groovy, Haskell, JavaScript, Julia, Lasso, Lua, NATURAL, Perl, PHP, Prolog, Python, R, Ruby, Rust, Scala, and Scheme. It can also be used to develop documents with LaTeX and packages for the software Mathematica. Development environments include the Eclipse Java development tools (JDT) for Java and Scala, Eclipse CDT for C/C++, and Eclipse PDT for PHP, among others.

IronPython is an implementation of the Python programming language targeting the .NET and Mono frameworks. The project is currently maintained by a group of volunteers at GitHub. It is free and open-source software, and can be implemented with Python Tools for Visual Studio, which is a free and open-source extension for Microsoft's Visual Studio IDE.

PHPDoc is an adaptation of Javadoc format for the PHP programming language. It is still an informal standard for commenting PHP code, but it is in the process of being formalized. It allows external document generators like phpDocumentor, which is the de facto standard implementation, to generate documentation of APIs and helps some IDEs such as Zend Studio, NetBeans, JetBrains PhpStorm, ActiveState Komodo Edit and IDE, PHPEdit and Aptana Studio to interpret variable types and other ambiguities in the loosely typed language and to provide improved code completion, type hinting and debugging.

<span class="mw-page-title-main">Munin (software)</span>

Munin is a free and open-source computer system monitoring, network monitoring, and infrastructure monitoring software application.

This is a comparison of notable web frameworks, software used to build and deploy web applications.

<span class="mw-page-title-main">GitHub</span> Hosting service for software projects

GitHub, Inc. is an AI-powered developer platform that allows developers to create, store, and manage their code. It uses Git software, providing the distributed version control of Git plus access control, bug tracking, software feature requests, task management, continuous integration, and wikis for every project. Headquartered in California, it has been a subsidiary of Microsoft since 2018.

Pimcore is an open-source enterprise PHP software platform for product information management (PIM), master data management (MDM), customer data management (CDP), digital asset management (DAM), content management (CMS), and digital commerce.

<span class="mw-page-title-main">Homebrew (package manager)</span> Software installation management software

Homebrew is a free and open-source software package management system that simplifies the installation of software on Apple's operating system, macOS, as well as Linux. The name is intended to suggest the idea of building software on the Mac depending on the user's taste. Originally written by Max Howell, the package manager has gained popularity in the Ruby on Rails community and earned praise for its extensibility. Homebrew has been recommended for its ease of use as well as its integration into the command-line interface. Homebrew is a member of the Open Source Collective, and is run entirely by unpaid volunteers.

SWORD is an interoperability standard that allows digital repositories to accept the deposit of content from multiple sources in different formats via a standardized protocol. In the same way that the HTTP protocol allows any web browser to talk to any web server, so SWORD allows clients to talk to repository servers. SWORD is a profile (specialism) of the Atom Publishing Protocol, but restricts itself solely to the scope of depositing resources into scholarly systems.

<span class="mw-page-title-main">FuelPHP</span>

FuelPHP is an open-source web application framework written in PHP which implements the HMVC pattern.

mpv (media player) Free and open-source media player software

mpv is free and open-source media player software based on MPlayer, mplayer2 and FFmpeg. It runs on several operating systems, including Unix-like operating systems and Microsoft Windows, along with having an Android port called mpv-android. It is cross-platform, running on ARM, PowerPC, x86/IA-32, x86-64, and MIPS architecture.

<span class="mw-page-title-main">Composer (software)</span> Software; application level dependency manager for the PHP programming language

Composer is an application-level dependency manager for the PHP programming language that provides a standard format for managing dependencies of PHP software and required libraries. It was developed by Nils Adermann and Jordi Boggiano, who continue to manage the project. They began development in April 2011 and first released it on March 1, 2012. Composer is strongly inspired by Node.js's "npm" and Ruby's "bundler". The project's dependency solving algorithm started out as a PHP-based port of openSUSE's libzypp SAT solver.

Express.js, or simply Express, is a back end web application framework for building RESTful APIs with Node.js, released as free and open-source software under the MIT License. It is designed for building web applications and APIs. It has been called the de facto standard server framework for Node.js.

<span class="mw-page-title-main">ImpressPages</span>

ImpressPages is an open-source PHP framework with built-in content editor. Features include MVC engine, inline editing and drag&drop interface. It is distributed under the GNU GPL v.3.0 and MIT licences.

<span class="mw-page-title-main">Phalcon (framework)</span>

Phalcon is a PHP web framework based on the model–view–controller (MVC) pattern. Originally released in 2012, it is an open-source framework licensed under the terms of the BSD License.

<span class="mw-page-title-main">Pop PHP Framework</span> Free and open source PHP web framework

The Pop PHP Framework a free and open source PHP Web framework that was created by Nick Sagona. It is distributed under the BSD License and hosted on GitHub. The framework is intended to be utilized for rapid application development, with an emphasis on web applications.

<span class="mw-page-title-main">PeachPie</span>

PeachPie is an open-source PHP language compiler and runtime for the .NET Framework and .NET. It is built on top of the Microsoft Roslyn compiler platform and is based on the first-generation Phalanger project. PeachPie compiles source code written in PHP to CIL byte-code. PeachPie takes advantage of the JIT compiler component of the .NET Framework in order to handle the beginning of the compilation process. Its purpose is not to generate or optimize native code, but rather to compile PHP scripts into .NET assemblies containing CIL code and meta-data. In July 2017, the project became a member of the .NET Foundation.

References

  1. "PHP-FIG members list". PHP-FIG official website. hej. Retrieved 10 January 2016.
  2. "Voting Protocol". PHP Framework Interop Group. Retrieved 10 January 2016.
  3. "PSR-0: Autoloading Standard". PHP-FIG official website. Retrieved 10 January 2016.
  4. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 "PSR status list". PHP-FIG official website. Retrieved 10 January 2016.
  5. "PSR-1: Basic Coding Standard". PHP-FIG official website. Retrieved 10 January 2016.
  6. "PSR-2: Coding Style Guide". PHP-FIG official website. Retrieved 10 January 2016.
  7. "PHP Standards Recommendations - PHP-FIG". www.php-fig.org. Retrieved 2020-02-14.
  8. "PHP Standards Recommendations - PHP-FIG". www.php-fig.org. Retrieved 2020-05-09.
  9. "PSR-3: Logger Interface". PHP-FIG official website. Retrieved 10 January 2016.
  10. "PSR-4: Autoloading Standard". PHP-FIG official website. Retrieved 10 January 2016.
  11. "PSR-5: PHPDoc Standard". PHP Documentor official git repository at Github. Retrieved 10 January 2016.
  12. "PSR-6: Caching Interface". PHP-FIG official website. Retrieved 10 January 2016.
  13. "PSR-7: HTTP Message Interface". PHP-FIG official website. Retrieved 10 January 2016.
  14. "PSR-8: Huggable Interface". PHP-FIG official git repository at Github. Retrieved 10 January 2016.
  15. "PSR-9: Security Disclosure". PHP-FIG official git repository at Github. Retrieved 10 January 2016.
  16. "PSR-10: Security Advisories". PHP-FIG official git repository at Github. Retrieved 10 January 2016.
  17. "PSR-11: Container Interface". PHP-FIG PSR-11 official git repository at Github. Retrieved 10 January 2016.
  18. "PSR-12: Extended Coding Style Guide - PHP-FIG". www.php-fig.org. Retrieved 2020-06-04.
  19. "PSR-13: Link definition interfaces - PHP-FIG". www.php-fig.org. Retrieved 2019-02-04.
  20. "PSR-14: Event Dispatcher". PHP-FIG official git repository at Github. Retrieved 4 February 2019.
  21. "PSR-15: HTTP Server Request Handlers - PHP-FIG". www.php-fig.org. Retrieved 2019-02-04.
  22. "PSR-16: Common Interface for Caching Libraries - PHP-FIG". www.php-fig.org. Retrieved 2019-02-04.
  23. "PSR-17: HTTP Factories - PHP-FIG". www.php-fig.org. Retrieved 2019-02-04.
  24. "PSR-18: HTTP Client - PHP-FIG". www.php-fig.org. Retrieved 2019-02-04.
  25. "PSR-19: PHPDoc tags". PHP-FIG official git repository at Github. Retrieved 4 February 2019.
  26. "PSR-20: Clock - PHP-FIG". www.php-fig.org. Retrieved 2024-01-14.
  27. "PSR-21: Internationalization". PHP-FIG official git repository at Github. Retrieved 14 January 2024.
  28. "PSR-22: Application Tracing". PHP-FIG official git repository at Github. Retrieved 14 January 2024.