22. 钩子、模块处理器、函数定义

钩子:

龸龶龲龯龭龪龧龥龢龡龞龝龙龗龕龔龐龍龋龇龅龁龀齾龁齽齺龀齷齵龥龢龡齲齰齬齨齧齥齢齠龇齞齜龲齘 php 齐龇齲齏齍龲齉齆龀齷齐齺齂鼿龙龗龇鼽鼻鼹鼸鼷鼶鼲鼽鼻鼿鼮鼭鼫鼩鼶鼨鼥鼮鼭鼫鼩鼣鼟齺鼛鼗鼔鼐鼍鼫鼽鼻鼶鼊鼻鼫鼶鼈鼇龐鼣鼅齺鼁黾鼛龲齘齉齆黼黸齺黷黶黳黰鼫黮黫黨黧黦黢黠黸龇龞龝黜鼫黮黛齰龥黗黓鼲黒黑黏黋黈黅龇黁麽齞龢鼮鼭黜黒鼩黛黜黋鼩黛麺龇麷黗麶麲黮麱鼮鼭鼫鼩龇龥黗麮鼫鼩齢齠鼲黫麬齉齆齍麫麩麦龇麢麞黒黑鼛龲鼫鼩麛鼈鼇齺麚麖龇黠黸麢麞黶黒黑齲鼛龲鼫黮齲龇麢麞鼛龲鼫鼩齍麫龇麢麞麒鼛龲鼫鼩麒龇鼊鼻鼫鼛龲麑麍麢麞麒黢鼫麊

黗麇龲龡鼫鼩麅麂齺齢齠龇鹾鹻龞龝龙龗鹺黢鹷黫鹷 drupal 齐鼫鼩齺鹥龗鹣

drupal 鹡鹟齐鼫鼩龲黫麬鹜鹚齂鼿齺鹙鹖麩麦龇鹡鹟麑麍齲齘鹡鹟鹕鹓鹏鹌黏鹓鹏鹕鹓鹏鹌鹙鹖龇麑麍鹉鹈鹇麒齺麢麞黢齍麫龇鹃鹁鸾鼛龲黠黸鸺齷齐齘黷黫龝鸶黰黠黸鸵鸲黷鹉鸮鹇麒齺麢麞龇龥龢龲黫龝麢麞齰龥龢龲黫鸫麢麞龇齏鸨鸤鸠龥黗鸮鸜龞鸫麢麞龇齘龞鸚黜鹉鸮鹇麒黛龞龝鸙鼛鸕齂鼿鹻鸔 drupal 龲鼊鼻鹉鸮龞龝鹇麒齺鼷鼶齘齍麫齐鼲黷麬鸓龢黠黸黈龝麒鸒鸏鸺齷齐黷龝鸶鼗黠黸龞龝鸓龢鸋鼛龲鼫鼩麒龇鸈鹓鹏龥黗鸆鸮鸜黫龝麢麞龇麢麞麒鼲黜鹓鹏麒 _ 鼫鼩麒黛龇龞鸫麢麞鹾鸄鸃鹉鸂鹣鼲鷿鷻鸃黫鸂鷸齺鷵麚龐鸮鸜鸏齰鼛龲鷳鷯鸾齺黷鸓龢黠黸鸋龇齘鸺齷齐齺黷鸶黫黮鷮鷬黠黸齲鷫龇鹓鹏鷨鼿鷥鷢鼛鸮鸜鷞鷝麢麞龇鷛鷗鷔齞鸮鸜龇齘 php 齐麢麞龲鷑鷎鷌齺龇齘鷈鷄鷀鶿鶼龥黗黒黑麊鼫鼩龲齞龲鹕齉齆鶹鶶齐齺鷵齆鶴鶳鶹鶶鹓鶯鶮鶬鼷鼶鶪鶧龇鶤鷸麇齲鷫龲黫鼁鷵龇鼫鼩齍麫齐齘黠黸鸶黒黑鼫鼩麢麞鶣龞龝鹖齾鼛鷞鶠鶝鶙龭鹻黫龝鷵齆龇齍麫鹻鸵鸲鼫鼩齍麫鹇麒齺麢麞鼛鷞鶠鶝鶴鶳鹻龞龝鷵齆鸔

