[owncloud-devel] Best way to register a Hook

Bernhard Posselt dev at bernhard-posselt.com
Fri Apr 10 07:23:33 GMT 2015


The second method is preferred, the first one is the legacy way to do 
it. The reason why there are two different ways is that most devs dont 
update the dev docs when they are adding new features or change stuff.

On 04/09/2015 09:07 PM, Daniel Araujo Melo wrote:
> Hi all,
>
> What is the best way to register a Hook?
>
> Owncloud's App Development Documentation presents 2 different ways:
>
> Using \OCP\Util::connectHook, as presented in https://doc.owncloud.org/server/8.0/developer_manual/app/init.html
> or
>
>
> $userManager->listen('\OC\User', 'preDelete', $callback);
> as presented in https://doc.owncloud.org/server/8.0/developer_manual/app/hooks.html
>
>
> There's any drawback related with any of them?
>
> Regards,
>
>
>
> _______________________________________________
> Devel mailing list
> Devel at owncloud.org
> http://mailman.owncloud.org/mailman/listinfo/devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.owncloud.org/pipermail/devel/attachments/20150410/c9def6f1/attachment.html>


More information about the Devel mailing list