views:

456

answers:

2

I'm attempting to mix a PHP REST framework (Recess) with an webapp building framework (VCL4PHP), they unfortunately like to name their classes the same. Cache, Application (probably others, but I gave up at Application). Are there namespaces in PHP or any way I can get around this without rewriting one or the other frameworks or am I SF'ed?

+1  A: 

Namespaces for PHP will be introduced in PHP 5.3. Currently your best bet is to manually prefix the class names for each framework.

John Downey
+6  A: 

PHP 5.3 has namespaces, but PHP 5.3 is still under development and they wouldn't instantly solve your problems. For all practical instances you're going to have to drop one of the frameworks, unless you're planning on forking one of them so you can keep your custom classnames.

MathieuK
heheh thanks for the good answer, little too early in the game to consider forking either of those!
Peter Turner