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.9k
「設計振り返り」を始めてみようと思っている話 / 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
TypeScript、上達の瞬間
sadnessojisan
46
13k
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
760
初心者向けAWS Securityの勉強会mini Security-JAWSを9ヶ月ぐらい実施してきての近況
cmusudakeisuke
0
120
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
2
590
社内で最大の技術的負債のリファクタリングに取り組んだお話し
kidooonn
1
550
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
940
複雑なState管理からの脱却
sansantech
PRO
1
140
DMARC 対応の話 - MIXI CTO オフィスアワー #04
bbqallstars
1
160
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
250
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
0
110
Can We Measure Developer Productivity?
ewolff
1
150
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Unsuck your backbone
ammeep
668
57k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Embracing the Ebb and Flow
colly
84
4.5k
Designing the Hi-DPI Web
ddemaree
280
34k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
A Philosophy of Restraint
colly
203
16k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
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ΛۀͰ͑Δͱָ͍͠ ✌('ω')✌
͓͠·͍