hoaproject / Central

Hoa is a modular, extensible, and structured set of PHP libraries.
https://hoa-project.net/
Other
104 stars 8 forks source link

Removing from/import #8

Closed Hywan closed 10 years ago

Hywan commented 10 years ago

Hello :-),

As discussed during Apex'14, we are going to drop from/import. This construction is totally optionnal but it seems to be a “brake” for new incomers. Consequently, we are going to drop all of them.

Thoughts?

shouze commented 10 years ago

:+1: It was a python like feature about modules loading but we see that php world don't seem to be ready for that.

Anyway could be a proposal for php itself, we can open a subject on the php ml.

Hywan commented 10 years ago

@shouze use does the exact same things so… However, from/import go deeper. We will just replace this construction by the use keyword, but the code behind will stay since it is very important for Hoa in some places.

Pierozi commented 10 years ago

I have a question about how format we will implement for use. is FQDN or just the package ?

Example with import:

-> import('Dispatcher.Basic')
-> import('Router.Http')
-> import('Locale.Localizer.Coerce');

Use with only package:

use \Hoa\Dispatcher;               //new Dispatcher\Basic();
use \Hoa\Router;                   //new Router\Http();
use \Hoa\Locale;                   //new Locale\Locale();

Use with FQDN:

use \Hoa\Dispatcher\Basic;       //new Basic();
use \Hoa\Router\Http;            //new Http();
use \Hoa\Locale;                 //new Locale();
Hywan commented 10 years ago

We are going to declare only the library names I think, no the whole classnames (not necessary).

Pierozi commented 10 years ago

:+1: is also what I think.

How do you want organise the cleaning file, each person who want clean a library must open new issue or only do PR ?

Hywan commented 10 years ago

@Pierozi As you want.

Hywan commented 10 years ago

See http://wiki.hoa-project.net/projects:central:todo for the progression.