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フレームワークとPHPのバージョンアップ戦略
Search
bmf_san
February 03, 2024
Programming
1
260
古くなってしまったPHPフレームワークとPHPのバージョンアップ戦略
bmf_san
February 03, 2024
Tweet
Share
More Decks by bmf_san
See All by bmf_san
契約テストとPactについて
bmf_san
0
38
5分でわかるSLO
bmf_san
2
55
権限について考える
bmf_san
2
67
自作HTTPルーターから新しいServeMuxへ
bmf_san
3
1.6k
アジャイルワークショップ
bmf_san
0
94
Makuakeの認証基盤とRe-Architectureチーム
bmf_san
0
2.3k
天下一HTTPRouter武闘会.pdf
bmf_san
8
4.2k
ゆっくりHackerRank
bmf_san
0
110
ハイ__ᐛ___パァ_テキストプリプロフェッ__ᐛ___サァ_.pdf
bmf_san
0
220
Other Decks in Programming
See All in Programming
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
[Do iOS '24] Ship your app on a Friday...and enjoy your weekend!
polpielladev
0
110
受け取る人から提供する人になるということ
little_rubyist
0
230
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
CSC509 Lecture 09
javiergs
PRO
0
140
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
120
イベント駆動で成長して委員会
happymana
1
320
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
930
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
130
Remix on Hono on Cloudflare Workers
yusukebe
1
290
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
40
2.4k
The Invisible Side of Design
smashingmag
298
50k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Side Projects
sachag
452
42k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Music & Morning Musume
bryan
46
6.2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
655
59k
Ruby is Unlike a Banana
tanoku
97
11k
Transcript
ݹ͘ͳͬͯ͠·ͬͨPHPϑϨʔϜϫʔΫͱPHPͷ バ ʔ ジ ϣϯΞο プ ઓུ @bmf_san PHPerKaigi2024 2024/03/08
ࣗݾհ • Kenta Takeuchi / @bmf_san / bmf-san • https://bmf-tech.com/
• גࣜձࣾϚΫΞέ Re-ArchitectureνʔϜॴଐ • PHPΞοϓσʔτϓϩδΣΫτܦݧɿ2ճ͚ͩ • GopherͰ͢
͢͜ͱ • όʔδϣϯΞοϓͰ্ख͍ͬͨ͘ઓུ • ϓϩδΣΫτϚωδϝϯτ؍ • ٕज़؍
ϓϩδΣΫτ֓ཁ
ରΞϓϦέʔγϣϯ • MakuakeͷΞϓϦέʔγϣϯͱࣾϥΠϒϥϦ2݅ • https://www.makuake.com/ • 10Ҏ্ӡ༻͞Ε͍ͯΔγεςϜ • ࣮ߦڥECS on
FargateͰίϯςφԽ͞Ε͍ͯΔ • ͓͓Αͦ1~2ճ/σϓϩΠ͞ΕΔ
είʔϓɾମ੍ɾܭը • PHP7.3→PHP8.1 • FuelPHP1.8.2→FuelPHP1.9-develop • νʔϜମ੍ • 2໊ɿϓϩδΣΫτਐߦɾௐࠪɾ࣮୲ •
1໊ɿௐࠪɾ࣮୲ • ܭըʙϓϩδΣΫτྃ·Ͱ11ϲ݄ఔͷظؒ • ਓ݄ࢉͰ6~7ϲ݄ఔ
ϓϩδΣΫτͷྲྀΕ 1. ࣄલௐࠪ 2. Ξοϓσʔτํͷݕ౼ 3. վम࡞ۀ 4. ςετ 5.
ϦϦʔε
όʔδϣϯΞοϓϓϩδΣΫτͷ͠͞
όʔδϣϯΞοϓΛ͘͢͠ΔཁҼ • ܭը୯७ͰɺқΛ্͛ͯ͠·͏ཁҼ͕͋Δ • ৫తͳ͜ͱٕज़తͳ͜ͱ
όʔδϣϯΞοϓΛ͘͢͠ΔཁҼ • ࣾϦιʔεௐ • ෳͷνʔϜ͕৮ΔϞϊϦγοΫͳΞϓϦʔέʔγϣϯ • 10Ҏ্ӡ༻͞Ε͍ͯΔྺ࢙͋Δίʔυϕʔε • ґଘ͍ͯ͠ΔϑϨʔϜϫʔΫͷ։ൃ͕ఀ •
ςετΧόϨοδ͕͍ʢ50~60%͘Β͍ʣ
όʔδϣϯΞοϓΛ͘͢͠ΔཁҼ • ࣾϦιʔεௐ • օࣗͷνʔϜ͚ͩͰखҰഋʂ • ผϓϩδΣΫτʹࢀՃ͢Δ༨༟͕ͳ͍ɾɾʂ • ϚϧνλεΫʹͳΓ͕ͪ •
ࣗνʔϜͷϓϩδΣΫτͱֻ͚࣋ͪͨ͠… • ࣾ֎Ϧιʔεͷ֬อͷඞཁੑ
όʔδϣϯΞοϓΛ͘͢͠ΔཁҼ • ෳͷνʔϜ͕৮ΔϞϊϦγοΫͳΞϓϦέʔγϣϯ • Φʔφʔγοϓ͕ఆ·͍ͬͯͳ͍ʢ㲈ΞοϓσʔτͷऔΓ͕͍ ͳ͍ʣ • ؔऀ͕ଟ͍ʢ㲈ίϛϡχέʔγϣϯͷෳࡶ͞ʣ • ֤νʔϜͷ։ൃܭըΛؾʹͨ͠Γ
• ֤νʔϜͱͷίϛϡχέʔγϣϯ͕ඞཁͩͬͨΓ • Ξοϓσʔτ͕͍͚ͨͩ͠ͳͷʹɾɾʂ͊͘wͤdrftgy;͜͡lp
όʔδϣϯΞοϓΛ͘͢͠ΔཁҼ • 10Ҏ্ӡ༻͞Ε͍ͯΔྺ࢙͋Δίʔυϕʔε • ෆඞཁʹίʔυΛվमͯ͠͠·͏Մೳੑ͕͋Δ • ୭༷ΛΒͳ͍ɺ͍ʹ͠ͷίʔυ • ୭ʹ৮ΕΒΕ͍ͯͳ͔ͬͨΓ͢Δ •
ΘΕ͍ͯΔͷ͔͍ͳ͍ͷ͔ɺΑ͘Θ͔Βͳ͍ίʔυ • σουίʔυ͕ࢄݟ͞ΕΔ
όʔδϣϯΞοϓΛ͘͢͠ΔཁҼ • ґଘ͍ͯ͠ΔϑϨʔϜϫʔΫͷ։ൃ͕ఀ • FuelPHPͷ։ൃ͕ఀ͍ͯ͠Δ • ࠷৽όʔδϣϯ͕8.1ରԠ͍ͯ͠ͳ͍
όʔδϣϯΞοϓΛ͘͢͠ΔཁҼ • ςετΧόϨοδ͕͍ʢ50~60%͘Β͍ʣ • ίʔυͷվमͰόά͕ࠞೖ͞Εͳ͍͔ෆ҆ • όάͷൃݟ͕ΕΔ
͠͞ΛΓӽ͑Δʹ • ؾ߹ • ۚ • ྑ͛͞ͳઓུʂ
όʔδϣϯΞοϓͷઓུ
όʔδϣϯΞοϓͷઓུ • ϓϩδΣΫτϚωδϝϯτʢPMʣͷ؍ • ٕज़ʢTechʣ؍
όʔδϣϯΞοϓͷઓུʢPMʣ • Ϟνϕʔγϣϯͷཧ • ԆϦεΫͷͱରॲ • ίϛϡχέʔγϣϯ
Ϟνϕʔγϣϯͷཧ • తΛ໌֬Խ͢Δ͜ͱʢൃతϞνϕʔγϣϯͷཱ֬ʣ • Ex. • ͳͥΞοϓσʔτ͢Δͷ͔ʁ • Ξοϓσʔτ͢ΔͱͲΜͳϝϦοτ͕ಘΒΕΔͷ͔ʁ •
ͲΜͳֶͼ͕͋Γͦ͏͔ʁ • ൃతϞνϕʔγϣϯੜ࢈ੑΛࠨӈ͢Δ • cf. Boehm, B. (1981) Software Engineering Economics. Prentice Hall. • ɿ݁ߏݹ͍จͳͷͰ࠷৽ͷݚڀͰͳ͍
ԆϦεΫͷͱରॲ • “ෆ࣮֬ੑͷߴ͍՝”Λૣ͘ݟ͚ͭͯରԠΛߟ͑Δ • ʓʓ͕Ͱ͖ͳ͔ͬͨͲ͏͠Α͏ʁʓʓ͕Ͱ͖Δ͔Ͳ ͏͔Θ͔Βͳ͍͔ʁ • ෆ࣮֬ੑԆʹӨڹ͢Δ • ૣΊͷௐࠪݕূͰϦεΫʹඋ͑Δ
ίϛϡχέʔγϣϯ • 1આ໌ͨ͠ΒऴΘΓʹ͠ͳ͍ʢपͷపఈʣ • ಉظʢex. MTGʣɾඇಉظʢex. νϟοτʣΛ͍͚Δ • ڠྗΛڼ͙ •
ex.ϨϏϡʔɺόάௐࠪͳͲ • ϓϩδΣΫτͷॏཁੑʢతʣ͕ཧղ͞Ε͍ͯΔͱڠ ྗͯ͠Β͍͍͢
όʔδϣϯΞοϓͷઓུʢTechʣ • FuelPHPͷ։ൃόʔδϣϯͷ࠾༻ • PHP৽چόʔδϣϯͷฒߦՔಇߏͷߏங • ஈ֊తͳΓସ͑ઓུ
FuelPHPͷ։ൃόʔδϣϯͷ࠾༻ • PHP8.1ʹରԠͨ͠FuelPHPͷόʔδϣϯ͕ϦϦʔε͞Ε ͍ͯͳ͍ • ։ൃ൛Ͱ͋ΔFuelPHP1.9-developΛ࠾༻ • FuelPHPͷίϛολʔͷ࣭ • RectorPHPCompatibilityͱ͍ͬͨπʔϧʹΑΔௐࠪ
• υΩϡϝϯτ༰Λࢀরͨ͠ਓྗௐࠪ
PHP৽چόʔδϣϯͷฒߦՔಇߏͷߏங • ํ • ϏοάόϯϦϦʔεΛආ͚Δ • ίʔυϑϦʔζظؒΛ࠷খݶʹ͢Δ • Γ͠Λखૣ͘ߦ͑ΔߏɺΈΛ༻ҙ͢Δ •
ϓϩδΣΫτظؒதɺଞνʔϜͷ։ൃੜ࢈ੑΛམͱ͞ͳ͍ • →ํʹج͍ͮͯɺPHP7.3͔ΒPHP8.1ͷΞʔΩςΫνϟม ߋΛஈ֊తʹߦ͏ͨΊɺฒߦՔಇߏΛߏங
ஈ֊తͳΓସ͑ઓུ • PHP8.1ͷόʔδϣϯΞοϓશྃ·ͰͷεςοϓΛೖ೦ʹܭը • Phase1:ϓϩμΫγϣϯڥεςʔδϯάڥPHP7.3Ͱӡ༻͞Εͯ ͍Δঢ়ଶ • Phase2:εςʔδϯάڥʹ͓͚ΔฒߦՔಇڥͷӡ༻։࢝ • Phase2.5:ϓϩμΫγϣϯڥʹ͓͚ΔฒߦՔಇڥͷӡ༻։࢝
• Phase3:εςʔδϯάɾϓϩμΫγϣϯΛڥΛPHP8.1Γସ͑։࢝ • Phase3.5:PHP8.1ڥͷશΓସ͑
Phase1 • PHP7.3ͱPHP8.1ΛฒߦՔಇڥͷӡ༻Λ։࢝͢ΔͨΊ ͷ४උظؒͱͯ͠ͷϑΣʔζ • PHP7.3ͰPHP8.1Ͱಈ࡞͢ΔΑ͏ʹΞϓϦέʔ γϣϯͷίʔυϕʔεϥΠϒϥϦͷΞοϓσʔτ࡞ ۀΛ࣮ࢪ • ίʔυͷվम͜ͷϑΣʔζͰ֓Ͷྃ
Phase1
Phase2 • εςʔδϯάڥͷΈPHP7.3ͱPHP8.1ͷฒߦՔಇڥ ͱͯ͠ӡ༻Λ։࢝͢ΔϑΣʔζ • QAͷ࣮ࢪෛՙࢼݧͷςετΛ࣮ࢪ • ϓϩμΫγϣϯڥͰͷӡ༻Λఆͯ͠ɺฒߦՔಇͷ ΠϯϑϥߏͷΈΛݕূ
Phase2
ฒߦՔಇͷΠϯϑϥߏͷΈ • CloudFrontͷContinuous DeploymentΛ࠾༻ • CloudFrontͷDistributionΛPrimaryͱStagingͷ2͚ͭͯɺτϥϑΟοΫΛ ࢄͰ͖Δ • Weight-basedͱ͍͏ॏΈ͚Λར༻͢ΔͱશϦΫΤετͷ0~15%ΛׂΓৼ ΕΔ
• ࠷େ15%ͱ͍͏੍ݶ͋Δ͕ɺฒߦՔಇঢ়ଶΛҰఆظؒܧଓ͢Δ͜ͱͰݕ ূेͳτϥϑΟοΫΛಘΒΕΔͱஅ • ෆ۩߹͕͋ͬͨͱ͖0%ʹ͢Δ͚ͩͰྑ͍ • ө݁ߏૣ͍
Phase2.5 • ϓϩμΫγϣϯڥͷฒߦՔಇڥͷӡ༻Λ։࢝͢Δ ϑΣʔζ • PHP8.1ڥτϥϑΟοΫΛগͣͭ͠ྲྀͯ͠ɺ࣮ߦ ڥͰͷෆ۩߹Λચ͍ग़͢ • ࢹӡ༻։࢝Ͱੜͨ͡όάରԠͳͲ
Phase2.5
Phase3 • εςʔδϯάɾϓϩμΫγϣϯڥΛPHP8.1ͷΈͷՔಇ ঢ়ଶʹΓସ͑ΔϑΣʔζ • ӡ༻͕҆ఆ͢Δ͔ݕূ͢Δ • PHP8.1ڥ͕100%ͷτϥϑΟοΫΛड͚औΔ • PHP7.3ڥؔ࿈ͷΠϯϑϥϦιʔεΛଘ͓ͤͯ͞
͘͜ͱͰɺPHP7.3ڥͷΓ͠Λ୲อ
Phase3
Phase3.5 • PHP8.1ڥͷશΓସ͑Λߦ͏ϑΣʔζ • PHP7.3ڥؔ࿈ͷ֤छΠϯϑϥϦιʔεɺฒߦՔಇ ͷͨΊʹଘ͍ͤͯͨ͞PHPόʔδϣϯذͷίʔυ Λআ • PHP7.3ڥͷΓ͠جຊతʹෆՄೳ
Phase3.5
·ͱΊ
·ͱΊ • ίʔυվमͦͷͷΑΓௐࠪɾ४උɾܭըͷ΄͏͕࿑ ྗΛ͏ • Өڹൣғ͕શ෦ʢΘΜͺ͘ʣʂΈ͍ͨͳγεςϜվम ͷϓϩδΣΫτͱͲ͏͖߹͏͔ʁ • ࢼ͞ΕΔϓϩδΣΫτϚωδϝϯτྗɺࢼ͞ΕΔٕज़ ྗ
• Γָ͕͍͍͋ͬͯ͠ΑʁͨͿΜʂ
͓·͚ • ΞοϓσʔτϓϩδΣΫτͷϨϙʔτΛϒϩάʹ·ͱΊ ͍ͯ·͢ • ϓϩδΣΫτͷৄࡉΛॻ͍ͨͷͰྑ͚Ε͝ࢀরͩ͘ ͍͞ • https://bmf-tech.com/posts/FuelPHPͱPHPͷΞοϓ σʔτϓϩδΣΫτϨϙʔτ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