CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (GitHub)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • Slack
    • Paid Support
CakePHP

C CakePHP 2.10 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 2.10
      • 4.2
      • 4.1
      • 4.0
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Packages

  • Cake
    • Cache
      • Engine
    • Configure
    • Console
      • Command
        • Task
    • Controller
      • Component
        • Acl
        • Auth
    • Core
    • Error
    • Event
    • I18n
    • Log
      • Engine
    • Model
      • Behavior
      • Datasource
        • Database
        • Session
      • Validator
    • Network
      • Email
      • Http
    • Routing
      • Filter
      • Route
    • TestSuite
      • Coverage
      • Fixture
      • Reporter
    • Utility
    • View
      • Helper
  • None

Classes

  • AclShell
  • ApiShell
  • BakeShell
  • CommandListShell
  • CompletionShell
  • ConsoleShell
  • I18nShell
  • SchemaShell
  • ServerShell
  • TestShell
  • TestsuiteShell
  • UpgradeShell

Class UpgradeShell

A shell class to help developers upgrade applications to CakePHP 2.0

AppShell
Extended by UpgradeShell
Package: Cake\Console\Command
Copyright: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Location: Cake/Console/Command/UpgradeShell.php

Properties summary

  • $_files protected
    array
    Files
  • $_map protected
    array
    Map
  • $_paths protected
    array
    Paths

Method Summary

  • _filesRegexpUpdate() protected
    Updates files based on regular expressions.
  • _findFiles() protected
    Searches the paths and finds files based on extension.
  • _moveAppClasses() protected
    Move the AppController, and AppModel classes.
  • _movePhpFiles() protected
    Move application php files to where they now should be
  • _moveViewFiles() protected
    Move application views files to where they now should be
  • _updateFile() protected
    Update a single file.
  • all() public
    Run all upgrade steps one at a time
  • basics() public
    Upgrade the removed basics functions.
  • components() public
    Update components.
  • configure() public
    Update Configure::read() calls with no params.
  • constants() public
    constants
  • controller_redirects() public
    Update 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() public
    Gets the option parser instance and configures it.
  • helpers() public
    Update helpers.
  • i18n() public
    Update i18n.
  • locations() public
    Move files and folders to their new homes
  • request() public
    Update the properties moved to CakeRequest.
  • startup() public
    Shell startup, prints info message about dry run.
  • tests() public
    Update tests.

Method Detail

_filesRegexpUpdate() protected ¶

_filesRegexpUpdate( array $patterns )

Updates files based on regular expressions.

Parameters
array $patterns
Array of search and replacement patterns.

_findFiles() protected ¶

_findFiles( string $extensions = '' )

Searches the paths and finds files based on extension.

Parameters
string $extensions optional ''
The extensions to include. Defaults to none.

_moveAppClasses() protected ¶

_moveAppClasses( )

Move the AppController, and AppModel classes.

_movePhpFiles() 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() 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() protected ¶

_updateFile( string $file , array $patterns )

Update a single file.

Parameters
string $file
The file to update
array $patterns
The replacement patterns to run.

all() public ¶

all( )

Run all upgrade steps one at a time

basics() 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() public ¶

components( )

Update components.

  • Make components that extend CakeObject to extend Component.

configure() public ¶

configure( )

Update Configure::read() calls with no params.

constants() public ¶

constants( )

constants

controller_redirects() public ¶

controller_redirects( )

Update controller redirects.

  • Make redirect statements return early.

exceptions() public ¶

exceptions( )

Replace cakeError with built-in exceptions. NOTE: this ignores calls where you've passed your own secondary parameters to cakeError().

getOptionParser() public ¶

getOptionParser( )

Gets the option parser instance and configures it.

Returns
ConsoleOptionParser

helpers() public ¶

helpers( )

Update helpers.

  • Converts helpers usage to new format.

i18n() public ¶

i18n( )

Update i18n.

  • Removes extra true param.
  • Add the echo to __*() calls that didn't need them before.

locations() 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.

request() public ¶

request( )

Update the properties moved to CakeRequest.

startup() public ¶

startup( )

Shell startup, prints info message about dry run.

tests() public ¶

tests( )

Update tests.

  • Update tests class names to FooTest rather than FooTestCase.

Properties detail

$_files ¶

protected array

Files

array()

$_map ¶

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',
)

$_paths ¶

protected array

Paths

array()
OpenHub
Rackspace
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (GitHub)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • Slack
  • Paid Support

Generated using CakePHP API Docs