drupal8 齐鹡鹟鶒鶏鸮鸜鹻龅龁鼫鼩麒龇齲鷫齘鹡鹟黼黸齺鸈龝鸶鶍黠黸龇龞鶉鶆龅鹓鹏鷥鷢鼍鶂鶀齐黢龇鵿鷯麮鵾鵽鵺鵹鵶鵴黶齺麷鹾鼫鼩麒麊鹓鹏鵲鼿齍麫鹻鸵鸲鼫鼩鹇麒齺麢麞龇龞鸫麢麞麮齘鼫鼩黒黑黶黠黸龇麑鹚麮龞鸫麢麞鼮鼭鼫鼩齍麫麊鹓鹏齰龥黗鸆鸮鸜鼫鼩麒麊

元旦刚刚过去,继续保持一周一篇的速度,这是Drupal8云客源码分析系列在2017年的开篇,来讲几个极其重要的内容,它们是钩子、模块处理器、函数定义。

模块怎么定义一个钩子名呢?

鵮龸鹓鹏麒鼮黜 yunke 黛龇鼿鸮鸜黫龝鼫鼩鸏麒鸋鼮鼭黜 sendMail 黛鵕鼻齘鹓鹏齺鵓鵐鵌齐鵋鵉黫龝麒鼲黜 yunke.api.php 齺鷯齆龇鸚鵅鸮鸜黫龝鶉鵂麢麞鼮鼭鹣 hook_sendMail(...) 龇鴸麇鴴鴳龇鸾鴱齘 yunke 龞龝鹓鹏齐鼊鼻黼黑龞龝鼫鼩齺龇鼥鹺齘 yunke 龞龝鹓鹏齺黧黦齐麑麍鹓鹏鴭齢鴫鸏鵿鷯鴧鸋黢黠黸龞龝鼫鼩龇齏鸨鹓鹏齍麫鹻龞龝鼫鼩鼛鼗鶍 yunke 龞龝鹓鹏黠黸鼍龇齏齍黜 yunke.api.php 黛龞龝鷯齆龲齞鼗鶍鹡鹟黠黸齺龇齲齺齾黑鷿鷎麶鸃黫龝鷯鴥龇鴡鴝齏鸨鹓鹏龯龭鴛黰齍麫鼫鼩龇齘鹡鹟齐鴚龥黗鹷鼍龅龁龞鶉齺鷯齆龇鸨鷫鴗鶝鹓鹏齺鵓鵐鵌龇齘 drupal 鴕鶿齺 API 鷯鴥鴈鸶鼛龲麑麍鸆鹖齠鴄齲鷫黢黋黈鼫鼩鴴鴳鷯鴥齺龇麷黗鶉鵂麢麞鹕鴴鴳鴀鳾鳺鴀龍龇齲齺齾黑鼛龲黫龝鷯鴥麊

鹓鹏鼊鼻齍麫麇鵅鸮鸜齺 sendMail 鼫鼩鼷鼶鸮鸜黫龝麢麞龇麮麢麞麒黜 hook_sendMail 黛齐齺 hook 鳶鼲鸆鳵齺鹓鹏麒鳴龥龇麢麞鳲鳯齘 .module 鷯齆齐龇鵮龸齍麫龞龝鼫鼩齺鹓鹏鼮鼭黜 yunke_php 黛龇鵕鼻鼛鳲鳯齘鵓鵐鵌齺 yunke_php. module 鷯齆齐麊

鳫鶝鼫鼩齍麫麢麞齺鷯齆鴗鳯鳨鹾鳧鳤黫麬鳲鳯鶿鳢鹣鸮鸜龞龝鼫鼩齺鹓鹏龥黗鸮鸜黫龝鼫鼩鳠鳞麢麞龇鳲鳯齘 .module 鷯齆齐鸏鵮龸麇鷯鼛龲 yunke .module 鸋龇麢麞麒鳛鶯鼲鹣 " 鹓鹏麒 _hook_info" 龇龸麇鷯鼛龲黜 yunke _hook_info 黛龇齲麑麍鳖鼁鳒黢鳎鴱鼫鼩齍麫龥黗鳲鳯齺鴗鳯龇鳖鼁黫龝麞鳍龇鳋麒鼲鼫鼩麒龇龡鷝鳒鼲黫龝麞鳍鹣 Array ("group"=> $var) 龇黗鷳鷯齺 yunke 鹓鹏鼲鲾鹣鼫鼩鳠鳞麢麞麒鼲鹣黜 yunke_hook_info 黛龇龸龶鸨鳖鼁鲼鲺龸鵿鹣

