Yii Framework Forum: PHP Namespaces and Yii - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

PHP Namespaces and Yii Rate Topic: -----

#1 User is offline   takobell 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 26-September 11

Posted 31 January 2012 - 05:29 PM

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:
segment1\segment2\segment3
needs to maps to the alias:
segment1.segment2.segment3
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.
0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,308
  • Joined: 17-January 09
  • Location:Russia

Posted 05 February 2012 - 02:24 AM

Will be in Yii2.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#3 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 566
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 28 August 2012 - 06:39 AM

View Postsamdark, on 05 February 2012 - 02:24 AM, said:

Will be in Yii2.


I stumbled upon a similar problem and asked myself: "Wouldn't this violate the PSR-0"?
https://gist.github.com/1234504
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

#4 User is offline   Suralc 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 46
  • Joined: 10-January 12
  • Location:Germany

Posted 28 August 2012 - 08:50 AM

View Postschmunk, on 28 August 2012 - 06:39 AM, said:

I stumbled upon a similar problem and asked myself: "Wouldn't this violate the PSR-0"?
https://gist.github.com/1234504



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

http://proemframewor...autoloader.html
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users