당신은 어떤 수업에서도 $ name이 필요하지 않습니다. 1.3에서도 (여전히 어쨌든 php4를 사용하는 사람 ^^), 특히 2.0에서는 그렇지 않습니다.
나는 모든 클래스 파일에서 이러한 불필요한 덩어리를 제거하는 강화 된 UpgradeShell 썼다 :
http://cakephp.lighthouseapp.com/projects/42648/tickets/2117-improvements-for-20-upgrade-shell 을하지만이 새로운 명령은 아직 티켓 패치에 추가 didnt한다.
나는 명령 "이름"당신은 또한 CakePHP의 1.3 '모델 :: name` 당신이 PHP를 실행하는 경우를 5+ 정의 할 필요가 없습니다
/**
* Remove name (lib, controller, model, view, component, behavior, helper, fixture)
*
* @return void
*/
public function name() {
$libs = App::path('Lib');
$views = App::path('views');
$controllers = App::path('controllers');
$components = App::path('components');
$models = App::path('models');
$helpers = App::path('helpers');
$behaviors = App::path('behaviors');
$this->_paths = array_merge($libs, $views, $controllers, $components, $models, $helpers, $behaviors);
$this->_paths[] = TESTS . 'Fixture' . DS;
if (!empty($this->params['plugin'])) {
$pluginPath = App::pluginPath($this->params['plugin']);
$this->_paths = array(
$pluginPath . 'Lib' . DS,
$pluginPath . 'Controller' . DS,
$pluginPath . 'Controller' . DS . 'Component' .DS,
$pluginPath . 'View' . DS,
$pluginPath . 'View' . DS . 'Helper' . DS,
$pluginPath . 'Model' . DS,
$pluginPath . 'Model' . DS . 'Behavior' . DS,
$pluginPath . 'Test' . DS . 'Fixture' . DS,
$pluginPath . 'libs' . DS,
$pluginPath . 'controllers' . DS,
$pluginPath . 'controllers' . DS . 'components' .DS,
$pluginPath . 'views' . DS,
$pluginPath . 'views' . DS . 'helpers' .DS,
$pluginPath . 'models' . DS,
$pluginPath . 'models' . DS . 'behaviors' . DS,
$pluginPath . 'tests' . DS . 'fixtures' . DS,
);
}
$patterns = array(
array(
'remove var $name = ...;',
'/\bvar\s*\$name\s*=\s*(.*);/',
''
),
array(
'remove public $name = ...;',
'/\bpublic\s*\$name\s*=\s*(.*);/',
''
),
);
$this->_filesRegexpUpdate($patterns);
}
N.의 B를했다. – deizel