cakephp のクラスの定義とか

個人的なメモに近いですが cakephp3.xx でコントーラーやらなんやらを作る際 名前空間や extends はそれにあったのを使う。


<?php namespace App\Shell; # src/Shell/hogehoge.php などで Shell の php を作成した時には App\Shell を指定 # shell 用なので名前空間もそれ用に指定する #使うすべてのクラスを読み込む use App\Controller\AppController; use Cake\Filesystem\Folder; use Cake\Filesystem\File; use Cake\Console\Shell; use Cake\ORM\TableRegistry; use Cake\Datasource\ConnectionManager; #class の定義は自由だが extends は今回 shell ようなので Shell class hogehoege extends Shell { 以下略