» » psr

 
Sort articles by: Date | Most Rates | Most Views | Comments | Alphabet

PHP PSR-4 Autoloader

Author: bamboo06 on 15-02-2019, 00:56, views: 1550

0 Prior to PSR-4, PHP components and frameworks used the magic method _autoload() or spl_autoload_register() to implement their own autoloaders, so we learned to use each component and framework's unique autoloader, and Nowadays, everyone follows PSR-4, which means we can mix and match multiple PHP components with just one autoloader.
PHP PSR-4 Autoloader

The PHP framework works with an automatic loading mechanism. Autoloading is the process by which the PHP interpreter automatically finds and loads PHP classes as needed at runtime. This is an amazing feature that links many interoperable components of the modern PHP ecosystem.

Category: PHP Scripts

 

PHP PSR-3 Log Interface Specification

Author: bamboo06 on 2-02-2019, 17:34, views: 2558

0 The main purpose of this specification is to allow the log class library to log information in a simple and generic way by receiving a PsrLogLoggerInterface object. The framework and the CMS content management system can extend this interface if necessary, but this specification is required to ensure that the log interface can still be properly connected when using third-party class library files. This article develops a generic interface specification for the log class library.
PHP PSR-3 Log Interface Specification

The implementers in this article refer to the class libraries or frameworks that implement the LoggerInterface interface. Conversely, they are the users of LoggerInterface.

Category: PHP Scripts

 

PHP PSR-2 code style specification

Author: bamboo06 on 2-02-2019, 17:26, views: 1450

0 This specification is an inheritance and extension of the PSR-1 basic code specification. This specification hopes to reduce the inconvenience caused by the different styles of the code when browsing the code of different authors by formulating a series of rules for normalizing PHP code.
PHP PSR-2 code style specification

When multiple programmers work together on multiple projects, a common coding specification is needed. The style specification in this article is derived from the common characteristics of multiple different project code styles. Therefore, the value of this specification is that we all follow This coding style is not about itself.

Category: PHP Scripts

 

PHP PSR-1 basic code specification

Author: bamboo06 on 2-02-2019, 17:06, views: 1553

0 Encoding specifications and standards are extremely important when working with groups to develop PHP projects. Next, let's revisit the PHP code related specifications developed by the FIG organization. The current general specifications are: PSR-1 basic code specification, PSR-2 code style specification, PSR-3 log interface specification, PSR-4 Autoloader automatic loading specification.
PHP PSR-1 basic code specification

The PSR-1 Basic Code Specification establishes standards for the basic elements of the code to ensure a high degree of interoperability between shared PHP code.

Category: PHP Scripts