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

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

Yoshiaki Yoshida
September 28, 2016

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

Yoshiaki Yoshida

September 28, 2016
Tweet

More Decks by Yoshiaki Yoshida

Other Decks in Technology

Transcript

  1. • @kakakakakku • Yoshiaki Yoshida • CyberAgent Crowd Funding, Inc.

    • AWS, Ruby, Certified Scrum Master • http://kakakakakku.hatenablog.com/ • https://github.com/kakakakakku
  2. Ξοϓσʔτ֓ཁ ✓ ؅ཧը໘ΛΞοϓσʔτʢҰൠతͳ CRUD த৺ʣ ✓ PHP 5.3 → 5.6

    ✓ FuelPHP 1.6 → 1.8 ✓ PHP ʹৄ͍͠ಉ྅ͱϖΞͰਐΊͨ http://php.net/supported-versions.php
  3. ·ͣ 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 ͷҾ਺ʹ ม਺͕࢖ΘΕ͍ͯΔΑʂ
  4. 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 ʘ ݁ՌతʹӨڹ͕ແͯ͘΋ແ͍ͱΘ͔Δ͜ͱ͕ॏཁ ʗ
  5. 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; }
  6. ✓ PHP 5.3 → PHP 5.4 ඇޓ׵ ✓ array_combine ʹۭ഑ྻΛࢦఆ͢ΔͱΤϥʔʹͳΒ

    ۭͣ഑ྻ͕ฦΔΑ͏ʹͳͬͨ array_combine() <?php $keys = array(); $values = array(); $combined = array_combine($keys, $values); var_dump($combined); // array()
  7. Composer Λී௨ʹ࢖͏ ✓ fuel/vendor ௚Լʹෲ͍࣋ͪͯͨ͠ ✓ ϥΠϒϥϦΛϝϯςφϯε͢Δͷ͕πϥΠ ✓ composer.json Λ࡞Γ௚ͨ͠

    ✓ શύοέʔδΛ PHP 5.6 ʹରԠͨ͠࠷৽൛ʹ # ೦ئͷ Composer ͕ಈ͍ͨ!!! $ ./composer.phar install
  8. ͦͷଞΠϯϑϥܥ ✓ PHP 5.6 ༻ͷ Chef Cookbook Λ࣮૷ ✓ PHP

    5.6 ༻ͷ CI ؀ڥ (Jenkins) Λߏங ✓ APC → OPCache ʹҠߦ ✓ ύϑΥʔϚϯε؂ࢹͳͲ
  9. PHP 5.3 ୤٫ʂ ✓ ແࣄʹΞοϓσʔτͰ͖ͨ ✓ ؅ཧը໘ͳͷͰ೉͍࣮͠૷͸͋·Γແ͔ͬͨ ✓ ڭ܇ :

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