rfc:namespace_scoped_declares

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
rfc:namespace_scoped_declares [2016/09/23 20:46] nikicrfc:namespace_scoped_declares [2017/09/22 13:28] – external edit 127.0.0.1
Line 38: Line 38:
 </code> </code>
  
-For libraries using Composer this bootstrap file would be specified as an autoloader of type "file". However, if this kind of approach should prove popular, it might be possible to include this information directly in the ''composer.json'' and let Composer manage it:+For libraries using Composer this bootstrap file would be specified as a "files" autoloader
 + 
 +<code json> 
 +
 +    "autoload": { 
 +        "psr-4": { "Vendor\\Lib\\": "src/" }, 
 +        "files": ["src/bootstrap.php"
 +    } 
 +
 + 
 +</code> 
 + 
 +However, if this kind of approach should prove popular, it might be possible to include this information directly in the ''composer.json'' and let Composer manage it:
  
 <code json> <code json>
Line 173: Line 185:
  
 There is no implementation yet. There is no implementation yet.
 +
 +
 +===== TODOs =====
 +
 +  * Resolve open question "Handling of unknown directives"
 +  * Resolve open question "namespace_declare after namespace already used"
 +  * Consider adding some introspection functionality, such as ''get_namespace_declares()''
 +  * Investigate whether this mechanism can support the ''encoding'' directive, which is a lot more magic than the rest.
 +  * Actually implement this thing.
rfc/namespace_scoped_declares.txt · Last modified: 2022/01/25 18:22 by ilutov