Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>you dont need need $name in any of your classes. not even in 1.3 (who still uses php4 anyway^^), but especially not in 2.0.</p> <p>I wrote an enhanced UpgradeShell which removes those unnecessary chunks from all class files: <a href="http://cakephp.lighthouseapp.com/projects/42648/tickets/2117-improvements-for-20-upgrade-shell" rel="nofollow">http://cakephp.lighthouseapp.com/projects/42648/tickets/2117-improvements-for-20-upgrade-shell</a> but this new command I didnt yet add to the ticket patch.</p> <p>I called the command "name"</p> <pre><code>/** * 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-&gt;_paths = array_merge($libs, $views, $controllers, $components, $models, $helpers, $behaviors); $this-&gt;_paths[] = TESTS . 'Fixture' . DS; if (!empty($this-&gt;params['plugin'])) { $pluginPath = App::pluginPath($this-&gt;params['plugin']); $this-&gt;_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-&gt;_filesRegexpUpdate($patterns); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload