php-general Digest 6 Oct 2011 14:37:40 -0000 Issue 7507
Topics (messages 315152 through 315152):
Namespaced code with SabreDAV
315152 by: Andrew Mason
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Hello all,
I am trying to use the wonderful SabreDAV library to create a webdav
share. I have a demo up and running however the framework / class i'm
using is namespaced, and SabreDAV unfortunately does not have a 5.3
style namespace declaration.
I have an spl_autoload function registered in my base controller and
so long as I prefix the classname with a \ it all works:
$rootDirectory = new \Sabre_DAV_FS_Directory($rootDir);
// The server object is responsible for making sense out of the WebDAV protocol
$server = new \Sabre_DAV_Server($rootDirectory);
However, SabreDAV it's self has a large amount of other PHP classes
which it calls which obviously aren't prefixed with '\'
Is there a way i can tell PHP any class name that get's instanciated
with 'Sabre_' should resolve to '\Sabre' ?
Many thanks
Andrew
--- End Message ---