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
自作OSSとPHP7対応
Search
fortkle
February 05, 2016
Technology
0
2.4k
自作OSSとPHP7対応
fortkle
February 05, 2016
Tweet
Share
More Decks by fortkle
See All by fortkle
無駄な物をなるべく作らないリプレイス戦略 / replace-strategy-phperkaigi2021
fortkle
1
2.1k
フルリモート時代のカンバン運用 / kanban-operation-in-remote
fortkle
0
620
GitHub Actionsで始めるPHPアプリケーションのCI実践入門 / ga-phperkaigi2020
fortkle
3
4.1k
余裕を生み出すコードレビュー 〜レビュイー編〜 / code-review-phpcon-2019
fortkle
8
6.8k
「設計振り返り」を始めてみようと思っている話 / architecture reflection
fortkle
3
530
「ママ向けNo.1アプリ」の 更なる成長を支える仕組み / startup-engineer-night-connehito
fortkle
2
280
良いテストデータ、悪いテストデータ / testdata-antipattern
fortkle
4
6.7k
BackstopJSで始める CSSリグレッションテスト / backstopjs-css-test
fortkle
0
1.5k
PhpStorm導入アンチパターン / phpstorm-anti-pattern
fortkle
0
2k
Other Decks in Technology
See All in Technology
最速最小からはじめるデータプロダクト / Data Product MVP
amaotone
5
740
Commitment vs Harrisonism - Keynote for Scrum Niseko 2024
miholovesq
6
1.1k
チームを主語にしてみる / Making "Team" the Subject
ar_tama
4
310
プロダクトチームへのSystem Risk Records導入・運用事例の紹介/Introduction and Case Studies on Implementing and Operating System Risk Records for Product Teams
taddy_919
1
170
Amazon FSx for NetApp ONTAPを利用するにあたっての要件整理と設計のポイント
non97
1
160
なんで、私がAWS Heroに!? 〜社外の広い世界に一歩踏み出そう〜
minorun365
PRO
6
1.1k
Jr. Championsになって、強く連携しながらAWSをもっと使いたい!~AWSに対する期待と行動~
amixedcolor
0
190
日経電子版におけるリアルタイムレコメンドシステム開発の事例紹介/nikkei-realtime-recommender-system
yng87
1
510
Figma Dev Modeで進化するデザインとエンジニアリングの協働 / figma-with-engineering
cyberagentdevelopers
PRO
1
430
visionOSでの空間表現実装とImmersive Video表示について / ai-immersive-visionos
cyberagentdevelopers
PRO
1
110
Gradle: The Build System That Loves To Hate You
aurimas
2
150
いまさらのStorybook
ikumatadokoro
0
140
Featured
See All Featured
Designing for humans not robots
tammielis
249
25k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Making Projects Easy
brettharned
115
5.9k
Fashionably flexible responsive web design (full day workshop)
malarkey
404
65k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
41
2.1k
The Cost Of JavaScript in 2023
addyosmani
45
6.6k
Making the Leap to Tech Lead
cromwellryan
132
8.9k
YesSQL, Process and Tooling at Scale
rocio
167
14k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
A Philosophy of Restraint
colly
203
16k
Transcript
ࣗ࡞OSSͱPHP7ରԠ ߴ ߊ @fortkle - PHP7 Casual Talks #1
ࣗݾհ • @fortkle • Connehito גࣜձࣾ (ϚϚ͚αʔϏε mamari) • ੜਮͷPHPer
• ࠷ۙͷझຯɺGoͰWebΞϓϦέʔγϣϯ։ൃ
ϝσΟΞ ϢʔβʔࢀՃܕΞϓϦ mamari jp mamari Q ϚϚͷ 3ਓʹ1ਓ ͕ར༻ʂ
ࢀরɿGoogle Analytics ݄ؒར༻ऀ 400ສਓ Ҏ্ ϚϚϦ ৷ɾग़࢈ɾࢠҭͯதͷ ঁੑʹ͚ͨϝσΟΞ&ίϛϡχςΟͰ͢ɻ
͋ΔͷCTOͱͷձ
CTOʮPHP7͍͜͏ʯ @fortkleʮPHP7͍͖·͠ΐ͏ʯ
PHP7ಋೖܾఆ
CTOʮ͓͠ʂ·ͣ͋ͷཧը໘ͩɻ ɹɹɹPHP5.4͔ΒͷҠߦཔΜͩͧʂʯ @fortkleʮΓ·͠ΐ͏ʂ ɹɹɹɹɹ(…ͯ͞ɺͲ͏ͨ͠ͷ͔)ʯ
PHP7Ҡߦͷน͕… • ѹత @fortkle ͷPHP7ܦݧෆ • ࣮ࡍʹ͍ͬͯΔطଘΞϓϦέʔγϣϯΛ PHP7ʹͤ͑ͨ͜ͱ͕ͳ͔ͬͨ • Կ͔ੜ͚ᩴͰ͋Ε1ࢼ͠t(…
͍ɺੜ͚ᩴͳΒ͋Δ…!
ࣗ࡞OSSͷใڞ༗πʔϧ
None
None
None
owl/owl • ࣗ࡞ͨ͠OSSͷใڞ༗πʔϧ (Laravel) • ex. ) Qiita:Team, esa.io, Docbase
…etc • ϝϞπʔϧͱͯ͠EvernoteͷΘΓʹݸਓ༻ • AWS্Ͱಈ͔ͯ͠ຖ͍ͬͯΔ • https://github.com/owl/owl
͜ΕΛPHP7ʹͤ͑ʂ OSSੜ͚ᩴϝιου(Ծ)
ͱ͍͏༁Ͱ ࣗ࡞OSSͷPHP7ରԠ
owlͷঢ়گ • Laravel 5.0.33 • Server • CentOS6.5 • PHP5.4
• SQLite3 • Apache + mod_php
PHP7ͤ͑5ͭͷϙΠϯτ 1. ૬खΛΔɺΰʔϧΛܾΊΔ 2. ڥͷίʔυԽ 3. ϥΠϒϥϦɺϞδϡʔϧͷରԠঢ়گΛνΣοΫ 4. ΞϓϦ෦ͷରԠঢ়گΛνΣοΫ 5.
ςετΛճ͢
1. ૬खΛΔɺΰʔϧΛܾΊΔ
1. ૬खΛΔɺΰʔϧΛܾΊΔ • PHP7Ͱͷมߋɺޙํޓੑͷཧղ • ʮPHP 5.6.x ͔Β PHP 7.0.x
ͷҠߦʯ http://php.net/manual/ja/migration70.php • ʮPHP7ͰมΘΔ͜ͱ ——ݴޠ༷ͱΤϯδϯͷվળϙΠϯτʯ http://www.slideshare.net/hnw/phpcon-kansai20150530
1. ૬खΛΔɺΰʔϧΛܾΊΔ • ࠓճʮPHP7Β͠͞ʯٻΊͣɺͤ͑ࣗ ମΛΰʔϧʹ্͠Λతͱͨ͠ PHP7Β͠͞ ߴ PHP7Β͠͞ ɾ͚ͨͩͤ͑ͨͩ
ɾPHP7Ͱొͨ͠৽͍͠ԋࢉࢠɺߏจͷ׆༻ ɾεΧϥʔͷܕએݴɺΓͷܕએݴ ɾແ໊Ϋϥε ɾNull߹ମԋࢉࢠɺӉધԋࢉࢠ ← ɹɹɹࠓճͪ͜Βʂ
2. ڥͷίʔυԽ
2. ڥͷίʔυԽ • PHP7ͰऴΘΓͰͳ͍ • 8,9ͱࠓޙܧଓతʹVerUp͢Δඞཁ͕͋Δ • VerUpʹରͯ͠ʢมԽʹରͯ͠ʣରԠ͢ΔͨΊ ʹඞཁͳͷ͕ʮڥͷίʔυԽʯɻ ߏཧΛ͠Α͏ɻ
2. ڥͷίʔυԽ • Մಡੑɺอकੑɺႈੑ • ϓϩϏδϣχϯάπʔϧΛ׆༻͢Δ • Ansible • ʮInstall
PHP7 on CentOS7 by Ansibleʯ http://www.slideshare.net/DQNEO/install-php7-on-centos7-by-ansible • Itamae • ձࣾͰͪ͜ΒΛͬͯΔͷͰowlͪ͜Β • chefΑΓγϯϓϧ • PHP7.0.2ɺSQlite3ɺnginx+PHP-FPMɺCentOS7ڥΛߏங
3. ϥΠϒϥϦɺϞδϡʔϧͷ ରԠঢ়گΛνΣοΫ
3. ϥΠϒϥϦɺϞδϡʔϧͷ ରԠঢ়گΛνΣοΫ • ϥΠϒϥϦ,WAFͷରԠঢ়گ • ʮ˓˓ PHP7ʯͰάάΕେମ͔Δ • ओཁͳͷطʹPHP7ରԠࡁΈ
• ϞδϡʔϧͷରԠঢ়گ • ঢ়گΛ·ͱΊ͍ͯΔPJT͕͋Δ https://github.com/gophp7/gophp7-ext/wiki/ extensions-catalog
4. ΞϓϦ෦ͷରԠঢ়گΛ νΣοΫ
4. ΞϓϦ෦ͷରԠঢ়گΛνΣοΫ • αʔόʔɺϞδϡʔϧɺϥΠϒϥϦɺWAFͰ ͳͯ͘ɺΞϓϦ͕PHP7ඇରԠͳΒҙຯ͕ ແ͍ • खͬऔΓૣ͘PHP7ରԠΛνΣοΫ͢Δʹ php7cc Λ͏ͷ͕Φεεϝ
https://github.com/sstalle/php7cc
4. ΞϓϦ෦ͷରԠঢ়گΛνΣοΫ • php7cc • PHP7ͱͷద߹ੑΛνΣοΫͯ͘͠ΕΔ // μϯϩʔυ $ wget
https://github.com/sstalle/php7cc/releases/ download/1.0.2/php7cc.phar // νΣοΫ(ϑΝΠϧ or ϑΥϧμΛ͢) $ php php7cc.phar --extensions=php ./index.php
4. ΞϓϦ෦ͷରԠঢ়گΛνΣοΫ • νΣοΫରͷ index.php <?php class String{ public $hoge
= "hoge"; public function String() { echo "construct!!"; } public function echoHoge() { echo $this->hoge; } }
4. ΞϓϦ෦ͷରԠঢ়گΛνΣοΫ • ݁Ռ $ php php7cc.phar --extensions=php ./index.php File:
/Users/fortkle/Private/owl/index.php > Line 3: Reserved name "string" used as a class, interface or trait name class String { } > Line 7: PHP 4 constructors are now deprecated public function String() { }
4. ΞϓϦ෦ͷରԠঢ়گΛνΣοΫ • ͪͳΈʹ… • owl Ͱ࣮ߦͨ͠ͱ͜Ζɺमਖ਼͕ඞཁͳՕॴ 0 Ͱͨ͠ʢPHP7ͷޙํޓੑߴ͍ʂʣ
5. ςετΛճ͢
5. ςετΛճ͢ • 4. ͷphp7ccͳͲΛ׆༻ͯ͠PHP7ʹରԠͰ͖ͯ ͍ͳ͍ίʔυΛमਖ਼͢Δ • ςετΛ࣮ߦ͠ɺΞϓϦέʔγϣϯ͕յΕ͍ͯ ͳ͍͔ɺ͓͔͠ͳͱ͜Ζͳ͍͔νΣοΫ •
TravisCIͳΒ1ߦ͚Ճ͑Δ͚ͩͰPHP7ରԠՄ $ cat .travis.yml language: php php: - 5.6 - 7.0
Ҏ্ͷεςοϓΛܦͯ…
Ҡߦྃʂʂʂ • 40~50%΄ͲϖʔδಡΈࠐΈ͕վળʂ Buildin Server + Laravel DebugbarͰ5ճͣͭܭଌ
Ҡߦྃʂʂʂ Buildin Server + Laravel DebugbarͰ5ճͣͭܭଌ
Ҡߦྃʂʂʂ • PHP7Ҡߦͷܦݧήοτʂ • PHP7 Support ͷowlΛϦϦʔεʂ
ͦͷޙ…
ಉ༷ͷखॱͰཧը໘ͷPHP7Ҡߦ • खॱશ͘มΘΒͳ͍ • ΰʔϧ͕ܾ·͍ͬͯΔͷͰແཧͳ͘Ͱ͖Δ • ϨΠϠʔຖʹஸೡʹ࡞ۀ͍ͯ͘͠ख๏ͳͷͰ ҆৺Ͱ͖Δ( ˘ω˘)ţźō •
ܧଓతͳվળ͕Ͱ͖ΔʢPHP7͕ۀͰ͑ͯϞνϕʔ γϣϯ͕͕͋Δʂʂʂˡॏཁʣ
·ͱΊ • झຯ(OSS)ͰϦεΫΛ͠ɺۀʹͦΕΛؐݩ͢Δ ʮOSSੜ͚ᩴϝιουʯ͕ྑ͍ • PHP7ҠߦϨΠϠʔຖʹ͚ͯςετ͍͚ͯ͠ ൺֱత༰қʢPHP7Β͠͞Λٻ͢Δͱқˢʣ • PHP7ΛۀͰ͑Δͱָ͍͠ ✌('ω')✌
͓͠·͍