[HOME] [NSRG] [インフラ] [fml4] [fml8] [北海道] [おすすめの本] Powered by NetBSD and [nuinui.net] .

Hook Naming Convension

Hook standard form is

ROLE_METHOD_start_hook
ROLE_METHOD_end_hook
The role is "ROLE" part of $use_ROLE_function (e.g. $use_article_post_function) in configuration variables. This hook directory corresponds to some variables in configuration. More granular hooks do not match this rule.

For example, the main part of fmlconf command, run() method, provide the following hooks:

fmlconf_run_start_hook
fmlconf_run_end_hook
The actual code calling hooks as follows:
sub run
{
    my ($curproc, $args) = @_;
    my $config  = $curproc->{ config };

    my $eval = $config->get_hook( 'fmlconf_run_start_hook' );
    if ($eval) {
	eval qq{ $eval; };
	print STDERR $@ if $@;
    }

    $curproc->_fmlconf($args);

    $eval = $config->get_hook( 'fmlconf_run_end_hook' );
    if ($eval) {
	eval qq{ $eval; };
	print STDERR $@ if $@;
    }
}

This case is fundamental. More granular hooks must be needed. The naming convension may differ from this convension.

[HOME] [NSRG] [インフラ] [fml4] [fml8] [北海道] [おすすめの本] Powered by NetBSD and [nuinui.net] .
Copyright (C) 1993-2017 Ken'ichi Fukamachi mail:< fukachan at fml.org >