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
GitHub Universe: Evaluating RAG apps in GitHub Actions
pamelafox
0
170
君は隠しイベントを見つけれるか?
mujyun
0
290
APIテスト自動化の勘所
yokawasa
7
4.2k
コンテンツを支える 若手ゲームクリエイターの アートディレクションの事例紹介 / cagamefi-game
cyberagentdevelopers
PRO
1
130
20241031_AWS_生成AIハッカソン_GenMuck
tsumita
0
110
10分でわかるfreeeのQA
freee
1
3.4k
「 SharePoint 難しい」ってよく聞くけど、そんなに言うなら8歳の息子に試してもらった
taichinakamura
1
620
Commitment vs Harrisonism - Keynote for Scrum Niseko 2024
miholovesq
6
1.1k
[AWS JAPAN 生成AIハッカソン] Dialog の紹介
yoshimi0227
0
150
Forget efficiency – Become more productive without the stress
ufried
0
140
Amazon_CloudWatch_ログ異常検出_導入ガイド
tsujiba
4
1.6k
Vueで Webコンポーネントを作って Reactで使う / 20241030-cloudsign-vuefes_after_night
bengo4com
4
2.5k
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
692
190k
Producing Creativity
orderedlist
PRO
341
39k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Building Your Own Lightsaber
phodgson
102
6k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.6k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
7.9k
Why Our Code Smells
bkeepers
PRO
334
57k
Unsuck your backbone
ammeep
668
57k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Fontdeck: Realign not Redesign
paulrobertlloyd
81
5.2k
Optimizing for Happiness
mojombo
376
69k
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ΛۀͰ͑Δͱָ͍͠ ✌('ω')✌
͓͠·͍