Class UpgradeShell
A shell class to help developers upgrade applications to CakePHP 2.0
- AppShell
- UpgradeShell
Copyright: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Location: Cake/Console/Command/UpgradeShell.php
Properties summary
Method Summary
- _filesRegexpUpdate() protectedUpdates files based on regular expressions.
- _findFiles() protectedSearches the paths and finds files based on extension.
- _moveAppClasses() protectedMove the AppController, and AppModel classes.
- _movePhpFiles() protectedMove application php files to where they now should be
- _moveViewFiles() protectedMove application views files to where they now should be
- _updateFile() protectedUpdate a single file.
- all() publicRun all upgrade steps one at a time
- basics() publicUpgrade the removed basics functions.
- components() publicUpdate components.
- configure() publicUpdate Configure::read() calls with no params.
- constants() publicconstants
- controller_redirects() publicUpdate controller redirects.
- exceptions() public
Replace cakeError with built-in exceptions. NOTE: this ignores calls where you've passed your own secondary parameters to cakeError().
- getOptionParser() publicGets the option parser instance and configures it.
- helpers() publicUpdate helpers.
- i18n() publicUpdate i18n.
- locations() publicMove files and folders to their new homes
- request() publicUpdate the properties moved to CakeRequest.
- startup() publicShell startup, prints info message about dry run.
- tests() publicUpdate tests.
Method Detail
_filesRegexpUpdate()source protected
_filesRegexpUpdate( array $patterns )
Updates files based on regular expressions.
Parameters
- array
$patterns
- Array of search and replacement patterns.
_findFiles()source protected
_findFiles( string $extensions '' )
Searches the paths and finds files based on extension.
Parameters
- string
$extensions
optional '' - The extensions to include. Defaults to none.
_movePhpFiles()source protected
_movePhpFiles( string $path , array $options )
Move application php files to where they now should be
Find all php files in the folder (honoring recursive) and determine where CakePHP expects the file to be If the file is not exactly where CakePHP expects it - move it.
Parameters
- string
$path
- The path to move files in.
- array
$options
- array(recursive, checkFolder)
_moveViewFiles()source protected
_moveViewFiles( )
Move application views files to where they now should be
Find all view files in the folder and determine where cake expects the file to be
_updateFile()source protected
_updateFile( string $file , array $patterns )
Update a single file.
Parameters
- string
$file
- The file to update
- array
$patterns
- The replacement patterns to run.
basics()source public
basics( )
Upgrade the removed basics functions.
- a() -> array()
- e(*) -> echo *
- ife(*, *, ) -> !empty() ? * : *
- a() -> array()
- r(*, *, ) -> str_replace(, *, *)
- up() -> strtoupper()
- low(*, *, ) -> strtolower()
- getMicrotime() -> microtime(true)
components()source public
components( )
Update components.
- Make components that extend CakeObject to extend Component.
controller_redirects()source public
controller_redirects( )
Update controller redirects.
- Make redirect statements return early.
exceptions()source public
exceptions( )
Replace cakeError with built-in exceptions. NOTE: this ignores calls where you've passed your own secondary parameters to cakeError().
getOptionParser()source public
getOptionParser( )
Gets the option parser instance and configures it.
Returns
ConsoleOptionParser
i18n()source public
i18n( )
Update i18n.
- Removes extra true param.
- Add the echo to __*() calls that didn't need them before.
locations()source public
locations( )
Move files and folders to their new homes
Moves folders containing files which cannot necessarily be auto-detected (libs and templates) and then looks for all php files except vendors, and moves them to where Cake 2.0 expects to find them.
tests()source public
tests( )
Update tests.
- Update tests class names to FooTest rather than FooTestCase.
Properties detail
$_mapsource
protected array
Map
array( 'Controller' => 'Controller', 'Component' => 'Controller/Component', 'Model' => 'Model', 'Behavior' => 'Model/Behavior', 'Datasource' => 'Model/Datasource', 'Dbo' => 'Model/Datasource/Database', 'View' => 'View', 'Helper' => 'View/Helper', 'Shell' => 'Console/Command', 'Task' => 'Console/Command/Task', 'Case' => 'Test/Case', 'Fixture' => 'Test/Fixture', 'Error' => 'Lib/Error', )
© 2005–2017 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/2.10/class-UpgradeShell.html