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:50] – make it clear that autoload_include is a working title 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 31: | Line 32: | ||
The current working title " | The current working title " | ||
- | |||
===== Optional related aspects ===== | ===== Optional related aspects ===== | ||
- | 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. | + | 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. |
+ | |||
+ | 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 ===== | ||
- | ===== Changelog ===== | + | * [[http:// |
rfc/autoload_include.1257871814.txt.gz · Last modified: 2017/09/22 13:28 (external edit)