Jump to content

auto registrate hooks


icreator

Recommended Posts

in install:

		foreach (get_class_methods($this) as $hook ) {
			if ( strncasecmp($hook,'hook', 4) || !strncasecmp($hook,'hookExec', 8)) continue;
			if (!$this->registerHook(substr($hook,4))) return;
		}

in uninstall:

		foreach (get_class_methods($this) as $hook ) {
			if ( strncasecmp($hook,'hook', 4) || !strncasecmp($hook,'hookExec', 8)) continue;
			$this->unregisterHook(substr($hook,4));
		}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...