2.xのApp::buildは、各パッケージの場所を設定するためのもの。3.xではApp::buildはなくなった。composerのclasspathがかわりにうまいことやってくる(はず)だから。
この例だとControllerはまず/full/path/to/Controller/
のほうを見に行って、なかったら/another/path/
をみにいくことになってる。
App::build(array('Controller' => array('/full/path/to/Controller/', '/another/path/')));
3.xだとクラスパスをcomposer.jsonに追記する感じで。
"autoload": { "psr-4": { "App\\": ["src/", "/path/to/directory/"] } }
App::buildの検索設定が5つとか6つとかあったら…まあがんばってください。正直そんなにApp::buildで検索するパスがいっぱいあるとするならきっと設計が間違っていると思います。
ちなみにViewをApp::build()したいなら、クラスパスは使えなくてconfig/app.phpに以下のように記載します。templatesがApp::buildのViewの代わりです。
config/app.php
return [ // 他の設定 'App' => [ 'paths' => [ 'plugins' => [ ROOT . DS . 'plugins' . DS, '/path/to/other/plugins/' ], 'templates' => [ APP . 'Template' . DS, APP . 'Template2' . DS ], 'locales' => [ APP . 'Locale' . DS ] ] ] ];
別な書き方としてConfigure::writeでもいけます。
Configure::write('App.paths.templates', [ '/path/to/template', '/another/template' ] );