自作OSSとPHP7対応

F4d37a67ce86b2f962c79d73a9127d3c?s=47 fortkle
February 05, 2016

 自作OSSとPHP7対応

F4d37a67ce86b2f962c79d73a9127d3c?s=128

fortkle

February 05, 2016
Tweet

Transcript

  1. 3.

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

    ࢀরɿGoogle Analytics ݄ؒར༻ऀ 400ສਓ Ҏ্ ϚϚϦ ͸೛৷ɾग़࢈ɾࢠҭͯதͷ ঁੑʹ޲͚ͨϝσΟΞ&ίϛϡχςΟͰ͢ɻ
  2. 11.
  3. 12.
  4. 13.
  5. 14.

    owl/owl • ࣗ࡞ͨ͠OSSͷ৘ใڞ༗πʔϧ (Laravel੡) • ex. ) Qiita:Team, esa.io, Docbase

    …etc • ϝϞπʔϧͱͯ͠Evernoteͷ୅ΘΓʹݸਓ࢖༻ • AWS্Ͱಈ͔ͯ͠ຖ೔࢖͍ͬͯΔ • https://github.com/owl/owl
  6. 20.

    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
  7. 21.

    1. ૬खΛ஌ΔɺΰʔϧΛܾΊΔ • ࠓճ͸ʮPHP7Β͠͞ʯ͸ٻΊͣɺ৐ͤ׵͑ࣗ ମΛΰʔϧʹ͠଎౓޲্Λ໨తͱͨ͠ PHP7Β͠͞ ߴ PHP7Β͠͞ ௿ ɾͨͩ৐ͤ׵͚͑ͨͩ

    ɾPHP7Ͱొ৔ͨ͠৽͍͠ԋࢉࢠɺߏจͷ׆༻ ɾεΧϥʔ஋ͷܕએݴɺ໭Γ஋ͷܕએݴ ɾແ໊Ϋϥε ɾNull߹ମԋࢉࢠɺӉ஦ધԋࢉࢠ ← ɹɹɹࠓճ͸ͪ͜Βʂ
  8. 24.

    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؀ڥΛߏங
  9. 26.

    3. ϥΠϒϥϦɺϞδϡʔϧͷ
 ରԠঢ়گΛνΣοΫ • ϥΠϒϥϦ,WAFͷରԠঢ়گ • ʮ˓˓ PHP7ʯͰάάΕ͹େମ෼͔Δ • ओཁͳ΋ͷ͸طʹPHP7ରԠࡁΈ

    • ϞδϡʔϧͷରԠঢ়گ • ঢ়گΛ·ͱΊ͍ͯΔPJT͕͋Δ
 https://github.com/gophp7/gophp7-ext/wiki/ extensions-catalog
  10. 29.

    4. ΞϓϦ෦෼ͷରԠঢ়گΛνΣοΫ • php7cc • PHP7ͱͷద߹ੑΛνΣοΫͯ͘͠ΕΔ // μ΢ϯϩʔυ $ wget

    https://github.com/sstalle/php7cc/releases/ download/1.0.2/php7cc.phar 
 // νΣοΫ(ϑΝΠϧ or ϑΥϧμΛ౉͢) $ php php7cc.phar --extensions=php ./index.php
  11. 30.

    4. ΞϓϦ෦෼ͷରԠঢ়گΛνΣοΫ • νΣοΫର৅ͷ index.php <?php class String{ public $hoge

    = "hoge"; public function String() { echo "construct!!"; } public function echoHoge() { echo $this->hoge; } }
  12. 31.

    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() { }
  13. 39.
  14. 42.