PHP 5.3 → 5.6 & FuelPHP 1.6 → 1.8 にアップデートした話 / Updated to PHP 5.6 & FuelPHP 1.8

3da5b00de1285b12a17d730262cc4824?s=47 Yoshiaki Yoshida
September 28, 2016

PHP 5.3 → 5.6 & FuelPHP 1.6 → 1.8 にアップデートした話 / Updated to PHP 5.6 & FuelPHP 1.8

3da5b00de1285b12a17d730262cc4824?s=128

Yoshiaki Yoshida

September 28, 2016
Tweet

Transcript

  1. PHP 5.3 → 5.6 FuelPHP 1.6 → 1.8 ʹΞοϓσʔτͨ͠࿩ 2016-09-28

    ୈ106ճ PHPษڧձˏ౦ژ @kakakakakku
  2. • @kakakakakku • Yoshiaki Yoshida • CyberAgent Crowd Funding, Inc.

    • AWS, Ruby, Certified Scrum Master • http://kakakakakku.hatenablog.com/ • https://github.com/kakakakakku
  3. Ξοϓσʔτ֓ཁ

  4. Ξοϓσʔτ֓ཁ ✓ ؅ཧը໘ΛΞοϓσʔτʢҰൠతͳ CRUD த৺ʣ ✓ PHP 5.3 → 5.6

    ✓ FuelPHP 1.6 → 1.8 ✓ PHP ʹৄ͍͠ಉ྅ͱϖΞͰਐΊͨ http://php.net/supported-versions.php
  5. ΞϓϦέʔγϣϯଆͷରԠ

  6. ·ͣ PHPCompatibility Λʂ ✓ PHP_CodeSniffer ͷ ϧʔϧͱͯ͠࢖͑Δ ✓ PHP ͷඇޓ׵ՕॴΛ੩తղੳͰ͖Δ

    ✓ ࣮ࡍʹݕ஌Ͱ͖ͯमਖ਼ͨ͠Օॴ ---------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ---------------------------------------------------------------------- 1 | WARNING | File has mixed line endings; this may cause incorrect | | results ---------------------------------------------------------------------- ---------------------------------------------------------------------- FOUND 1 ERRORS AFFECTING 1 LINES ---------------------------------------------------------------------- 6 | ERROR | Using a variable argument on break or continue is | | forbidden since PHP 5.4 ---------------------------------------------------------------------- CRLF ͱ LF ͕ࠞͬͯ͟Δ ϑΝΠϧ͕͋ΔΑʂ break ͷҾ਺ʹ ม਺͕࢖ΘΕ͍ͯΔΑʂ
  7. PHPCompatibility ΛҭͯΔ

  8. Changelog Λ஍ಓʹಡΉ ✓ http://php.net/manual/ja/migration54.php ✓ http://php.net/manual/ja/migration55.php ✓ http://php.net/manual/ja/migration56.php ✓ https://github.com/fuel/core/wiki/Changelog-v1.7

    ✓ https://github.com/fuel/core/wiki/Changelog-v1.7.1 ✓ https://github.com/fuel/core/wiki/Changelog-v1.7.2 ✓ https://github.com/fuel/core/wiki/Changelog-v1.7.3 ✓ https://github.com/fuel/core/wiki/Changelog-v1.8 ʘ ݁ՌతʹӨڹ͕ແͯ͘΋ແ͍ͱΘ͔Δ͜ͱ͕ॏཁ ʗ
  9. break / continue ✓ PHP 5.3 → PHP 5.4 ඇޓ׵

    ✓ break / continue ͷҾ਺ʹม਺Λ࢖͏ͱΤϥʔ ✓ ಉ࣌ʹ 0 ΋࢖͑ͳ͘ͳͬͨ <?php while (true) { $result = 1; // PHP Fatal error break $result; } <?php while (true) { // PHP Fatal error break 0; }
  10. ✓ PHP 5.3 → PHP 5.4 ඇޓ׵ ✓ array_combine ʹۭ഑ྻΛࢦఆ͢ΔͱΤϥʔʹͳΒ

    ۭͣ഑ྻ͕ฦΔΑ͏ʹͳͬͨ array_combine() <?php $keys = array(); $values = array(); $combined = array_combine($keys, $values); var_dump($combined); // array()
  11. Redis_Db ✓ FuelPHP 1.6 → FuelPHP 1.7 ඇޓ׵ ✓ Ϋϥε໊Λมߋ

    ✓ Fuel\Core\Redis → Fuel\Core\Redis_Db
  12. mysqli ✓ FuelPHP 1.7 → FuelPHP 1.8 ඇޓ׵ ✓ υϥΠόΛมߋ

    ✓ mysql → mysqli
  13. FuelPHP ͷ Core Λ मਖ਼͍ͯ͠ΔՕॴ͕͋ͬͨ

  14. μϝʂθολΠʂ ✓ Fuel\Core\Log ✓ ΞϓϦέʔγϣϯϩάΛ LTSV ʹ͢ΔͨΊ ✓ Auth\Auth_Login_Simpleauth ✓

    ࿦ཧ࡟আ (deleted_at) Λαϙʔτ͢ΔͨΊ ✓ ͳͲ...
  15. ΫϥεΛ֦ுͯ͠ରԠ http://fuelphp.com/docs/general/extending_core.html

  16. Composer ͕ ಈ͍ͯͳ͔ͬͨ

  17. Composer Λී௨ʹ࢖͏ ✓ fuel/vendor ௚Լʹෲ͍࣋ͪͯͨ͠ ✓ ϥΠϒϥϦΛϝϯςφϯε͢Δͷ͕πϥΠ ✓ composer.json Λ࡞Γ௚ͨ͠

    ✓ શύοέʔδΛ PHP 5.6 ʹରԠͨ͠࠷৽൛ʹ # ೦ئͷ Composer ͕ಈ͍ͨ!!! $ ./composer.phar install
  18. ΠϯϑϥଆͷରԠ

  19. ✓ ELB ʹ register ͯ͠໿2िؒӡ༻ͨ͠ ✓ ϩάج൫Λߏஙͯ͠ϩάΛՄࢹԽͨ͠ ฒߦՔಇ ELB PHP

    5.3 PHP 5.3 PHP 5.6 Amazon ES ErrorLogs
  20. ׬શ੾ସ ✓ ໰୊ͳ͍͜ͱΛ֬ೝͯ͠શ୆ PHP 5.6 ʹ ✓ φΠεϦϦʔε PHP 5.6

    PHP 5.6 PHP 5.6 Amazon ES ErrorLogs ELB
  21. ͦͷଞΠϯϑϥܥ ✓ PHP 5.6 ༻ͷ Chef Cookbook Λ࣮૷ ✓ PHP

    5.6 ༻ͷ CI ؀ڥ (Jenkins) Λߏங ✓ APC → OPCache ʹҠߦ ✓ ύϑΥʔϚϯε؂ࢹͳͲ
  22. ·ͱΊ

  23. PHP 5.3 ୤٫ʂ ✓ ແࣄʹΞοϓσʔτͰ͖ͨ ✓ ؅ཧը໘ͳͷͰ೉͍࣮͠૷͸͋·Γແ͔ͬͨ ✓ ڭ܇ :

    ΋͸΍ PHP όʔδϣϯΞοϓؔ܎ͳ͍(স) ✓ Core Λमਖ਼ͤͣʹΫϥεΛ֦ு͠Α͏ʂ ✓ Composer Λී௨ʹ࢖͓͏ʂ ✓ ฒߦظؒΛઃ͚ͯ҆શʹϦϦʔε͠Α͏ʂ