6. HttpKernel堆栈

HttpKernel 龥龡龠龜龛龘龕龔龐龌龋龊龇龃龀齿http齻齹齵齴齱齭齪齧齥齡齻齹齟齛齚齗龊齭龇齕齓齏齍齟齛齭齊齇http齃齂鼿鼾鼻龇鼷鼳鼰鼮鼪龥鼩鼥鼣龃鼿鼾鼻齭鼢鼡鼞齍鼚鼗鼕鼓鼳齏齍鼏鼌鼉齊鼇鼃鼁黽黹黵黱黰黭黬齵黫黪黦齭龥黣黢黟齊 HttpKernel 齵黛鼚symfony龥黉黅黁鼮 HttpKernel 麾麻齭麹黽 \vendor\symfony\http-kernel\HttpKernelInterface 齭鼢drupal8鼗麝麛HttpKernel黅黁鼃麘麖麒齥鼡麎麍麾麻齭鼢Druapl8鼗 HttpKernel 齟齛麅麂齪麛齊麁齭鹾龃麛鹻麁齭鹷鹳黽鹰鹭鹬齭龛鼻鹪鹩鹦齇鹥鹤齭鹣鹟鹞鹛齵麹黽鹰鹭鼻鹙齭龛鹘鹙鹔鹐鹥鹤齭鼻鹙鹌鼚鹩鹙齭鹋鼰齊麁鼃鼁鹉鹈鹆黵齵龀齿鹄鹂齭鹁鹪麛齏齍齟齛鸽鸻鸺鸹鸵齭鹩鹙齵 HttpKernel 龔鸲麂鸯鹥鹤齭鹩鸬鸪鸨鸥齊鸥鸣麁鹄鹂鸡

HttpKernel堆栈是怎么产生的

鼢drupal8鼗齡鹰鹭鹬鸬齵 HttpKernel 齟齛鸟鸛龥 http_middleware 鼪http鼗鸐鸌黦齭鹰鹭黽鸊鸆鸂鸀鷽鷻鷺鷹鷷黅鼪鸂鸀鼢 Drupal\Core\DrupalKernel 鼗鹋鼰黦齭齟黉鹰鹭齵鷽鷻鹄鹂黅黁鼢 \core\lib\Drupal\Core\DependencyInjection\Compiler\StackedKernelPass.php 齭鼢鷽鷻鸂鸀齵鷩鷥鸣麁 CompilerPass 鷢鷟麝麛鸯鷛鷗龥 http_middleware 齵鸊鸆鼪鸣鷔齵鸊鸆麖麒鼡麎 HttpKernelInterface 麾麻黦齭麅鹦鷓鹣鹟鹞鷏鹤鷌鷊齭鷇鷄鹛鹣鹟鹞齵 HttpKernel 鷂鸣麁鷌鶿鷊齵黰鶻鶹鶸黬龥鹰鹭鶵齿齟齛 StackedHttpKernel 齵鶲齊鷂鶲鶰麁鶯黰齭鼢鸂鸀鼗 $Container->get('http_kernel') 鶔龋 http_kernel 鸊鸆齵鷩鷥鶔龋齵龇龃鸣麁鹰鹭鶵齿齟齛鼮齭鸣鹬鶓鶑鶐齊鹩鶏龡黅黁鹰鹭鼗齵 HttpKernel 鸊鸆齭麍鸊鸆麖麒鼡麎 HttpKernel 麾麻齭麅鷛鷗龥 http_middleware 齭鶋鶈龔龐鶅鶃 priority 鼪鹣鹟鹞齭鶀麛鶅鶃鵼鵺龥0黦鵴 responder 鼪齏齍鸀齭鸲鸽鸻齏齍齟齛鷩鶅鶃龥鵳黦齭鵰鶏鵮鸬鵪鹳 HttpKernel 鸊鸆齵黅黁鶏鹩鵩

鹰鹭鹬鸬齵 HttpKernel 齟齛麂齊黅鼌鸽鸻齏齍齭龊龔鸲齪龃鵦鵥鶅鶃齊鹩齻齹齟齛齭鵣龔鸲鷏鹤齊鼇鵡鸲齭齻齹齟齛鼌鹦齇龛鹛鹙齚鵠鹪鵜鹙鸡黉鶈鼚鵛鵣龔龐鼢鵙鵖齵鵔鵓鼗黅黁 HttpKernel 齟齛齭鹛鹣鹟鹞齵 HttpKernel 龔龐鼗鵒鵏鵜鹣鹟鹞 HttpKernel 齵鹥鹤鸡

services:  
  http_middleware.page_cache:  
    class: Drupal\page_cache\StackMiddleware\PageCache  
    arguments: ['@cache.render', '@page_cache_request_policy', '@page_cache_response_policy']  
    tags:  
      - { name: http_middleware, priority: 200, responder: true }  

鹩鸬鵍鵋龌齊龌鵼鵺齵drupal8鵇鵃鵂鹰鹭鹬麘麛鵁鼇龀齿齴齱齭龥鶑黽齿鴿鵍鴼鼮齊鴺鴸鴷鴳鵩

