Slide 1

Slide 1 text

PHP 5.3 → 5.6 FuelPHP 1.6 → 1.8 ʹΞοϓσʔτͨ͠࿩ 2016-09-28 ୈ106ճ PHPษڧձˏ౦ژ @kakakakakku

Slide 2

Slide 2 text

• @kakakakakku • Yoshiaki Yoshida • CyberAgent Crowd Funding, Inc. • AWS, Ruby, Certified Scrum Master • http://kakakakakku.hatenablog.com/ • https://github.com/kakakakakku

Slide 3

Slide 3 text

Ξοϓσʔτ֓ཁ

Slide 4

Slide 4 text

Ξοϓσʔτ֓ཁ ✓ ؅ཧը໘ΛΞοϓσʔτʢҰൠతͳ CRUD த৺ʣ ✓ PHP 5.3 → 5.6 ✓ FuelPHP 1.6 → 1.8 ✓ PHP ʹৄ͍͠ಉ྅ͱϖΞͰਐΊͨ http://php.net/supported-versions.php

Slide 5

Slide 5 text

ΞϓϦέʔγϣϯଆͷରԠ

Slide 6

Slide 6 text

·ͣ 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 ͷҾ਺ʹ ม਺͕࢖ΘΕ͍ͯΔΑʂ

Slide 7

Slide 7 text

PHPCompatibility ΛҭͯΔ

Slide 8

Slide 8 text

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 ʘ ݁ՌతʹӨڹ͕ແͯ͘΋ແ͍ͱΘ͔Δ͜ͱ͕ॏཁ ʗ

Slide 9

Slide 9 text

break / continue ✓ PHP 5.3 → PHP 5.4 ඇޓ׵ ✓ break / continue ͷҾ਺ʹม਺Λ࢖͏ͱΤϥʔ ✓ ಉ࣌ʹ 0 ΋࢖͑ͳ͘ͳͬͨ

Slide 10

Slide 10 text

✓ PHP 5.3 → PHP 5.4 ඇޓ׵ ✓ array_combine ʹۭ഑ྻΛࢦఆ͢ΔͱΤϥʔʹͳΒ ۭͣ഑ྻ͕ฦΔΑ͏ʹͳͬͨ array_combine()

Slide 11

Slide 11 text

Redis_Db ✓ FuelPHP 1.6 → FuelPHP 1.7 ඇޓ׵ ✓ Ϋϥε໊Λมߋ ✓ Fuel\Core\Redis → Fuel\Core\Redis_Db

Slide 12

Slide 12 text

mysqli ✓ FuelPHP 1.7 → FuelPHP 1.8 ඇޓ׵ ✓ υϥΠόΛมߋ ✓ mysql → mysqli

Slide 13

Slide 13 text

FuelPHP ͷ Core Λ मਖ਼͍ͯ͠ΔՕॴ͕͋ͬͨ

Slide 14

Slide 14 text

μϝʂθολΠʂ ✓ Fuel\Core\Log ✓ ΞϓϦέʔγϣϯϩάΛ LTSV ʹ͢ΔͨΊ ✓ Auth\Auth_Login_Simpleauth ✓ ࿦ཧ࡟আ (deleted_at) Λαϙʔτ͢ΔͨΊ ✓ ͳͲ...

Slide 15

Slide 15 text

ΫϥεΛ֦ுͯ͠ରԠ http://fuelphp.com/docs/general/extending_core.html

Slide 16

Slide 16 text

Composer ͕ ಈ͍ͯͳ͔ͬͨ

Slide 17

Slide 17 text

Composer Λී௨ʹ࢖͏ ✓ fuel/vendor ௚Լʹෲ͍࣋ͪͯͨ͠ ✓ ϥΠϒϥϦΛϝϯςφϯε͢Δͷ͕πϥΠ ✓ composer.json Λ࡞Γ௚ͨ͠ ✓ શύοέʔδΛ PHP 5.6 ʹରԠͨ͠࠷৽൛ʹ # ೦ئͷ Composer ͕ಈ͍ͨ!!! $ ./composer.phar install

Slide 18

Slide 18 text

ΠϯϑϥଆͷରԠ

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

ͦͷଞΠϯϑϥܥ ✓ PHP 5.6 ༻ͷ Chef Cookbook Λ࣮૷ ✓ PHP 5.6 ༻ͷ CI ؀ڥ (Jenkins) Λߏங ✓ APC → OPCache ʹҠߦ ✓ ύϑΥʔϚϯε؂ࢹͳͲ

Slide 22

Slide 22 text

·ͱΊ

Slide 23

Slide 23 text

PHP 5.3 ୤٫ʂ ✓ ແࣄʹΞοϓσʔτͰ͖ͨ ✓ ؅ཧը໘ͳͷͰ೉͍࣮͠૷͸͋·Γແ͔ͬͨ ✓ ڭ܇ : ΋͸΍ PHP όʔδϣϯΞοϓؔ܎ͳ͍(স) ✓ Core Λमਖ਼ͤͣʹΫϥεΛ֦ு͠Α͏ʂ ✓ Composer Λී௨ʹ࢖͓͏ʂ ✓ ฒߦظؒΛઃ͚ͯ҆શʹϦϦʔε͠Α͏ʂ