Eric B.
Eric B.

Reputation: 24411

Duplicate class names in different paths in Symfony 1.4 causing problems

I've inherited a Symfony 1.4 application to manage. I'm running into a problem where I've created new classes and unknown to me, I've duplicated some existing class names (in other paths).

Apart from renaming my classes, is there anyway to specify a classpath of sorts to the class I want to use? In Java we can easily append the entire class path, but I'm not quite sure if/how this can be done in PHP5 and/or Symfony 1.4.

Is this even possible, or is my only choice to ensure I have no class name conflicts?

Upvotes: 0

Views: 767

Answers (2)

Eric B.
Eric B.

Reputation: 24411

There is another SO thread response where @Jan Míšek proposes a solution. Unfortunately it isn't marked as the accepted response, but it gives fairly good instructions how to migrate the Symfony2 autoloader which supports namespaces to Symfony 1.4.

Upvotes: 0

Youri
Youri

Reputation: 505

Namespaces is your solution. Check out http://www.php.net/namespaces.

Upvotes: 1

Related Questions