$hooks[' sendMail '] = array('group' => 'user');

鵕鼻齏鸨鹓鹏龡 sendMail 龞龝鼫鼩齺齍麫鳨龥黗鳲鳯齘鸆鳵鵓鵐鵌齺黜鹓鹏麒 .user.inc 黛鷯齆鸚龇龞鶉齺鶹鶶龲鼲鹻麮鸕鲥鲡黑黏鸕鲠鲝齺鼫鼩鲜鵉鳲鳯齘 $module.$group.inc 鷯齆齐龇齞鷨鼿黶龥齞鴸鲙龇鲘鲕鸂龢龇鹓鹏齺黜 .module 黛鷯齆鵺鵹龲鲒龝鲏鲋鶼鷎鸤鴸鲙齺麊鳫鶝鼫鼩鳠鳞麢麞 " 鹓鹏麒 _hook_info" 齺鹃鹁齍麫龥黗鷥鲈鹣 \core\modules\system\system.module 齐齺 system_hook_info()

鹓鹏鲘鱿齺鼫鼩鳠鳞麢麞鼗鶍鹓鹏鴭齢鴫黠黸龇鱻龶鱸鱷鹺鱶鳲齘鱴鱶齐黗鱰鹺黑麊

鴱鱬鹻鼫鼩齺鹥龗龇鼛齞鱩齢齠鹡鹟齺鹓鹏鴭齢鴫鹻龇鱧鱤麊

模块处理器:

鹓鹏鴭齢鴫龲鲺鴫齐齺黫龝鱡鱠龇鱡鱠麒鼲黜module_handler黛龇齘鷈鷄鷀鶿鱞龥黗麑麍\Drupal::moduleHandler()鱔鼍龇齲鱑鱎鱊鱶鹡鹟龯鱇齺鹓鹏鳠鳞黏鴸鲙鹓鹏齺麢麞黏黠黸鼫鼩黅龇齘鹡鹟齐鹜鹚龁齺鷀鶿鶼黑鼍鹻齲龇龥黗鸾齲龲鹡鹟鹕鹓鹏黏鹓鹏鹕鹓鹏鷗鹌齺齂鼿鱃鰿鷗黫麊
鷯齆鴗鶝鹣\core\lib\Drupal\Core\Extension\ModuleHandler.php
齲鹾鰴龝鰲鰰鷥麞鹣
$root鸏app.root鸋鹣
龲黫龝SplString龡麲龇鰮龡麲黧鰭黫龝鸒鰪鰧鳒龇龲鹡鹟齺鰣鵐鵌龇鰟鳒齰鱊鱶齘鹚鰝DRUPAL_ROOT齐
$module_list鸏container.modules鸋鹣
鹡鹟龯鱇齺鹓鹏鵾鰭龇龲鲺鴫鷥麞龇齘鲺鴫鰲鵋黶鰏龔
$cache_backend鸏cache.bootstrap鸋
龲黫龝鱴鱶龇鵺鵹齍麫齐鰍麞鰋鰇bootstrap鱴鱶鰭黋黈麞鰋

齘drupal齐鹓鹏鶮鰄鹾鰂麬鹣module鸏鰀麑鹓鹏鸋黏profile鸏鯼鳯鹓鹏鸋

齘鹡鹟鯻鯺鯹黨鸏鲺鴫麶鷻鹺齺鶂鶀鯵鯱齐鹌鯭鸚鸋麮黒黑鹓鹏鴭齢鴫鴸鲙麷鹾龯鱇鹓鹏齺黜.module黛鷯齆龇龞龝鷯齆鷞鶠鶝鹓鹏黑鼍齺麢麞鰇麊

鹓鹏鴭齢鴫齺齍麫鵮鯪鼈鼇龇龞鸚鵲鵾鵽黫鸫鹚黑鯩鼿鸶黢鯧鯣鹣

加载模块的其他文件:

\Drupal::moduleHandler()->loadInclude($module, $type, $name = NULL)
鴸鲙鹓鹏$module鵓鵐鵌鵿鷯齆麒鼲$name鯘鯔麒鼲$type齺鷯齆龇鹓鹏鯓鯏龲龯鱇齺龇鷯齆麒鼲鯎鷔黑鹓鹏麒黧鯋龇龞鹚黑鶝鴸鲙麢麞鰇龇鶠鼥齰龥黗龲齏鸨鷯齆

