Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision |
rfc:autoload_include [2009/11/22 17:06] – lsmith | rfc:autoload_include [2010/01/05 15:08] – stream_resolve_include_path was added to 5.3.3 lsmith |
---|
====== Alternative to include/require for autoloaders ====== | ====== Alternative to include/require for autoloaders ====== |
* Version: 0.9 | * Version: 1.0 |
* Date: 2009-11-10 | * Date: 2009-11-10 |
* Author: Lukas Smith <smith@pooteeweet.org> | * Author: Lukas Smith <smith@pooteeweet.org> |
* Status: Draft | * Status: updated stream_resolve_include_path() was added in PHP 5.3.3 |
* First Published at: http://wiki.php.net/rfc/autoload_include | * First Published at: http://wiki.php.net/rfc/autoload_include |
| |
This RFC aims to offer an alternative solution to the well known fopen() "hack" used in autoloaders in order to verify the existence of files inside the include path. | This RFC aims to offer an alternative solution to the well known fopen() "hack" used in autoloaders in order to verify the existence of files inside the include path. |
| |
===== Introduction ===== | ===== Introduction ===== |
| |
"stream_resolve_include_path() as currently constructed could not be intercepted, and is actually unable to process an include_path that contains streams. I'm guessing it was written long before PHP 5.3. This could be easily fixed by having stream_resolve_include_path call zend_resolve_path() instead of doing its own internal calculations. With these changes, an opcode cache could easily cache the results." | "stream_resolve_include_path() as currently constructed could not be intercepted, and is actually unable to process an include_path that contains streams. I'm guessing it was written long before PHP 5.3. This could be easily fixed by having stream_resolve_include_path call zend_resolve_path() instead of doing its own internal calculations. With these changes, an opcode cache could easily cache the results." |
| |
===== Changelog ===== | ===== Patches ===== |
| |
| * [[http://valokuva.org/patches/php/new/stream_resolve_include_path.txt}|patch to add an improved stream_resolve_include_path() to 5.3]] |