Question

I'm using the restler library from Luracast and I would like to use namespaces for my API classes. As an example, can I do:

$r = new Restler();
$r->addAPIClass('\fully\qualified\path\Foo');
$r->handle();

At present it's throwing an error on line 340 in restler.php:

Fatal error: Class 'Foo' not found in /work/projects/xxxx/lib/Restler/restler/restler.php on line 341

Right now I have conflicting class names and I'd like to use namespaces rather than hack around the problem.

Was it helpful?

Solution

Restler did not support namespaces until now!

We have just added namespaces support to Restler 2.1.7 and released it just now

$r = new Restler();
$r->addAPIClass('fully\qualified\path\Foo');
$r->handle();

should work fine now :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top