系统默认有两个模块定义的钩子信息函数:

system_hook_info 鴗鶝鹣\core\modules\system\ system.module
views_hook_info 鴗鶝\core\modules\views\ views.module
鸨鷫齺鳖鼁鱻龶鶍鱸鱷鹺鱶鳲鶝鱴鱶鰭bootstrap齺hook_info鱴鱶鯆齐

鸏黧黦麱鯄鯃鲼鲺鯁鸋

鹓鹏鲘鱿齺鼫鼩齘鹓鹏齺*.api.php file齐鯧鯣龇鵕龲鮼鮻鷥鲈鷯鴥
鮷鮵鼫鼩齺黠黸鮲鮱鹣
龥黗齍麫module_implements_alter鼫鼩龇黑齲黢鮷鮵鼫鼩齺黠黸鮲鮱

黠黸鼫鼩鹣
\Drupal::moduleHandler()->invoke($module, $hook, array $args = array()) 黠黸黷鹓鹏齍麫齺鼫鼩
\Drupal::moduleHandler()->invokeAll($hook, array $args = array()) 黠黸鹡鹟麷鹾齺$hook鼫鼩
\Drupal::moduleHandler()->alter($type, &$data, &$context1 = NULL, &$context2 = NULL) 黠黸鮷鮵鼫龇齲龲鵋鵉齘鼫鼩鷗麇齺鸓龢龇鮤鮠鷥麞黶龥黗鮜鮙鼫鼩齺_alter鹺鮖

鲺鮕鮑鮎齺麒鸒鮍鮊鹣
鹓鹏鹾鲼鸤鲡黑齺麩鴫麒鹕黑鶝鮆鮅鶮鮄鮃齺鮅鶮龥魿麒龇麩鴫麒鱷齞龲鷯齆魽麒龇龐龲info.yml鷯齆齺鷯齆麒鸏齞魼.info.yml鹺鮖鸋龇麷黗鷯齆鹇麒鼿鰪鱸php魹鰝鹇麒魶鷔龇鷯齆魽麒龥黗鹕鷯齆麒齞黫魳龇鮅鶮龥魿麒鳎鴱齘info.yml鷯齆鸚齺name鸒黨龇龥鲡黑鵿鵾黧黦鱔鼍鹣
\Drupal::moduleHandler()->getName($module)

<span style="font-size:14px;">function system_hook_info() {  
  $hooks['token_info'] = array(  
    'group' => 'tokens',  
  );  
  $hooks['token_info_alter'] = array(  
    'group' => 'tokens',  
  );  
  $hooks['tokens'] = array(  
    'group' => 'tokens',  
  );  
  $hooks['tokens_alter'] = array(  
    'group' => 'tokens',  
  );  
  
  return $hooks;  
}  
</span>

函数放置:

鼿魰黸drupal龯龭龇龯龭鴛魬鼿鳫鶀齺龥龢鼛龲麢麞鰇齺鳲鳯龇鸨鷫鷝鰮鳲齘魫龝鷯齆鸚鵅鼷鼶
麑鹚魩鷫龲黗鹓鹏齺鶿鶯魨drupal鹡鹟魥鴸鷯齆龇麷黗魬魣龥黗麮麢麞鳲鳯齘鹓鹏鵓鵐鵌鵿齺黜鹓鹏麒.module黛鷯齆齐龇鰮鷯齆鼗鶍鹡鹟齘鲺鴫鵋鵉鹺鶍鸆鹖鴸鲙
鼫鼩麢麞齞黁龥黗鳲鳯齘黜鹓鹏麒.module黛鷯齆齐鳨龥黗鳲鳯齘$module.$group.inc鷯齆齐龇鳾麱麇鷯
齰龥黗鳲鳯齘鹓鹏鵓鵐鵌鵿齺鷈鼹鷯齆齐龇黁齞鼗鶍鹡鹟鸆鹖鴸鲙龇鷨鼿鲡黑黗鵿黧黦鷿鷻鴸鲙鹣
\Drupal::moduleHandler()->loadInclude($module, $type, $name = NULL);
齲鰭鮃鴸鲙鹓鹏$module鵓鵐鵌鵿鷯齆麒鼲$name鯘鯔麒鼲$type齺鷯齆龇鷯齆麒鼲鯎鷔黑鹓鹏麒黧鯋龇龞鹚黑鶝鴸鲙麢麞鰇龇鶠鼥齰龥黗龲齏鸨鷯齆
鴴鼹鳲鳯齘鹓鹏齐齺麢麞龇麑麍黗麇鶿鳢鴸鲙鱞鹾黫龝鷳鲘鹣鹓鹏龲鱇黑齺鸔龞鹜鹚齂鼿

