rfc:load-ext-by-name
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
rfc:load-ext-by-name [2016/05/10 12:54] – created francois | rfc:load-ext-by-name [2018/03/01 23:23] (current) – RFC was implemented in PHP 7.2 carusogabriel | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: Allow loading extensions by name ====== | ====== PHP RFC: Allow loading extensions by name ====== | ||
- | * Version: 1.0 | + | * Version: 1.1 |
- | * Date: 2016-05-10 | + | * Date: 2017-06-01 |
* Author: François Laupretre < | * Author: François Laupretre < | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
Line 9: | Line 9: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | This RFC proposes a portable | + | This RFC proposes a unified |
Today, ' | Today, ' | ||
- | Unfortunately, | + | Unfortunately, |
- | The situation is still worse on WIndows, where a ' | + | |
- | While seasoned PHP administrators are used to this mechanism, the issue remains | + | |
- | when writing documentation, | + | - On Windows, the file name has the form ' |
- | every case where a unified syntax would allow using the same configuration | + | |
- | in different environments. The typical example | + | |
- | the coexistence of a Windows development environment and a Linux production. In | + | |
- | this case, it is currently impossible to write a single configuration file that will work | + | |
- | in both environments, forcing developers to manually maintain two separate | + | |
- | versions of the file. | + | |
- | The issue is rather | + | While seasoned PHP administrators are used to this mechanism, this is a real issue for newcomers. |
- | corresponding to a given extension is well-known | + | |
+ | Under Unix/Linux, the typical mistake is to uncomment an ' | ||
+ | |||
+ | On Windows, the situation for newcomers is still more confusing, as the distributed ' | ||
+ | |||
+ | The issue may also appear when writing documentation and platform-agnostic scripts. | ||
+ | |||
+ | To summarize, I think that a unified syntax to enable extensions on every environment would make the life easier for a lot of people, especially those coming to PHP. | ||
+ | |||
+ | The issue is quite easy to solve because the logic to compute the file name | ||
+ | from an extension | ||
===== Proposal ===== | ===== Proposal ===== | ||
- | This RFC allows | + | This RFC proposes an extension to the mechanism used to load PHP and Zend extensions. In addition to file names, it adds support for bare extension name. Note that the current syntax, using file names, remains |
- | of the file name. File names remain | + | |
Example : | Example : | ||
Line 40: | Line 42: | ||
' | ' | ||
- | on Windows, | + | on Windows, a file named ' |
- | Example php.ini files will be modified because loading extensions by name | + | Example php.ini files are modified because loading extensions by name |
becomes the recommended way of configuring additional extensions to load. | becomes the recommended way of configuring additional extensions to load. | ||
- | File names remain supported | + | File names remain supported as legacy. |
Cases where the extension name is accepted : | Cases where the extension name is accepted : | ||
Line 50: | Line 52: | ||
- ' | - ' | ||
- ' | - ' | ||
- | - argument to the dl() function | + | - as argument to the dl() function |
Cases where the extension name cannot be used : | Cases where the extension name cannot be used : | ||
- The ' | - The ' | ||
- | - When specifying an absolute path, a filename must be provided. A line like ' | + | - When specifying an absolute path, a filename must be provided. A line mixing a specific directory with an extension name, like ' |
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
Line 62: | Line 64: | ||
===== Proposed PHP Version(s) ===== | ===== Proposed PHP Version(s) ===== | ||
- | 7.1 | + | 7.2 |
===== RFC Impact ===== | ===== RFC Impact ===== | ||
==== To SAPIs ==== | ==== To SAPIs ==== | ||
Line 83: | Line 85: | ||
This RFC does not pretend solving every difference that may exist between | This RFC does not pretend solving every difference that may exist between | ||
- | Windows and Unix configurations. Where paths are set, the differences will remain. | + | Windows and Unix '.ini' |
- | It allows to unify the configuration | + | |
- | difference is the ' | + | |
===== Unaffected PHP Functionality ===== | ===== Unaffected PHP Functionality ===== | ||
The ' | The ' | ||
- | |||
- | ===== Future Scope ===== | ||
- | |||
- | As it is possible to distinguish between PHP and Zend extensions at load time, | ||
- | the ' | ||
- | This is left for the future because specific constraints (like loading Zend | ||
- | extensions always before PHP ones) make it quite complex to implement. | ||
===== Proposed Voting Choices ===== | ===== Proposed Voting Choices ===== | ||
This RFC requires a 50%+1 majority. | This RFC requires a 50%+1 majority. | ||
+ | |||
+ | Vote is now closed. RFC is approved for inclusion in 7.2. | ||
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
===== Patches and Tests ===== | ===== Patches and Tests ===== | ||
Line 107: | Line 107: | ||
===== Implementation ===== | ===== Implementation ===== | ||
+ | |||
After the project is implemented, | After the project is implemented, | ||
- the version(s) it was merged to | - the version(s) it was merged to |
rfc/load-ext-by-name.1462884853.txt.gz · Last modified: 2017/09/22 13:28 (external edit)