Upgrade to Pro — share decks privately, control downloads, hide ads and more …

mod_perl hacks PHP

mod_perl hacks PHP

2011/12/10 に Hokkaido.pm#6 で発表したスライドです。

OGATA Tetsuji

December 10, 2011
Tweet

More Decks by OGATA Tetsuji

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ • ඌܗ మ࣍ (OGATA Tetsuji) • Twitter: @xtetsuji •

    Blog: http://post.tetsuji.jp/ • ग़਎͸๺ւಓՏ౦܊Իߋொ(ଳ޿ࢢͷྡ) • େֶͰ্ژͯ͠ݱࡏ͸౦ژͷձࣾʹۈ຿
  2. ॲཧϑΣʔζ:mod_perl2 PerlChildInitHandler PerlPostReadRequestHandler PerlInitHandler PerlTransHandler PerlMapToStorageHandler PerlHeaderParserHandler PerlAccessHandler PerlAuthenHandler PerlAuthzHandler

    PerlTypeHandler PerlFixupHandler PerlFixupHandler PerlResponseHandler PerlLogHandler PerlCleanupHandler PerlChildExitHandler ※Apache2ʹݩʑରԠ͢ΔϑΣʔζ͕͋Γ·͢ / ※݁ߏলུ͕͋Γ·͢ɻҎԼΛࢀর http://perl.apache.org/docs/2.0/user/con fi g/con fi g.html
  3. CookieͷಡΈॻ͖ • sub handler { my $r = shift; ...

    } આ໌͸লུ • Raw Cookie ΛಡΈॻ͖͢ΔϞδϡʔϧ ͸ HTTP::Cookies ౳͍Ζ͍Ζ͋Γ·͢ • Apache2 (libapreq) ʹ΋ Apache2::Cookie ΍ APR::Request::Cookie ౳ͷϞδϡʔϧ ΋͋Γ
  4. Output Filterͷॻ͖ํ • Filter ͷ৔߹ sub handler { ... }

    ͸ $r (Request Object)Ͱ͸ͳ͘ɺ $f (Filter Object) ΛୈҰҾ਺ʹड͚औΔ • PerlOutputFilterHandler σΟϨΫςΟϒ