龸龶麢麞魡鳫鷈鷄鹓鹏龇齰齞鷨鼿龲魟鱇黑鹓鹏鱞鼿鲋鷎鴈魛黑鼊鼻鴭齢鼷鼶
龥黗齘鴈鸶鯼鳯鷯齆鸏鵺鵹龲\sites\default\ settings.php鸋齐include魰黢龇魙魕齐龥黗鲡黑鹚鰝DRUPAL_ROOT龇齲鰭鮃drupal鵶鵴鰣鵐鵌齺魔龡魙魕龇魒鴱齘/core/includes/bootstrap.inc齐龇鵮龸鹣
include_once DRUPAL_ROOT."/yunkelib.php"; //鴴鼹齞鼿魍魊鷛魆魅
龞鶉鼛龥黗鷈鼹鴸鲙鸆鳵齺麢麞鰇鹻龇齞魂鷈鷄鬿麦麊
龞鸚鷨鼿鴴鼹鹣齘鷈鷄黶鬾鶼齞鼿黰鮷鮵core鸚鵅齺鲼鲺龇魟鷔鬺鬷黶麮龥龢鹾鬳鬱

鬭鬫麢麞鴸鲙齺黶鹌鮲鮱龇鹾黫龝鬩魣鬷龇鬩魣鬷鴀鲕鴀魣鴸鲙龇龸鵿鹣
鯼鳯鷯齆鴸鲙>黜鹓鹏麒.module黛> loadInclude麢麞

php基础知识提示:php文件可以使用任意扩展名,包含进来时将只关注它的内容,不会在意它的扩展名,这也是系统中许多函数可以放置在非php后缀的原因
详见php官网http://php.net/manual/zh/function.include.php

附件:列出默认安装中钩子的实现

齘鱴鱶齐鱊鱶鹻鼫鼩齺鵺鵹齍麫鹕鼫鼩鳠鳞鹣
module_implements.bin 鹣鼫鼩齺齍麫鳠鳞 鳋麒鼲鼫鼩麒龇鳋鳒鼲黫龝麞鳍龇鰮麞鳍鳋麒鼲齍麫鹻龞龝鼫鼩齺鹓鹏麒龇龡鷝鳒鼲鴗鳯$group鳠鳞龇龸龶鶪鹾$group鷔鼲false

