On Sun, Sep 1, 2013 at 1:11 AM, Anthony Ferrara <ircmax...@gmail.com> wrote:
> All,
>
> There has been a lot of discussion unto the merit of this feature. That's
> fine.
>
> What I'd really like to know before proposing this is what can be improved
> in this RFC.
>
> For example: someone (Stas) brought up that it was weird that all three
> types (Class, Function, Constant) are served by a single register function
> (and multiple can be served by a single autoloader). Personally, I see this
> as a significant simplification advantage, but I can see if others don't.
> If you don't, can we please try to ideate around coming up with a better
> syntax?

I think adding two different functions and maintaining the general one
could be the way to go in this case.

The function names might look like this:
- spl_register_autoloader -> autoloader for everything
- spl_register_function_autoloader -> autoloader for functions/consts
- spl_register_class_autoloader -> current autoloader for classes only

Thinking on how PSRs work, one might register one autoloader for
classes and if they don't use any function/constant autoloading then
they don't need to take care of supporting them in the autoloader.
When a new PSR for function/constat autoloading will appear, that
loader could be registered to it's own
'spl_register_function_autoloader()'. If there'll be a special PSR
that covers both then that loader will need to call
'spl_register_autoloader()' and that's it.

I'm sure the names could be improved.


>
> Another example: I've received a lot of feedback that using the "php" root
> namespace is weird and unexpected. Does anyone agree? Should that be
> changed prior to proposing this feature?

Could we have something like the global namespace for classes where
'\' is the default namespace?

Or maybe alias php\ to \ namespace auto-magically?


> Let's try to improve this RFC to be the best it can prior to proposing and
> voting. Even if you don't think it's necessary, there are surely things you
> think can be improved (and hence everyone wins).
>
> Thanks
>
> Anthony
>
>

Those are the idea that I have in regards to this RFC. Hope they help.


Kind regards,

Florin Patan
https://github.com/dlsniper
http://www.linkedin.com/in/florinpatan

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to