btwael / mammouth

Unfancy PHP
http://mammouth.boutglay.com
MIT License
214 stars 22 forks source link

import #34

Open marcioAlmada opened 10 years ago

marcioAlmada commented 10 years ago

I was just thinking about starting a project just like mammouth (with the exception I don't want it to look like coffeescript) when I found this page. I have one suggestion:

How about an import construct that creates a psr0 or psr4 autoload on the backstage? It could allow a far superior namespace usage:

import *  from /src/Vendor/Library

This would register a PHP autoload for /src/vendor folder and put an end to the annoying use statements hell. It could even autoload sub namespaces from psr0 and psr4 compliant code:

import Some\Sub\Namespace\*  from /src/Vendor/Library

This idea has big amount of room to improve, though. Would love to talk more about this if you think it's worth it.