I have created a new app NotesTutorial
The code for lib/Hook.php is
namespace OCA\NotesTutorial;
use OCP\Util;
class Hooks {
public static function connectHooks() {
\OCP\Util::connectHook(âOC_Filesystemâ, âpost_createâ, âOCA\NotesTutorial\Hooksâ, âpost_createâ);
\OCP\Util::connectHook(âOC_Userâ, âpost_loginâ, âOCA\NotesTutorial\Hooksâ, âpost_loginâ);
}
public static function c( $params ) {
$myfile = fopen("/home/sanjay/test/post_create.txt", âwâ);
$txt = "File Hooks post_create ";
fwrite($myfile, $txt);
}
public static function post_login($params) {
$myfile = fopen("/home/sanjay/test/post_login.txt", âwâ);
$txt = âPost Login Hook is called âŠâ;
fwrite($myfile, $txt);
}
}
User hook post_login is called but file hook post_create is not working.
The app is enabled.