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
270
古くなってしまったPHPフレームワークとPHPのバージョンアップ戦略
bmf_san
February 03, 2024
Tweet
Share
More Decks by bmf_san
See All by bmf_san
契約テストとPactについて
bmf_san
0
41
5分でわかるSLO
bmf_san
2
60
権限について考える
bmf_san
2
72
自作HTTPルーターから新しいServeMuxへ
bmf_san
3
1.6k
アジャイルワークショップ
bmf_san
0
100
Makuakeの認証基盤とRe-Architectureチーム
bmf_san
0
2.4k
天下一HTTPRouter武闘会.pdf
bmf_san
8
4.3k
ゆっくりHackerRank
bmf_san
0
110
ハイ__ᐛ___パァ_テキストプリプロフェッ__ᐛ___サァ_.pdf
bmf_san
0
230
Other Decks in Programming
See All in Programming
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
3
960
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
450
Criando Commits Incríveis no Git
marcelgsantos
2
170
プロダクトの品質に コミットする / Commit to Product Quality
pekepek
2
770
Jakarta EE meets AI
ivargrimstad
0
230
.NET 9アプリをCGIとして レンタルサーバーで動かす
mayuki
1
770
ドメインイベント増えすぎ問題
h0r15h0
1
120
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
300
命名をリントする
chiroruxx
1
380
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
140
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
243
12k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Facilitating Awesome Meetings
lara
50
6.1k
Mobile First: as difficult as doing things right
swwweet
222
9k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
GitHub's CSS Performance
jonrohan
1030
460k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
We Have a Design System, Now What?
morganepeng
51
7.3k
Optimising Largest Contentful Paint
csswizardry
33
3k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.2k
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ͷΞοϓ σʔτϓϩδΣΫτϨϙʔτ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