我正在使用来自 Luracast 的 restler 库,并且我想为我的 API 类使用命名空间。例如,我可以这样做:
$r = new Restler();
$r->addAPIClass('\fully\qualified\path\Foo');
$r->handle();
目前它在restler.php的第340行抛出一个错误:
Fatal error: Class 'Foo' not found in /work/projects/xxxx/lib/Restler/restler/restler.php on line 341
现在我有冲突的类名,我想使用命名空间而不是解决这个问题。