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

オートローディングでレガシーPHPと戦う

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

 オートローディングでレガシーPHPと戦う

属人的になってしまったディレクトリ構造をオートローディングを使って解決する、そんなお話です

Avatar for Satoshi Kawashima

Satoshi Kawashima

February 22, 2017
Tweet

More Decks by Satoshi Kawashima

Other Decks in Programming

Transcript

  1. class SuperHyperOreOreClass
 {
 private $sugoi;
 private $yabai;
 
 public function

    __construct()
 {
 $this->sugoi = 'sugoi';
 $this->yabai = 'yabai';
 }
 
 public function tyouYabai()
 {
 // ...
 }
 }
  2. ϑΝΠϧύεʹґଘ͍ͯ͠Δ class Hoge
 {
 // ...
 } DMBTT+6(&.)PHFQIQ <?php
 


    require_once ‘class/JUGEM/Hoge.php’;
 
 // ... <?php
 
 require_once ‘Hoge.php’;
 
 // ... wϨΨγʔͳ1)1͸SFRVJSF@PODFͰϑΝΠϧͰಡΈࠐΈΛ͍ͯ͠Δ wϑΝΠϧύεΛม͑ΔͳΒίʔυ΋ม͑ͳ͍ͱ͍͚ͳ͍
  3. /0