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
390
古くなってしまったPHPフレームワークとPHPのバージョンアップ戦略
bmf_san
February 03, 2024
Tweet
Share
More Decks by bmf_san
See All by bmf_san
AAPについて調べてみた
bmf_san
0
39
レーダーをつくる
bmf_san
0
30
契約テストとPactについて
bmf_san
0
76
5分でわかるSLO
bmf_san
2
100
権限について考える
bmf_san
2
120
自作HTTPルーターから新しいServeMuxへ
bmf_san
3
1.8k
アジャイルワークショップ
bmf_san
0
160
Makuakeの認証基盤とRe-Architectureチーム
bmf_san
0
2.8k
天下一HTTPRouter武闘会.pdf
bmf_san
8
4.4k
Other Decks in Programming
See All in Programming
STUNMESH-go: Wireguard NAT穿隧工具的源起與介紹
tjjh89017
0
380
Terraform やるなら公式スタイルガイドを読もう 〜重要項目 10選〜
hiyanger
13
3.2k
CSC305 Summer Lecture 05
javiergs
PRO
0
110
AWS Serverless Application Model入門_20250708
smatsuzaki
0
130
DockerからECSへ 〜 AWSの海に出る前に知っておきたいこと 〜
ota1022
5
1.8k
Oracle Database Technology Night 92 Database Connection control FAN-AC
oracle4engineer
PRO
1
180
管你要 trace 什麼、bpftrace 用下去就對了 — COSCUP 2025
shunghsiyu
0
470
実践 Dev Containers × Claude Code
touyu
1
240
大規模FlutterプロジェクトのCI実行時間を約8割削減した話
teamlab
PRO
0
490
KessokuでDIでもgoroutineを活用する / Go Connect #6
mazrean
0
110
Laravel Boost 超入門
fire_arlo
1
120
サーバーサイドのビルド時間87倍高速化
plaidtech
PRO
0
480
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
RailsConf 2023
tenderlove
30
1.2k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Testing 201, or: Great Expectations
jmmastey
45
7.6k
Agile that works and the tools we love
rasmusluckow
329
21k
Being A Developer After 40
akosma
90
590k
Become a Pro
speakerdeck
PRO
29
5.5k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
110
20k
What's in a price? How to price your products and services
michaelherold
246
12k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
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ͷΞοϓ σʔτϓϩδΣΫτϨϙʔτ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