GithubHelp home page GithubHelp logo

joaorportal89 / upgrade Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cakephp/upgrade

0.0 0.0 0.0 465 KB

Upgrade tools for CakePHP meant to facilitate migrating from one version of the framework to another

License: MIT License

Shell 1.37% PHP 97.82% Makefile 0.29% Batchfile 0.51%

upgrade's Introduction

CakePHP Upgrade tool

Build Status

Upgrade tools for CakePHP meant to facilitate migrating between CakePHP 4.x versions and from CakePHP 4.x to CakePHP 5.x. This repository should be used as a standalone application and not as a plugin.

Installation

First clone this repository or download a zipball:

git clone git://github.com/cakephp/upgrade

Then to install dependencies with composer

php composer.phar install --no-dev

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.

Upgrading between CakePHP 4.x versions

When upgrading between CakePHP 4.x versions the rector command can automate updates for many deprecation warnings. To get the most value from the rector command you should be sure to add as many typehints or parameter docblock annotations as you can. Without these annotations or typehints rector will not be able to be as effective as it cannot infer types.

cd /path/to/upgrade

# To apply upgrade rules from 4.3 to 4.4
bin/cake upgrade rector --rules cakephp44 /path/to/your/app/src

There are rules included for:

  • cakephp41
  • cakephp42
  • cakephp43
  • cakephp44

Upgrading from CakePHP 3.x to CakePHP 4.x

The upgrade tool is intended to be run before you update your application's dependencies to 4.0. The rector based tasks will not run correctly if your application already has its dependencies updated to 4.x.

Once you have installed the upgrade tool dependencies there are several commands you should run:

cd /path/to/upgrade

# Run all upgrade tasks at once.
bin/cake upgrade /home/mark/Sites/my-app

# OR run upgrade tasks individually.
# Rename locale files
bin/cake upgrade file_rename locales /home/mark/Sites/my-app

# Rename template files
bin/cake upgrade file_rename templates /home/mark/Sites/my-app

# Run rector rules.
bin/cake upgrade rector /home/mark/Sites/my-app/src
bin/cake upgrade rector /home/mark/Sites/my-app/tests
bin/cake upgrade rector /home/mark/Sites/my-app/config

Development

To ease installation & usage, this package does not use require-dev in composer.json as the installed PHPUnit and CakePHP packages cause conflicts with the rector tasks.

To install dev-dependencies use make install-dev. Then you will be able to run vendor/bin/phpunit. You can also use make test to install dependencies and run tests.

upgrade's People

Contributors

markstory avatar othercorey avatar ad7six avatar samsonasik avatar dereuromark avatar admad avatar lorenzo avatar ceeram avatar bcrowe avatar devcorrelator avatar garas avatar geoffoliver avatar softius avatar lordsimal avatar antograssiot avatar dependabot[bot] avatar renan avatar hmic avatar carusogabriel avatar arhell avatar aloross avatar jippi avatar ctgraham avatar davidyell avatar jadb avatar josegonzalez avatar jrbasso avatar swiffer avatar rchavik avatar codeblastr 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.