Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
夢を詰め込む話@PHP BLT#5
Search
Sota Sugiura
July 20, 2016
Technology
2
2.3k
夢を詰め込む話@PHP BLT#5
PHPP BLT#5で発表しました。
Sota Sugiura
July 20, 2016
Tweet
Share
More Decks by Sota Sugiura
See All by Sota Sugiura
内製したSlack Appで頑張るIncident Response@Waroom Meetup #1 / Incident Response with Slack App in 10X
sota1235
0
1k
20220926_セキュリティチームの今_for_Drs._Prime_公開用.pdf
sota1235
0
63
再発防止策を考える技術 / #phpconsen
sota1235
10
3.6k
How to choose the best npm module for your team?
sota1235
9
530
Realtime Database for high traffic production application
sota1235
7
3.9k
Road to migrate JP Web as a microservice
sota1235
4
1.5k
インターフェース再入門 / Think Interface again
sota1235
6
10k
再発防止策を考える技術 #phpconfuk_rej
sota1235
1
1.1k
Update around Firebase #io18
sota1235
3
4.2k
Other Decks in Technology
See All in Technology
Slackbot × RAG で実現する社内情報検索の最適化
howdy39
2
310
LINEヤフー新卒採用 コーディングテスト解説 アルゴリズム問題編
lycorp_recruit_jp
0
13k
成果のためのコミュニケーション - 語彙を育てよう -/communication-for-good-outcome-developing-vocabulary
hassaku63
4
160
OPENLOGI Company Profile for engineer
hr01
1
12k
入門 KRR
donkomura
0
110
エンジニアは伝え方が9割/90% of what engineers need is communication skills
ykanoh
2
220
テストコードの品質を客観的な数値で担保しよう〜Mutation Testのすすめ〜
ysknsid25
10
3k
15 JSON serializers for Ruby
okuramasafumi
2
100
UE5の雑多なテク
ryuichikawano
0
330
【shownet.conf_】放送局とShowNetが共創する、未来の放送システム ~Media over IP 特別企画の裏側~
shownet
PRO
0
330
Low Latency Join Method for Distributed DBMS
yugabytejapan
0
130
AWSへのNIST SP800-171管理策 導入に向けての整備/20240930 Mitsutoshi Matsuo
shift_evolve
0
190
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
26
4k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
Fireside Chat
paigeccino
32
3k
A Modern Web Designer's Workflow
chriscoyier
692
190k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
22k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Clear Off the Table
cherdarchuk
91
320k
Practical Orchestrator
shlominoach
185
10k
Code Review Best Practice
trishagee
62
16k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
327
21k
Why Our Code Smells
bkeepers
PRO
334
57k
Transcript
ເΛ٧ΊࠐΉ !TPUB 1)1#-5!(.0
ࣗݾհ w ਿӜᰜଠ ͖ΓΜͱݺΜͰ͍ͩ͘͞ w !TPUB w ࣾձ1)1
Έͳ͞Μ
ΞʔΧΠϒͯ͠·͔͢ʁ
ࡢࠓͷ8FCΞϓϦέʔγϣϯ w ʮDPNQPTFSJOTUBMM͓ئ͍͠·͢ʯ w ʮ͋͋ɺઃఆϑΝΠϧΛผ్Ճͯ͠ʯ w ʮHJUDMPOFͯ͠ΞϨͯ͠ίϨͯ͠Ϗϧυͯ͠ʯ
ࡢࠓͷ8FCΞϓϦέʔγϣϯ w ʮDPNQPTFSJOTUBMM͓ئ͍͠·͢ʯ w ʮ͋͋ɺઃఆϑΝΠϧΛผ్Ճͯ͠ʯ w ʮHJUDMPOFͯ͠ΞϨͯ͠ίϨͯ͠Ϗϧυͯ͠ʯ ΊΜͲ͍͘͞
࣌ϙʔλϏϦςΟ w Ϗϧυ͍ͨ͠Μ͡ΌͶ͐Α w ŰƄŕͱམͱͯ͠ŰƄŕͬͱ͍ͯ͐ΜͩΑ w ංେ͢Δ3&"%.&͓Βݏͩ͊ʙ
ͦ͏͍͑ ŰƄŕͱམͱͯ͠ŰƄŕͱ͑Δ1)1FSͷຯํ͋ͬͨΑͶ
DPNQPTFSQIBS
DPNQPTFSQIBS w 1)1ͷύοέʔδཧπʔϧ w XHFU͢Ε͙͢ʹ͑Δ
Ͳ͏ͯ͠ŰƄŕͬͱ͑Δͷʁ
DPNQPTFSQIBS
DPNQPTFSQIBS ո͍͠
QIBS GSPNQIQOFU QIBS֦ுϞδϡʔϧɺ1)1ΞϓϦέʔγϣϯશମΛͻͱͭͷQIBS 1)1"SDIJWF ϑΝΠ ϧʹ·ͱΊͯ͠·͍ɺΠϯετʔϧΛ༰қʹ͢ΔͨΊͷͷͰ͢ɻͦΕ͚ͩͰͳ͘ɺQIBS ֦ுϞδϡʔϧͰϑΝΠϧϑΥʔϚοτΛநԽ͢Δػೳఏڙ͓ͯ͠ΓɺUBSܗࣜ[JQܗࣜ ͷϑΝΠϧΛ1IBS%BUBΫϥεͰѻ͏͜ͱ͕Ͱ͖·͢ɻͪΐ͏Ͳ1%0͕͞·͟·ͳσʔλϕʔε ͷ౷ҰΠϯλʔϑΣΠεΛ༻ҙ͍ͯ͠Δͷͱಉ͡Α͏ͳͷͰ͢ɻ1%0ͰҟͳΔσʔλϕʔε ؒͷมͰ͖·ͤΜ͕ɺQIBSͰUBSɺ[JQɺQIBSϑΝΠϧϑΥʔϚοτؒͷม͕ίʔυ
ߦ͚ͩͰͰ͖ͯ͠·͍·͢ɻྫͱͯ͠1IBSDPOWFSU5P&YFDVUBCMF Λࢀর͍ͩ͘͞ɻ 1IBSͬͯԿ 1IBSΞʔΧΠϒɺෳͷϑΝΠϧΛͻͱͭʹ·ͱΊΔͨΊͷศརͳΈͰ͢ɻ 1IBSΞʔΧΠϒΛ༻͢Εɺ1)1ͷΞϓϦέʔγϣϯΛͻͱͭͷϑΝΠϧͱͯ͠Ͱ͖ΔΑ ͏ʹͳΓ·͢ɻ·ͨɺͦΕΛσΟεΫ্ʹల։͠ͳͯͦ͘ͷ··࣮ߦͰ͖ΔͷͰ͢ɻ͞Βʹɺଞ ͷϑΝΠϧͱಉ༷ʹ1)1͔ΒQIBSΞʔΧΠϒΛ࣮ߦ͢Δ͜ͱ͕Ͱ͖·͢ɻίϚϯυϥΠϯͱΣ ϒαʔόʔܦ༝ͷͲͪΒͰ࣮ߦՄೳͰ͢ɻQIBSɺ͍Θ1)1ΞϓϦέʔγϣϯʹ͓͚Δ UIVNCESJWFͷΑ͏ͳͷͰ͢ɻ 1IBS͜ͷػೳΛ࣮͢ΔͨΊʹετϦʔϜϥούʔΛ༻͍ͯ͠·͢ɻ௨ৗɺ1)1εΫϦ ϓτ͔Β֎෦ͷϑΝΠϧΛ༻͢ΔʹJODMVEFΛ༻͍·͢ɻ IUUQQIQOFUNBOVBMKBJOUSPQIBSQIQΑΓग़య
ߦͰ w ΞϓϦέʔγϣϯΛͭʹΞʔΧΠϒͰ͖Δ w 1)1ͰUBS [JQͱಉ͡Α͏ʹѻ͑Δ w ղౚ͠ͳͯͦ͘ͷ··࣮ߦՄೳ
ෳϑΝΠϧΛͻͱ·ͱΊʹ͢Δ ͍͢͝ϠπΒ͍͠
ͲΕ͘Β͍͍͢͝ͷʁ
ݕূͯ͠Έͨ w DPNQPTFSʹͲΕ͘Β͍ͷເ͕٧·ͬͯΔͷ͔ w $PNQPTFSa$PNQJMFSͰDPNQPTFSQIBSΛ ࡞ͬͯΔͬΆ͍ w ϑΝΠϧΛ͑ΔΧϯλʔࠐΜͰίϯύΠ ϧͯ͠Έͨ
ࡶʹݕূ <?php class Compiler { /* লུ */ private $counter
= 0; public function compile($pharFile = 'composer.phar') { /* লུ */ echo $this->counter; } private function addFile($phar, $file, $strip = true) { $this->counter++; /* লུ */ }
࣮ߦ݁Ռ ※ 実際の数はこれより多いはず ※ 非常に雑な検証です。多いことが伝わればおk
Ҏ্ͷເ͕٧·ͬͯΔ w ຊདྷͳΒϏϧυ͠ͳ͍ͱಈ͔ͳ͍ w 1)"3ܗࣜͰ͢Δ͜ͱͰ࠷ڧͷϙʔλϏϦ ςΟΛखʹͨ͠ w ΞʔΧΠϒJTເ
ࢲΞʔΧΠϒ͍ͨ͠ ứʆ
ΞʔΧΠϒͯ͠ΈΑ͏ w ϑΝΠϧΛѹॖͯ͠ΈΔ w QIQίϚϯυͰ࣮ߦͰ͖ΔΑ͏ʹ͢Δ
ѹॖ͢ΔͭΒ <?php // app.php require __DIR__ . '/calculate.php'; echo add(1,
3); <?php // calculate.php function add($a, $b) { return $a + $b; }
QIBS࡞ίʔυ <?php // pharϑΝΠϧ࡞ $phar = new Phar('app.phar'); // ΞʔΧΠϒʹϑΥϧμՃ
$phar->buildFromDirectory(__DIR__); // ىಈ࣌ʹ࣮ߦ͞ΕΔελϒΛઃఆ $phar->setStub(createStub()); function createStub() { return <<<'EOD' <?php require 'phar://app.phar/app.php'; __HALT_COMPILER(); EOD; }
Ͱ͖ͨʂ
ເΛΞʔΧΠϒͰ͖ͨ w ൺֱతΧϯλϯʹѹॖͰ͖Δ w 1IBSXFC1IBSΛ༻͢Ε)551ϦΫΤετ Α͠ͳʹͬͯ͘ΕΔ w WFOEPSԼΛΑ͠ͳʹݻΊΔϥΠϒϥϦͳΜ ͔ଘࡏ͢ΔΑ
·ͱΊ w 1IBSෳϑΝΠϧΛͬ͘͞ͱݻΊΔͭ w ϙʔλϏϦςΟ໘Ͱݴ͏ͱ࠷ߴͰ w 8&#'8ͱ͔ΛΞʔΧΠϒཧ্Մೳ w ࣍·Ͱͷ॓ʹ͓͖ͯ͠·͢ʜcТɾA
Ҏ্ʂ