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

技術書紹介 パーフェクトPHP

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for ikuwow ikuwow
July 08, 2015

技術書紹介 パーフェクトPHP

Avatar for ikuwow

ikuwow

July 08, 2015
Tweet

More Decks by ikuwow

Other Decks in Programming

Transcript

  1. ຊͷ֓ཁ • 2010೥ॳ൛ୈ1࡮ൃߦ • ݁ߏްͯ͘ॏ͍ • PHPͷਓʹฉ͘ͱ͍͍ͩͨ࣋ͬ ͯΔ or ಡΜͩ͜ͱ͋Δ

    • ର৅ಡऀ͸தڃऀҎ্ʢPHPͰ ೔ৗతʹ։ൃΛ͖ͯͨ͠ਓ or ଞͷݴޠΛ࢖͍͜ͳ͍ͯ͠Δ͕ PHPͷ͜ͱΛΑ͘஌Βͳ͍ਓʣ
  2. ໨࣍ • ୈ1෦ PHPͷ֓ཁ • ୈ2෦ PHPͷݴޠ࢓༷ • ୈ3෦ ࣮ફWebΞϓϦέʔγϣϯ

    • ୈ4෦ PHPηΩϡϦςΟ • ୈ5෦ ςΫχΧϧͳPHPͷ׆༻ ͕͜͜ ໘ന͍
  3. ʮୈ3෦ ࣮ફWebΞϓϦέʔ γϣϯʯ͕͍͢͝ • ୈ6ষ ࣮ફWebΞϓϦέʔγϣϯ • ୈ7ষ ϑϨʔϜϫʔΫʹΑΔޮ཰తͳ։ൃ •

    ୈ8ষ ϛχϒϩάΞϓϦέʔγϣϯ։ൃ DB࢖ͬͨ؆୯ͳΞϓϦέʔγϣϯ࡞੒ MVCϑϨʔϜϫʔΫͷ࡞੒ ʂʁ ϑϨʔϜϫʔΫΛ࢖ͬͨϛχϒϩά։ൃ ʂʁ
  4. MVCϑϨʔϜϫʔΫΛ࡞Δ • ClassLoader, Controller, RouterΫϥεͳ ͲΛόονϦ࡞Γ͜Ή • ࣍ͷষͰϑϨʔϜϫʔΫΛར༻ͯ͠ϛχ ϒϩάΞϓϦέʔγϣϯΛ࡞Δ <?php

    class ClassLoader { protected $dirs; public function register() { spl_autoload_register(array($this, 'loadClass')); } public function registerDir($dir) { $this->dirs[] = $dir; } public function loadClass($class) { foreach ($this->dirs as $dir) { $file = $dir . '/' . $class . '.php'; if (is_readable($file)) { require $file; return; } } } }