register_hook('PLUGIN_SQLITE_DATABASE_UPGRADE', 'AFTER', $this, 'handle_migrations'); } /** * Call our custom migrations when defined * * @param Doku_Event $event * @param $param */ public function handle_migrations(Doku_Event $event, $param) { if ($event->data['sqlite']->getAdapter()->getDbname() !== 'notification') { return; } $to = $event->data['to']; if (is_callable([$this, "migration$to"])) { $event->result = call_user_func([$this, "migration$to"], $event->data); } } protected function migration1($data) { /** @var DokuWiki_Auth_Plugin $auth */ global $auth; /** @var \helper_plugin_notification_db $db_helper */ $db_helper = plugin_load('helper', 'notification_db'); $sqlite = $db_helper->getDB(); foreach (array_keys($auth->retrieveUsers()) as $user) { $sqlite->storeEntry('cron_check', ['user' => $user, 'timestamp' => date('c', 0)]); } } }