简体   繁体   中英

PHP Class Name Conflict

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?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM