rfc:autoload_include
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:autoload_include [2009/11/10 16:54] – added note about spl prefix lsmith | rfc:autoload_include [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Alternative to include/ | ====== Alternative to include/ | ||
- | * Version: | + | * Version: |
* Date: 2009-11-10 | * Date: 2009-11-10 | ||
* Author: Lukas Smith < | * Author: Lukas Smith < | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
This RFC aims to offer an alternative solution to the well known fopen() " | This RFC aims to offer an alternative solution to the well known fopen() " | ||
+ | |||
===== Introduction ===== | ===== Introduction ===== | ||
Line 35: | Line 36: | ||
A potential interesting additional difference could be to return the name of the loaded file in case the file was loaded successfully and the file does not return any value explicitly. This could make it possible to assist in caching the lookup. Potentially the " | A potential interesting additional difference could be to return the name of the loaded file in case the file was loaded successfully and the file does not return any value explicitly. This could make it possible to assist in caching the lookup. Potentially the " | ||
- | ===== Changelog | + | Alternative name proposals: |
+ | * include_silent | ||
+ | * contain | ||
+ | * superset | ||
+ | * import | ||
+ | * load | ||
+ | ===== Alternative proposals | ||
+ | |||
+ | ==== Add stream support to include/ | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | <code php> | ||
+ | if ($fp = @fopen($file, | ||
+ | include($fp); | ||
+ | fclose($fp); | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | However Stas notes that this would "this would break security distinction between file ops and include ops, when URLs are allowed for open but not include", | ||
+ | ==== Add function to resolve the include path ==== | ||
+ | |||
+ | Either add a " | ||
+ | |||
+ | That being said the current implementation needs some tweaks as Greg points out: | ||
+ | " | ||
+ | |||
+ | ===== Patches ===== | ||
+ | |||
+ | * [[http:// |
rfc/autoload_include.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1