Array  
(  
    [module_implements_alter] => Array  
        (  
        )  
  
    [entity_load] => Array  
        (  
        )  
  
    [view_load] => Array  
        (  
        )  
  
    [language_types_info] => Array  
        (  
        )  
  
    [language_types_info_alter] => Array  
        (  
            [language] =>   
        )  
  
    [views_pre_view] => Array  
        (  
        )  
  
    [views_plugins_sort_alter] => Array  
        (  
        )  
  
    [views_plugins_filter_alter] => Array  
        (  
        )  
  
    [views_plugins_area_alter] => Array  
        (  
        )  
  
    [views_pre_build] => Array  
        (  
        )  
  
    [views_plugins_query_alter] => Array  
        (  
        )  
  
    [views_query_alter] => Array  
        (  
        )  
  
    [views_query_substitutions] => Array  
        (  
            [node] => views_execution  
            [user] => views_execution  
            [views] => views_execution  
        )  
  
    [views_post_build] => Array  
        (  
        )  
  
    [views_pre_execute] => Array  
        (  
        )  
  
    [views_plugins_cache_alter] => Array  
        (  
        )  
  
    [query_alter] => Array  
        (  
        )  
  
    [query_views_alter] => Array  
        (  
            [views] =>   
        )  
  
    [query_views_frontpage_alter] => Array  
        (  
        )  
  
    [node_grants] => Array  
        (  
        )  
  
    [query_node_access_alter] => Array  
        (  
            [node] =>   
        )  
  
    [query_node_load_multiple_alter] => Array  
        (  
        )  
  
    [entity_storage_load] => Array  
        (  
            [comment] =>   
        )  
  
    [node_storage_load] => Array  
        (  
        )  
  
    [node_load] => Array  
        (  
        )  
  
    [views_post_execute] => Array  
        (  
        )  
  
    [entity_view_mode_alter] => Array  
        (  
        )  
  
    [node_build_defaults_alter] => Array  
        (  
        )  
  
    [entity_build_defaults_alter] => Array  
        (  
        )  
  
    [views_pre_render] => Array  
        (  
            [views] => views_execution  
        )  
  
    [views_post_render] => Array  
        (  
        )  
  
    [theme_suggestions_views_view] => Array  
        (  
        )  
  
    [theme_suggestions_alter] => Array  
        (  
        )  
  
    [theme_suggestions_views_view_alter] => Array  
        (  
        )  
  
    [template_preprocess_default_variables_alter] => Array  
        (  
            [user] =>   
        )  
  
    [theme_suggestions_views_view_unformatted] => Array  
        (  
        )  
  
    [theme_suggestions_views_view_unformatted_alter] => Array  
        (  
        )  
  
    [entity_extra_field_info] => Array  
        (  
            [comment] =>   
            [contact] =>   
            [node] =>   
            [user] =>   
        )  
  
    [comment_type_load] => Array  
        (  
        )  
  
    [node_type_load] => Array  
        (  
        )  
  
    [entity_extra_field_info_alter] => Array  
        (  
        )  
  
    [field_formatter_info_alter] => Array  
        (  
            [editor] =>   
            [quickedit] =>   
        )  
  
    [entity_view_display_load] => Array  
        (  
        )  
  
    [entity_view_display_alter] => Array  
        (  
            [node] =>   
        )  
  
    [entity_prepare_view] => Array  
        (  
            [rdf] =>   
        )  
  
    [rdf_mapping_load] => Array  
        (  
        )  
  
    [entity_field_access] => Array  
        (  
            [language] =>   
        )  
  
    [entity_field_access_alter] => Array  
        (  
        )  
  
    [query_user_load_multiple_alter] => Array  
        (  
        )  
  
    [user_storage_load] => Array  
        (  
        )  
  
    [user_load] => Array  
        (  
        )  
  
    [date_format_load] => Array  
        (  
        )  
  
    [entity_display_build_alter] => Array  
        (  
        )  
  
    [node_view] => Array  
        (  
        )  
  
    [entity_view] => Array  
        (  
            [comment] =>   
        )  
  
    [node_view_alter] => Array  
        (  
            [comment] =>   
            [history] =>   
        )  
  
    [entity_view_alter] => Array  
        (  
            [quickedit] =>   
        )  
  
    [theme_suggestions_node] => Array  
        (  
            [node] =>   
        )  
  
    [theme_suggestions_node_alter] => Array  
        (  
            [views] =>   
        )  
  
    [theme_suggestions_field] => Array  
        (  
            [system] =>   
        )  
  
    [theme_suggestions_field_alter] => Array  
        (  
        )  
  
    [theme_suggestions_username] => Array  
        (  
        )  
  
    [theme_suggestions_username_alter] => Array  
        (  
        )  
  
    [user_format_name_alter] => Array  
        (  
        )  
  
    [file_url_alter] => Array  
        (  
        )  
  
    [user_build_defaults_alter] => Array  
        (  
        )  
  
    [theme_suggestions_rdf_metadata] => Array  
        (  
        )  
  
    [theme_suggestions_rdf_metadata_alter] => Array  
        (  
        )  
  
    [user_view] => Array  
        (  
            [user] =>   
        )  
  
    [user_view_alter] => Array  
        (  
            [user] =>   
        )  
  
    [theme_suggestions_user] => Array  
        (  
        )  
  
    [theme_suggestions_user_alter] => Array  
        (  
        )  
  
    [filter_format_load] => Array  
        (  
        )  
  
    [filter_info_alter] => Array  
        (  
        )  
  
    [node_links_alter] => Array  
        (  
            [comment] =>   
        )  
  
    [query_comment_access_alter] => Array  
        (  
        )  
  
    [query_entity_query_alter] => Array  
        (  
        )  
  
    [query_entity_query_comment_alter] => Array  
        (  
        )  
  
    [theme_suggestions_links] => Array  
        (  
        )  
  
    [theme_suggestions_links_alter] => Array  
        (  
        )  
  
    [link_alter] => Array  
        (  
        )  
  
    [theme_suggestions_pager] => Array  
        (  
        )  
  
    [theme_suggestions_pager_alter] => Array  
        (  
        )  
  
    [theme_suggestions_feed_icon] => Array  
        (  
        )  
  
    [theme_suggestions_feed_icon_alter] => Array  
        (  
        )  
  
    [theme_suggestions_container] => Array  
        (  
        )  
  
    [theme_suggestions_container_alter] => Array  
        (  
            [views] =>   
        )  
  
    [block_load] => Array  
        (  
        )  
  
    [entity_access] => Array  
        (  
        )  
  
    [block_access] => Array  
        (  
        )  
  
    [block_build_alter] => Array  
        (  
        )  
  
    [block_build_system_branding_block_alter] => Array  
        (  
        )  
  
    [block_build_system_menu_block_alter] => Array  
        (  
        )  
  
    [block_build_system_messages_block_alter] => Array  
        (  
        )  
  
    [block_build_system_breadcrumb_block_alter] => Array  
        (  
        )  
  
    [block_build_page_title_block_alter] => Array  
        (  
        )  
  
    [block_view_alter] => Array  
        (  
        )  
  
    [block_view_page_title_block_alter] => Array  
        (  
        )  
  
    [block_build_local_tasks_block_alter] => Array  
        (  
        )  
  
    [block_build_help_block_alter] => Array  
        (  
        )  
  
    [block_build_local_actions_block_alter] => Array  
        (  
        )  
  
    [block_build_system_main_block_alter] => Array  
        (  
        )  
  
    [block_view_system_main_block_alter] => Array  
        (  
            [system] =>   
        )  
  
    [block_build_search_form_block_alter] => Array  
        (  
        )  
  
    [block_build_system_powered_by_block_alter] => Array  
        (  
        )  
  
    [page_attachments] => Array  
        (  
            [contextual] =>   
            [quickedit] =>   
            [system] =>   
        )  
  
    [page_attachments_alter] => Array  
        (  
            [taxonomy] =>   
        )  
  
    [page_top] => Array  
        (  
            [block] =>   
            [node] =>   
            [toolbar] =>   
            [update] =>   
        )  
  
    [page_bottom] => Array  
        (  
            [tour] =>   
        )  
  
    [theme_suggestions_html] => Array  
        (  
            [system] =>   
        )  
  
    [theme_suggestions_html_alter] => Array  
        (  
        )  
  
    [rdf_namespaces] => Array  
        (  
            [rdf] =>   
        )  
  
    [theme_suggestions_page] => Array  
        (  
            [system] =>   
        )  
  
    [theme_suggestions_page_alter] => Array  
        (  
        )  
  
    [theme_suggestions_region] => Array  
        (  
            [system] =>   
        )  
  
    [theme_suggestions_region_alter] => Array  
        (  
        )  
  
    [theme_suggestions_block] => Array  
        (  
            [block] =>   
        )  
  
    [theme_suggestions_block_alter] => Array  
        (  
        )  
  
    [theme_suggestions_page_title] => Array  
        (  
        )  
  
    [theme_suggestions_page_title_alter] => Array  
        (  
        )  
  
    [shortcut_default_set] => Array  
        (  
        )  
  
    [shortcut_set_load] => Array  
        (  
        )  
  
    [query_shortcut_access_alter] => Array  
        (  
        )  
  
    [query_entity_query_shortcut_alter] => Array  
        (  
        )  
  
    [shortcut_load] => Array  
        (  
        )  
  
    [block_view_local_tasks_block_alter] => Array  
        (  
        )  
  
    [menu_local_tasks_alter] => Array  
        (  
            [contact] =>   
        )  
  
    [block_view_help_block_alter] => Array  
        (  
            [help] =>   
        )  
  
    [help] => Array  
        (  
            [automated_cron] =>   
            [ban] =>   
            [block] =>   
            [block_content] =>   
            [breakpoint] =>   
            [ckeditor] =>   
            [color] =>   
            [comment] =>   
            [config] =>   
            [contact] =>   
            [contextual] =>   
            [datetime] =>   
            [dblog] =>   
            [dynamic_page_cache] =>   
            [editor] =>   
            [field] =>   
            [field_ui] =>   
            [file] =>   
            [filter] =>   
            [help] =>   
            [history] =>   
            [image] =>   
            [language] =>   
            [link] =>   
            [locale] =>   
            [menu_ui] =>   
            [node] =>   
            [options] =>   
            [page_cache] =>   
            [path] =>   
            [quickedit] =>   
            [rdf] =>   
            [search] =>   
            [shortcut] =>   
            [system] =>   
            [taxonomy] =>   
            [text] =>   
            [toolbar] =>   
            [tour] =>   
            [update] =>   
            [user] =>   
            [views_ui] =>   
            [menu_link_content] =>   
            [views] =>   
        )  
  
    [block_view_local_actions_block_alter] => Array  
        (  
        )  
  
    [theme_suggestions_status_messages] => Array  
        (  
        )  
  
    [theme_suggestions_status_messages_alter] => Array  
        (  
        )  
  
    [library_info_alter] => Array  
        (  
            [ckeditor] =>   
            [color] =>   
            [locale] =>   
            [quickedit] =>   
        )  
  
    [css_alter] => Array  
        (  
        )  
  
    [js_alter] => Array  
        (  
            [locale] =>   
        )  
  
    [js_settings_build] => Array  
        (  
            [system] =>   
        )  
  
    [js_settings_alter] => Array  
        (  
            [locale] =>   
            [system] =>   
            [user] =>   
        )  
  
    [contextual_links_alter] => Array  
        (  
        )  
  
    [menu_load] => Array  
        (  
        )  
  
    [menu_access] => Array  
        (  
        )  
  
    [contextual_links_view_alter] => Array  
        (  
            [contextual] =>   
            [views_ui] =>   
        )  
  
    [view_access] => Array  
        (  
        )  
  
    [quickedit_editor_alter] => Array  
        (  
        )  
  
    [ajax_render_alter] => Array  
        (  
        )  
  
)  

