PHP Namespaces and Yii

It would be nice to not force the requirement of PHP 5.3 namespaces to map directly to file system paths.

As it is now, the namespace:


needs to maps to the alias:


which maps to a directory path on the file system.

What I currently can’t seem to do is have a namespace that spans multiple directories.

Will be in Yii2.

I stumbled upon a similar problem and asked myself: “Wouldn’t this violate the PSR-0”?

Does that matter? Yii’s autoloader must support PSR-0 to have the ability to load 3rd party librarys and custom stuff. Also the application structure generated by yiic should follow PSR-0. In addition to that the autoloader itself should follow PSR-0(meaning its physical location) to be loaded from another library (using yii as 3rd party library). But I don’t think that unindependent classes of the core have to follow psr-0 (as long as the autoloader can find them fast). Same goes for applications. They should follow PSR-0 by default. But we should have the option to use our preffered structure.

Haven’t worked with proem, yet. But I’m looking forward to a simliar looking autoloader in Yii2