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
250
古くなってしまったPHPフレームワークとPHPのバージョンアップ戦略
bmf_san
February 03, 2024
Tweet
Share
More Decks by bmf_san
See All by bmf_san
契約テストとPactについて
bmf_san
0
36
5分でわかるSLO
bmf_san
2
51
権限について考える
bmf_san
2
66
自作HTTPルーターから新しいServeMuxへ
bmf_san
3
1.6k
アジャイルワークショップ
bmf_san
0
92
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
qmuntal/stateless のススメ
sgash708
0
120
Why Spring Matters to Jakarta EE - and Vice Versa
ivargrimstad
0
1.1k
Vue.js学習の振り返り
hiro_xre
2
130
Modern Angular: Renovation for Your Applications
manfredsteyer
PRO
0
220
プロジェクト新規参入者のリードタイム短縮の観点から見る、品質の高いコードとアーキテクチャを保つメリット
d_endo
1
1k
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
0
170
Content Security Policy入門 セキュリティ設定と 違反レポートのはじめ方 / Introduction to Content Security Policy Getting Started with Security Configuration and Violation Reporting
uskey512
1
440
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
140
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
650
Kaigi on Rails 2024 - Rails APIモードのためのシンプルで効果的なCSRF対策 / kaigionrails-2024-csrf
corocn
5
3.5k
Amazon Neptuneで始めてみるグラフDB-OpenSearchによるグラフの全文検索-
satoshi256kbyte
4
340
ECSのサービス間通信 4つの方法を比較する 〜Canary,Blue/Greenも添えて〜
tkikuc
11
2.3k
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5.2k
For a Future-Friendly Web
brad_frost
175
9.4k
Six Lessons from altMBA
skipperchong
26
3.5k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Fontdeck: Realign not Redesign
paulrobertlloyd
81
5.2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
310
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
800
Scaling GitHub
holman
458
140k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
32
1.8k
Faster Mobile Websites
deanohume
304
30k
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ͷΞοϓ σʔτϓϩδΣΫτϨϙʔτ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