[Owncloud] Interfaces for Group and User backends

Arthur Schiwon blizzz at owncloud.com
Wed Jul 25 11:27:37 UTC 2012


Hey all,

just an info for those who need to deal with user or group backends.

Until now it was needed to extend the OC_User_Backend resp. 
OC_Group_Backend class to create a valid backend that will pass the 
checks in useBackend. Unfortunately it made your life complicated when 
you want your own backend to extend another class as there is no multi 
inheritance in PHP.

I added an interface [1] for each of the backends that you can (not 
must) now implement  it instead of subclassing the backend, e.g.

class USER_LDAP extends lib\Access implements \OCP\UserInterface { ... }

It's backwards compatible, so sublcassing the OC backend will still work.

Cheers
Arthur

[1] http://www.php.net/manual/en/language.oop5.interfaces.php



More information about the Owncloud mailing list