Upgrade to Pro — share decks privately, control downloads, hide ads and more …

自作OSSとPHP7対応

fortkle
February 05, 2016

 自作OSSとPHP7対応

fortkle

February 05, 2016
Tweet

More Decks by fortkle

Other Decks in Technology

Transcript

  1.  ϝσΟΞ ϢʔβʔࢀՃܕΞϓϦ mamari jp mamari Q ϚϚͷ 3ਓʹ1ਓ ͕ར༻ʂ

    ࢀরɿGoogle Analytics ݄ؒར༻ऀ 400ສਓ Ҏ্ ϚϚϦ ͸೛৷ɾग़࢈ɾࢠҭͯதͷ ঁੑʹ޲͚ͨϝσΟΞ&ίϛϡχςΟͰ͢ɻ
  2. owl/owl • ࣗ࡞ͨ͠OSSͷ৘ใڞ༗πʔϧ (Laravel੡) • ex. ) Qiita:Team, esa.io, Docbase

    …etc • ϝϞπʔϧͱͯ͠Evernoteͷ୅ΘΓʹݸਓ࢖༻ • AWS্Ͱಈ͔ͯ͠ຖ೔࢖͍ͬͯΔ • https://github.com/owl/owl
  3. 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
  4. 1. ૬खΛ஌ΔɺΰʔϧΛܾΊΔ • ࠓճ͸ʮPHP7Β͠͞ʯ͸ٻΊͣɺ৐ͤ׵͑ࣗ ମΛΰʔϧʹ͠଎౓޲্Λ໨తͱͨ͠ PHP7Β͠͞ ߴ PHP7Β͠͞ ௿ ɾͨͩ৐ͤ׵͚͑ͨͩ

    ɾPHP7Ͱొ৔ͨ͠৽͍͠ԋࢉࢠɺߏจͷ׆༻ ɾεΧϥʔ஋ͷܕએݴɺ໭Γ஋ͷܕએݴ ɾແ໊Ϋϥε ɾNull߹ମԋࢉࢠɺӉ஦ધԋࢉࢠ ← ɹɹɹࠓճ͸ͪ͜Βʂ
  5. 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؀ڥΛߏங
  6. 3. ϥΠϒϥϦɺϞδϡʔϧͷ
 ରԠঢ়گΛνΣοΫ • ϥΠϒϥϦ,WAFͷରԠঢ়گ • ʮ˓˓ PHP7ʯͰάάΕ͹େମ෼͔Δ • ओཁͳ΋ͷ͸طʹPHP7ରԠࡁΈ

    • ϞδϡʔϧͷରԠঢ়گ • ঢ়گΛ·ͱΊ͍ͯΔPJT͕͋Δ
 https://github.com/gophp7/gophp7-ext/wiki/ extensions-catalog
  7. 4. ΞϓϦ෦෼ͷରԠঢ়گΛνΣοΫ • php7cc • PHP7ͱͷద߹ੑΛνΣοΫͯ͘͠ΕΔ // μ΢ϯϩʔυ $ wget

    https://github.com/sstalle/php7cc/releases/ download/1.0.2/php7cc.phar 
 // νΣοΫ(ϑΝΠϧ or ϑΥϧμΛ౉͢) $ php php7cc.phar --extensions=php ./index.php
  8. 4. ΞϓϦ෦෼ͷରԠঢ়گΛνΣοΫ • νΣοΫର৅ͷ index.php <?php class String{ public $hoge

    = "hoge"; public function String() { echo "construct!!"; } public function echoHoge() { echo $this->hoge; } }
  9. 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() { }