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
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
290
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
Contemporary Test Cases
maaretp
0
130
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
現場で役立つモデリング 超入門
masuda220
PRO
15
3.2k
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
250
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.1k
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Arm移行タイムアタック
qnighy
0
310
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
Featured
See All Featured
The Language of Interfaces
destraynor
154
24k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
4 Signs Your Business is Dying
shpigford
180
21k
A better future with KSS
kneath
238
17k
A designer walks into a library…
pauljervisheath
203
24k
How STYLIGHT went responsive
nonsquared
95
5.2k
The Cult of Friendly URLs
andyhume
78
6k
Visualization
eitanlees
145
15k
Speed Design
sergeychernyshev
24
610
Bash Introduction
62gerente
608
210k
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ͷΞοϓ σʔτϓϩδΣΫτϨϙʔτ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