鴱鹐鵇鵃齵Drupal8鵼鵺麛7麁龀齿齴齱齭鹦鷓鹣鹟鹞齭龊鵋鼢鹰鹭鼗鹋鼰7麁鹙齭鴫鼻鹙鹣鹟鹞鴫鹛齭鴩鼻鴧鹩鹦齇鹥鹤 HttpKernel handle() 鴣鴟齭鸣鼇 HttpKernel 龔鴛鴙齵鼡麎 TerminableInterface 麾麻齭鶏鴔鼡麎齭龊鵋齵 terminate() 鴣鴟鵣龃龛鼻鹪鹩鹦齇鹥鹤齭鴐麁鹰鹭齵鼡麎龔龐龌齊龌 StackedHttpKernel 鼃齵鼡麎齭麹黽 \vendor\stack\builder\src\Stack\StackedHttpKernel.php 齭鹩鸬鶹鶸龌齊龌鸣7麁 HttpKernel 麘鴎鼮鼩鼥鵩


1鵩 http_middleware.negotiation Drupal\Core\StackMiddleware\NegotiationMiddleware
鼚黽鷏鹤鴅鸂鴂鳾齭龊鼌鼢齻齹齟齛鹬鸬鶅鶃齻齹齵鳻鹈齭鳺鵂鹌鼚鹩齊鹙齵handle()鴣鴟龃龊齵鳹鳶鸡


2鵩 http_middleware.reverse_proxy Drupal\Core\StackMiddleware\ReverseProxyMiddleware
龥齻齹齟齛鳬鳪鳧鳥鳡齿黰鷓齭麍黰鷓龔龐黅黁鼢鳠鳜鳘鶃鳖鸌settings.php鼗鸡


3鵩 ban.middleware Drupal\ban\BanMiddleware
龊龇龃鶵齿鵂鳐/鳌鳈鵔鵓鹬鸬齵Ban鵔鵓齭龊鳅鳂黰鷓鲿鲾鲺麂鲶鲲齃齂鳠鳜齵IP齭鶏鴔龃鲯鸵齵ip鲭鸹鵒鹩鹙HttpKernel齵龀齿齭齗龋鴅鸂龥鲪鲧齃齂齵齏齍齟齛齭鶏鴔鲤鲡鲝鲜鲚鲗鵔鵓鹔鼕齭鲔鼥齴齱齵Ban鵔鵓龃鲓鶿齵鲏鹂齭鹬鸬麛鸊鸆黅黁鵴鲌鲋黅黁鵴鲇鲃黅黁鵴鲁鲃黅黁鵴黰鷓鲿鱾黬鵴鱻鴩黅黁鱹鱹齭龊龔龐鼰龥鲤鱵鱱齵鶲齊麁鵔鵓鹔鼕鱰鱬鸡


4鵩 http_middleware.page_cache Drupal\page_cache\StackMiddleware\PageCache
鵪鹳鹙齭鱧鷓齻齹齟齛鳅鱥龃鱣麛鵪鹳齵黰鷓齭麛鲭鹁麾鸽鸻齏齍齭鱣鲭鱡鱠鹩鹙齵龀齿齭麅齡龔鵪鹳齵齏齍鵪鹳鱜鱛鱗龐鵂黛鼚齭龊鱔鼡龇龃鶵齿鵂鳐/鳌鳈鵔鵓鹬鸬齵 Internal Page Cache 鵔鵓齭鵼鵺龃麂鸲鱐鱏齵鸡


5鵩 http_middleware.kernel_pre_handle Drupal\Core\StackMiddleware\KernelPreHandle
齟齻齹鷏鹤鱋龀齿齭鲤鵣鲲鱈鱄鱂鱁鹄 DrupalKernel 鼃齵鳡鱀鼮齭鰾鷩龔鸲鲤鰻鰹鹬鸬齵 preHandle 鴣鴟龃鼩鼥鷩鷥鹌鼚齵齭鶀鰵齭龇龃鸣麁 HttpKernel 鹙齵黭黬齭龊鰱鰰 \core\includes 鹬鸬齵鲲鹻黱黰鲿鵴鰱鰰鵔鵓黱黰鲿鵴鳬鰮鰬鰨鵃鸀鵴鰥鰣齻齹鹰鹭鱹鱹齭鸣麁鹙鰟鰟龥鹩鹙齵龀齿鷏鹤鲲鹻鰛鰗黭黬鸡


6鵩 http_middleware.session Drupal\Core\StackMiddleware\Session
session 鰔黟龇龃鸣麁鷩鷥鰒鰏齵齭麅鷇 session 齟齛鳬鳪鼮鰋齻齹齟齛鼗齭鶑黽鵂鱠黛鼚鸡


7鵩 http_kernel.basic Symfony\Component\HttpKernel\HttpKernel
鰒鰏 Symfony齵 HttpKernel 齭鹔鹐鷏鹤鷄鹬鹙齵齻齹鰇龥齏齍鹄鹂齭鰅鰁鼏鼢鱡鱠鸡

鶿鼮齭鸣龇龃 HttpKernel 鹰鹭齵鹆黵鷂鰬鹂鰀齿齭龊龃鵙鸊鸆鸂鸀龐鱛齵鯽齊鼿鯺鸡

http处理核心堆栈层级图

本书共71小节:

评论 (写第一个评论)