Giter Club home page Giter Club logo

upgrade's Introduction

CakePHP Upgrade tool Build Status

Upgrade tools for CakePHP meant to facilitate migrating from CakePHP 2.x to 3.0.0.

Warning This tool is still under development and doesn't handle all aspects of migrating.

Installation

After downloading/cloning the upgrade tool, you need to install dependencies with composer

php composer.phar install

Once dependencies are installed you can start using the upgrade shell.

Usage

The upgrade tool provides a standalone application that can be used to upgrade other applications or cakephp plugins. Each of the subcommands accepts a path that points to the application you want to upgrade.

cd /path/to/upgrade
bin/cake upgrade all /home/mark/Sites/my-app
bin/cake upgrade skeleton /home/mark/Sites/my-app

The first command would run all the tasks at once on /home/mark/Sites/my-app, which is probably the way most people will want to use it. Additionally the second command would run the skeleton task on /home/mark/Sites/my-app. This command is not included in all as it is only necessary for apps. Plugins don't need it.

It is recommended that you keep your application in version control, and keep backups of it before using the upgrade tool.

Order matters

Several of the commands have dependencies on each other and should be run in a specific order. It is recommended that you run the following commands first before using other commands:

bin/cake upgrade locations [path]
bin/cake upgrade namespaces [path]
bin/cake upgrade app_uses [path]

Once these three commands have been run, you can use the other commands in any order. The all command already used the right order by default.

Tasks Available

locations

Move files/directories around. Run this before adding namespaces with the namespaces command.

namespaces

Add namespaces to files based on their file path. Only run this after you have moved files.

app_uses

Replace App::uses() with use statements

rename_classes

Rename classes that have been moved/renamed. Run after replacing App::uses().

rename_collections

Rename HelperCollection, ComponentCollection, and TaskCollection. Will also rename component constructor arguments and _Collection properties on all objects.

method_names

Updates the method names for a number of methods.

method_signatures

Updates the method signatures for a number of methods.

fixtures

Update fixtures to use new index/constraint features. This is necessary before running tests.

tests

Update test cases regarding fixtures.

i18n

Update translation functions regarding placeholders.

skeleton

Add basic skeleton files and folders from the "app" repository.

prefixed_templates

Move view templates for prefixed actions to prefix subfolder. eg. Users/admin_index.ctp becomes Admin/Users/index.ctp. By default admin prefix is handled, you can run this task for other routing prefixes using --prefix=other as well.

More Available Tasks

See dereuromark/upgrade repo for a few more on-top tasks available, that have not been merged back into this main one yet.

upgrade's People

Contributors

markstory avatar ad7six avatar admad avatar lorenzo avatar bcrowe avatar ceeram avatar dereuromark avatar antograssiot avatar carusogabriel avatar hmic avatar renan avatar aloross avatar jippi avatar davidyell avatar jadb avatar josegonzalez avatar jrbasso avatar rchavik avatar codeblastr avatar rikvdh avatar julianpollmann avatar tanuck avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.