hook_info.bin鹣鼫鼩鳠鳞麢麞鳖鼁齺鱸鱷鱻龶龇鳋麒鼲鼫鼩麒龇鳋鳒鼲黫龝麞鳍龇group黧鰭鰮鼫鼩齍麫鳨龥黗鱶鳲齘$module.$group.inc鷯齆齐

Array  
(  
    [token_info] => Array  
        (  
            [group] => tokens  
        )  
  
    [token_info_alter] => Array  
        (  
            [group] => tokens  
        )  
  
    [tokens] => Array  
        (  
            [group] => tokens  
        )  
  
    [tokens_alter] => Array  
        (  
            [group] => tokens  
        )  
  
    [views_data] => Array  
        (  
            [group] => views  
        )  
  
    [views_data_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_analyze] => Array  
        (  
            [group] => views  
        )  
  
    [views_invalidate_cache] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_access_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_area_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_argument_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_argument_default_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_argument_validator_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_cache_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_display_extender_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_display_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_exposed_form_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_field_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_filter_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_join_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_pager_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_query_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_relationship_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_row_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_sort_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_style_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_plugins_wizard_alter] => Array  
        (  
            [group] => views  
        )  
  
    [views_query_substitutions] => Array  
        (  
            [group] => views_execution  
        )  
  
    [views_form_substitutions] => Array  
        (  
            [group] => views_execution  
        )  
  
    [views_pre_view] => Array  
        (  
            [group] => views_execution  
        )  
  
    [views_pre_build] => Array  
        (  
            [group] => views_execution  
        )  
  
    [views_post_build] => Array  
        (  
            [group] => views_execution  
        )  
  
    [views_pre_execute] => Array  
        (  
            [group] => views_execution  
        )  
  
    [views_post_execute] => Array  
        (  
            [group] => views_execution  
        )  
  
    [views_pre_render] => Array  
        (  
            [group] => views_execution  
        )  
  
    [views_post_render] => Array  
        (  
            [group] => views_execution  
        )  
  
    [views_query_alter] => Array  
        (  
            [group] => views_execution  
        )  
  
    [field_views_data] => Array  
        (  
            [group] => views  
        )  
  
    [field_views_data_alter] => Array  
        (  
            [group] => views  
        )  
  
)  

本书共78小节:

评论 (写第一个评论)