GithubHelp home page GithubHelp logo

cakephp / upgrade Goto Github PK

View Code? Open in Web Editor NEW
109.0 24.0 57.0 516 KB

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

License: MIT License

Shell 1.09% PHP 98.26% Batchfile 0.41% Makefile 0.23%

upgrade's Introduction

CakePHP Upgrade tool

CI

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

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

upgrade's Issues

migrate Time changes.

The Time utility had a number of changes. The upgrade shell can automate some of its method replacements.

Handle exception namespace changes

Various exception classes were moved from Cake\Error to their respective packages/namespaces in cakephp/cakephp#3300. These changes could be handled by upgrade shell by replacing existing exception usage with their fully namespaced version.

The "locations" command generates weird paths

Running the locations command on the @MISP codebase generated some weird paths:

        renamed:    app/View/Layouts/Emails/html/default.ctp -> app/src/src/src/Template/Layout/Email/html/default.ctp
        renamed:    app/View/Layouts/Emails/text/default.ctp -> app/src/src/src/Template/Layout/Email/text/default.ctp

Handling of plugins

Follow up on #33

When using upgrade [path/to/app], one can currently add -p PluginName, even though this is not functional yet.
It would be useful to then set the basepath internally to path/to/app/plugins/PluginName (also possible rename path/to/app/Plugin/PluginName to it if not done so yet).
Then migrate everything inside this plugin and use the correct plugin namespace etc.

Also skip tasks like "Skeleton" which should not be run for the plugin param set.
Should also handle it correctly if one directly links to a plugin and uses the the plugin param - if possible.

upgrade cakephp 2.4 to 3.0 does not work properly

sir i have follow each command to updgrade cake php 2.4 to 3.0. but it does showing any effect in app folder it contain controllers, models, view etc the src folder contain only templates and controller

Update themes into plugins

It would be ideal if the upgrade shell had a task for extracting an applications View/Themed directories and automatically converted them to plugins in /Plugin.

Class is not in the implicit class map

When I try to upgrade my application I get a lot of warning/error, I don't know why they happend, is there something to do with compose.json ?

ClassRegistry is not in the implicit class map
Processing /var/www/temp_avoid/app/lib/Cake/tests/TestCase/src/Template/MediaViewTest.php
Processing /var/www/temp_avoid/app/lib/Cake/tests/TestCase/src/Controller/ControllerMergeVarsTest.php
Processing /var/www/temp_avoid/app/lib/Cake/tests/TestCase/src/Controller/Component/EmailComponentTest.php
Email is not in the implicit class map
EmailComponentTest is not in the implicit class map
DebugCompTransport is not in the implicit class map
ClassRegistry is not in the implicit class map
Type is not in the implicit class map

version upgrading from 2.3.5 to 2.8.4

I tried to update my Cakephp version from 2.3.5 to 2.8.4. I got a solution that we can simply replace the lib folder to upgrade any versions between 2.X. So, I replaced my 2.3.5 version lib folder with the new one . My application is working fine with a warning message that "Warning: set_error_handler() expects the argument (AppError::handleError) to be a valid callback in \lib\Cake\Core\Configure.php on line 473". I tried by comparing my new files with old files. But, couldn't relocate this issue. Does any one can help me out from this.

ViewBlock::append() to ViewBlock::concat()

This could probably also become a task:

ViewBlock::append() has been removed, use Cake\ViewViewBlock::concat() instead.

Maybe we can also do

View::getVar() has been removed, use Cake\View\View::get() instead.

and

HtmlHelper::useTag() has been removed, use tag() instead.

Allow extensions and plugins to hook into

Currently it is very difficult to extend the available ruleset / tasks here for customized replacements.
I think we should provide an easy way to inject your own Tasks.

This could be done similar to DebugKit tabs, whereas a simple Configure value could do that, once you added the plugins to the composer file and enabled them via Plugin::load().

So a Seach plugin could have a

src/Shell/Task/SearchUpgradeTask.php

which then gets loadable by the Upgrade app and can be used to replace custom stuff in relation with that plugin usage. Same for any plugin out there.

Or are there other better ways?

upgrade all generates unexpected results

What I ran

$ ./bin/cake upgrade all --git --namespace CsvView /srv/sites/cake-apps/foc/csvview/

Welcome to CakePHP v3.0.0-beta3 Console
---------------------------------------------------------------
App : src
Path: /srv/sites/cake-apps/upgrade/src/
---------------------------------------------------------------
Processing /srv/sites/cake-apps/foc/csvview/.travis.yml
Processing /srv/sites/cake-apps/foc/csvview/composer.json
Processing /srv/sites/cake-apps/foc/csvview/CONTRIBUTING.md
Processing /srv/sites/cake-apps/foc/csvview/.editorconfig
Processing /srv/sites/cake-apps/foc/csvview/.semver
Processing /srv/sites/cake-apps/foc/csvview/Controller/Component/CsvViewComponent.php
Hash is not in the implicit class map
Processing /srv/sites/cake-apps/foc/csvview/LICENSE.txt
Processing /srv/sites/cake-apps/foc/csvview/README.md
Processing /srv/sites/cake-apps/foc/csvview/Test/Case/AllCsvViewTest.php
Processing /srv/sites/cake-apps/foc/csvview/Test/Case/Controller/Component/CsvViewComponentTest.php
Processing /srv/sites/cake-apps/foc/csvview/Test/Case/View/CsvViewTest.php
CsvViewTest is not in the implicit class map
Processing /srv/sites/cake-apps/foc/csvview/Test/test_app/View/Posts/csv/index.ctp
Processing /srv/sites/cake-apps/foc/csvview/View/CsvView.php
Hash is not in the implicit class map
Move /srv/sites/cake-apps/foc/csvview/Controller/Component/CsvViewComponent.php to /srv/sites/cake-apps/foc/csvview/src/Controller/Component/CsvViewComponent.php and update
fatal: Could not switch to '/srv/sites/cake-apps/foc/csvview/src/Controller/Component/': No such file or directory
Move /srv/sites/cake-apps/foc/csvview/Test/Case/AllCsvViewTest.php to /srv/sites/cake-apps/foc/csvview/tests/testsCase/AllCsvViewTest.php and update
fatal: Could not switch to '/srv/sites/cake-apps/foc/csvview/tests/testsCase/': No such file or directory
Move /srv/sites/cake-apps/foc/csvview/Test/Case/Controller/Component/CsvViewComponentTest.php to /srv/sites/cake-apps/foc/csvview/tests/testsCase/src/Controller/Component/CsvViewComponentTest.php and update
fatal: Could not switch to '/srv/sites/cake-apps/foc/csvview/tests/testsCase/src/Controller/Component/': No such file or directory
Move /srv/sites/cake-apps/foc/csvview/Test/Case/View/CsvViewTest.php to /srv/sites/cake-apps/foc/csvview/tests/testsCase/src/Template/CsvViewTest.php and update
fatal: Could not switch to '/srv/sites/cake-apps/foc/csvview/tests/testsCase/src/Template/': No such file or directory
Move /srv/sites/cake-apps/foc/csvview/View/CsvView.php to /srv/sites/cake-apps/foc/csvview/src/Template/CsvView.php and update
Move /srv/sites/cake-apps/foc/csvview/Test/test_app/View/Posts/csv/index.ctp to /srv/sites/cake-apps/foc/csvview/tests/test_app/src/Template/Posts/csv/index.ctp

What i ended up with

Inside the plugin folder:

$ git status
On branch cake3
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

    renamed:    Controller/Component/CsvViewComponent.php -> Controller/Component/CsvViewComponent.php__
    renamed:    Test/Case/AllCsvViewTest.php -> Test/Case/AllCsvViewTest.php__
    renamed:    Test/Case/Controller/Component/CsvViewComponentTest.php -> Test/Case/Controller/Component/CsvViewComponentTest.php__
    renamed:    Test/Case/View/CsvViewTest.php -> Test/Case/View/CsvViewTest.php__
    renamed:    View/CsvView.php -> src/Template/CsvView.php
    renamed:    Test/test_app/View/Posts/csv/index.ctp -> tests/test_app/src/Template/Posts/csv/index.ctp

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    Controller/Component/CsvViewComponent.php
    Test/Case/AllCsvViewTest.php
    Test/Case/Controller/Component/CsvViewComponentTest.php
    Test/Case/View/CsvViewTest.php
    View/
    bin/
    config/
    index.php
    logs/
    phpunit.xml.dist
    src/Template/Error/
    src/Template/Layout/
    tests/bootstrap.php
    webroot/

I tried with --verbose too but from the output it's not apparent which task generates the file will double underscore suffix.

That said a bit more verbosity is desirable even when running all tests without --verbose. At least the name of the task that runs should be showed before it starts.

Also based on the error shown in output regarding a task's inability to switch folder, it seems these loops needs to be changed and the files list shown be re-fetched again before starting each task.

Readme file should be updated

Readme file of this repository should be updated with top to bottom installation procedures. From where to start and how it should be accomplished.

Cake 1.3

I have a site that's still on CakePHP 1.3 (yeah I know). Any chance this tool could also do a best effort upgrade of that ancient version? I'm happy to do the cleaning up afterwards, but it would already be a big help if this tool could handle 80% of the most common search & replaces : )

cake upgrade all - PHP Fatal error: Class 'PHPUnit_Framework_TestCase' not found ...

Hi,

when I'm trying to execute "upgrade all" of my old cakephp application I get an error:

CakeSessionHandlerInterface is not in the implicit class map
DataSource is not in the implicit class map
CakeTestModel is not in the implicit class map
TestPluginAppModel is not in the implicit class map
TestPluginAppModel is not in the implicit class map
TestPluginAppModel is not in the implicit class map
TestPluginAppModel is not in the implicit class map
PHPUnit_Framework_TestResult is not in the implicit class map
SimpleTestCase is not in the implicit class map
ClassRegistry is not in the implicit class map
CakeTestSuiteDispatcher is not in the implicit class map
PHPUnit_Runner_StandardTestSuiteLoader is not in the implicit class map
PHPUnit_TextUI_TestRunner is not in the implicit class map
array is not in the implicit class map
PHP Fatal error:  Class 'PHPUnit_Framework_TestCase' not found in /Users/my_user_name/git/upgrade/vendor/cakephp/cakephp/src/TestSuite/TestCase.php on line 29

why I'm receiving this error?
I have phpunit installed in my system, (it seams that it cannot found phpunit in the PATH)
$> phpunit --version
PHPUnit 4.6.4 by Sebastian Bergmann and contributors.

Bug with AppUses / RenameClasses

Cake\Network\Http\HttpSocket is currently made to App\Network\Http\Client
mainly because the RenameClasses task is running after the AppUses task, where it tries to find such a class file in the core.

Maybe those two should either share those renames, or should be integrated into each other.

Error running project after upgrade

Hi
After the update, I open the project and get the following error:

Parse error: syntax error, unexpected 'use' (T_USE) in C:\wamp64\www\rootcake3\lib\Cake\basics.php on line 85

What can I do?
Thanks

$this->Url->build()

There should be a migration regex for automatically changing

$this->Html->url() // 2.x

to

$this->Url->build() // 3.x

for the View layer.

Maybe also for

assetTimestamp()
assetUrl()
webroot()

or other methods that have been moved from Html to Url helper.

This will probably be only possible to work out of the box for view ctps as inside helpers you would also have to add Url to the $helpers array.
But even there we could probably fix it, as the former way would create a fatal error anyway.

Controller class could not the found

Having an issue after using the upgrade tool where the controllers can't be found, even though they exist and are being referenced properly in the routes.

The error is as follows:
Error: [Cake\Routing\Exception\MissingControllerException] Controller class Home could not be found.
Exception Attributes: array (
'class' => 'Home',
'plugin' => NULL,
'prefix' => NULL,
'_ext' => NULL,
)
Request URL: /
Client IP: xxx.xxx.xxx.xxx
Stack Trace:
#0 /var/www/project/webroot/index.php(36): Cake\Routing\Dispatcher->dispatch(Object(Cake\Network\Request), Object(Cake\Network\Response))
#1 {main}

Any idea what the problem might be?

Thanks!

Fatal error: Cannot declare class lib\Cake\Core\App because the name is already in use

I have upgraded my old cakephp 2.x application to cakephp 3 using upgrade, and after deploying the application in htdocs of my XAMPP server I get the following error

Fatal error: Cannot declare class lib\Cake\Core\App because the name is already in use in /Applications/XAMPP/xamppfiles/htdocs/ ... lib/Cake/Core/App.php on line 70

how can I fix this?

maybe when upgrading some folders have copied by error?

EDIT: when I try to run cake built-in server from bin/cake server it returns an error because it cannot find cake_core_libs

thanks

Deprecated errors in bootstrap

I cloned the upgrade tool, run composer install and after that
bin/cake uprade locations "/...path-to-my-app.../app" -v produced errors:

PHP Deprecated:  PHP configuration files like "app.php" should not set `$config`. Instead return an array. - /.../git/upgrade/vendor/cakephp/cakephp/src/Core/Configure.php, line: 343
 You can disable deprecation warnings by setting `Error.errorLevel` to `E_ALL & ~E_USER_DEPRECATED` in your config/app.php. in /.../git/upgrade/vendor/cakephp/cakephp/src/Core/functions.php on line 311
PHP Stack trace:
PHP   1. {main}() /.../git/upgrade/bin/cake.php:0
PHP   2. require() /.../git/upgrade/bin/cake.php:19
PHP   3. Cake\Core\Configure::load() /.../git/upgrade/config/bootstrap.php:72
PHP   4. Cake\Core\Configure\Engine\PhpConfig->read() /.../git/upgrade/vendor/cakephp/cakephp/src/Core/Configure.php:343
PHP   5. deprecationWarning() /.../git/upgrade/vendor/cakephp/cakephp/src/Core/Configure/Engine/PhpConfig.php:98
PHP   6. trigger_error() /.../git/upgrade/vendor/cakephp/cakephp/src/Core/functions.php:311
Deprecated Error: Cake\Cache\Cache::config() is deprecated. Use setConfig()/getConfig() instead. - /.../git/upgrade/config/bootstrap.php, line: 121
 You can disable deprecation warnings by setting `Error.errorLevel` to `E_ALL & ~E_USER_DEPRECATED` in your config/app.php. in [/.../git/upgrade/vendor/cakephp/cakephp/src/Core/functions.php, line 311]

Deprecated Error: Cake\Datasource\ConnectionManager::config() is deprecated. Use setConfig()/getConfig() instead. - /.../git/upgrade/config/bootstrap.php, line: 122
 You can disable deprecation warnings by setting `Error.errorLevel` to `E_ALL & ~E_USER_DEPRECATED` in your config/app.php. in [/.../git/upgrade/vendor/cakephp/cakephp/src/Core/functions.php, line 311]

Deprecated Error: Use Cake\Mailer\Email instead of Cake\Network\Email\Email. - /.../git/upgrade/vendor/composer/ClassLoader.php, line: 444
 You can disable deprecation warnings by setting `Error.errorLevel` to `E_ALL & ~E_USER_DEPRECATED` in your config/app.php. in [/.../git/upgrade/vendor/cakephp/cakephp/src/Core/functions.php, line 311]

Deprecated Error: Email::configTransport() is deprecated. Use TransportFactory::setConfig() or TransportFactory::getConfig() instead. - /.../git/upgrade/config/bootstrap.php, line: 123
 You can disable deprecation warnings by setting `Error.errorLevel` to `E_ALL & ~E_USER_DEPRECATED` in your config/app.php. in [/.../git/upgrade/vendor/cakephp/cakephp/src/Core/functions.php, line 311]

Exception: If config is null, key must be an array. in [/.../git/upgrade/vendor/cakephp/cakephp/src/Core/StaticConfigTrait.php, line 79]

Upgrade callback method signatures

E.g.

Declaration of App\Controller\AppController::beforeFilter() should be compatible 
with Cake\Controller\Controller::beforeFilter(Cake\Event\Event $event) [APP/Controller\AppController.php, line 11]

So

public function beforeFilter()

=>

public function beforeFilter(Event $event)

including the use statement if possible.

For components:

initialize(Controller $Controller)
// to
initialize(array $config)

Move + Change causes files not be moved when not using GIT

When using the all command, there will be files that need to be moved as well as changed, which is being handled separately from the files that need to be moved only

https://github.com/cakephp/upgrade/blob/master/src/Shell/Task/StageTask.php#L169-L210

The problem here is that when not using GIT, the files are not being moved, but just deleted, and then rewritten to the source location ($path) instead of the target location ($this->_staged['move'][$path]), and thus they don't move.

Add missing files from app repo

When upgrading existing apps, maybe the upgrade shell can put missing files and folders into the app.

E.g.:

/logs
/bin/cake

etc.

Error while upgrading my Cake 2.3.5 to Cake 3.0

I followed the following steps -

  • I have my project in vhosts, project folder name is "old_version" which was built on Cakephp 2.3.5
  • Now going inside - cd old_version, there I run "git clone git://github.com/cakephp/upgrade.git" command and downloaded a folder with name "upgrade".
  • Now moving into "upgrade" folder cd upgrade, there I installed composer by running the command "curl -sS https://getcomposer.org/installer | php".
  • Composer is downloaded into "upgrade" folder.
  • Now when I execute "bin/cake upgrade all ../old_version/app" , there i am getting an error in terminal that "require(/var/www/vhosts/old_version/upgrade/vendor/cakephp/cakephp/src/Core/ClassLoader.php): failed to open stream: No such file or directory in /var/www/vhosts/old_version/upgrade/config/bootstrap.php on line 32
    PHP Fatal error: require(): Failed opening required '/var/www/vhosts/talenthire_old/upgrade/vendor/cakephp/cakephp/src/Core/ClassLoader.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/vhosts/talenthire_old/upgrade/config/bootstrap.php on line 32
    "
  • The issue is when I download shell from "git clone git://github.com/cakephp/upgrade.git" I was not getting any vendor folder within that.

Please suggest me with all required steps, how can I upgrade my Cakephp V 2.3.5 to Cakephp V 3.0

Skip dot folders

Currently, the shell runs into .git dirs, as well:

Processing app\.editorconfig
Processing app\.git\COMMIT_EDITMSG
...

when running upgrade locations <path>.

We should probably exclude those dirs.

It looks like they are already in some exclude list:

$exclude = ['.git', '.svn', 'vendor', 'Vendor', 'webroot', 'tmp'];

But maybe the output should then also hide them for less confusion.

It also didnt seem to skip vendor, which is also not ideal:

Processing app\vendor\symfony\yaml\Symfony\Component\
    Yaml\Tests\Fixtures\YtsErrorTests.yml
...

And what's worth, it seems to also to modify those vendor files - and that's bad.

Various GIT problems on Windows

There are a few problems when using GIT on Windows.

  • ; is used as a separator the the cd and git commands, which isn't supported, instead & or && need to be used.
  • The shell assumes that GITs mkdir command is globally available, it uses mkdir -p path, which will fail on Windows in case GIT is installed with only the git.exe in the PATH (this is default option), as then the default mkdir command will be used wich doesn't support the -p argument, and create a path named -p instead.
  • Moving the __ appended files doesn't work. This results in an "No such file or directory" error for whatever reason, not sure what the problem here is, maybe some kind of race condition.

I'm using Windows 7 x64 and GIT 1.9.5.msysgit.1

Allow adding in of custom/own tasks

Currently the list is pretty fixated.
It would be very handy if one could easily hook in his own custom migration tasks similar to DebugKit tabs.

Site does not working after upgrade .

I have used all commands but after successfully run commands site not working.
XXXX.com is currently unable to handle this request.
HTTP ERROR 500

Valet-linux installation PHP fatal error

PHP Fatal error: Cannot declare class Nginx, because the name is already in use in /home/codemagic/.composer/vendor/cpriego/valet-linux/cli/includes/facades.php on line 32

Errors during "upgrade namespaces" and other gotchas

I've done the following:
Download and copy contents into E:\myapp.git

cd to folder E:\myapp.git
E:\myapp.git>composer self-update
E:\myapp.git>composer update          // brought in cake 3.0.8

The first issue I had to solve was that the docs do NOT indicate that a command line version of git.exe needed to be available. Since I use SmartGit on Windows, I had to add a new entry to the PATH environment variable.

My current directory is the folder of my project (E:\myapp.git) and I use the following command to start the conversion process:

FIRST STEP:

E:\myapp.git>.\bin\cake upgrade locations E:\myapp.git > E:\UPG_locations.txt 2>&1

This produces output beginning with...

Welcome to CakePHP v3.0.8 Console
App : src
Path: E:\myapp.git\src\
Welcome to CakePHP v3.0.8 Console
App : src
Path: E:\myapp.git\src\

Processing ROOT\.editorconfig

... etc ...

and with out error. But to get this to work, two folders (Data and Database) that I had in my app folder had to be removed. They contained large zip and db files which forced the upgrade tool to try and allocate massive amounts of memory... which failed. I removed those two folders, and now it runs fine. After each upgrade command, I have done a backup of the entire project folder!

NEXT STEP:

E:\myapp.git>.\bin\cake upgrade namespaces E:\myapp.git > E:\UPG_namespaces.txt 2>&1

Which produces a very large output file including many errors:

error: Could not access ''E:\myapp.git\tmp\upgrade\dd8a59b3e6b24728af45f746520a60a93443b424''
Update ROOT\app\Config\acl.php
error: Could not access ''E:\myapp.git\tmp\upgrade\0c11c967815dc17a961003fac3ca880d57865a2b''
Update ROOT\app\Config\database.php


error: Could not access ''E:\myapp.git\tmp\upgrade\70f6bec3dc3ca26f9ce8bd5fb6906f7ec33d8ce0''
Update ROOT\app\Console\Command\AppShell.php
error: Could not access ''E:\myapp.git\tmp\upgrade\a9818200390c980373d7f84590337e18f225b89c''
Update ROOT\app\Controller\AppController.php

The file app\database.php has been modified with a "namespace app\Config" even though there are errors!
I have stopped here... since I have been here several times before and cannot find a solution. In past attempts, I never end up with the new \src\Controllers or most of the other folders created as expected. Sorry, but here I am and really need some help to proceed.

Proceeded with next command, as listed on this site... rename_classes had more errors much like namespaces above.

Then rename_classes get the following error:

Parse error: syntax error, unexpected '$class' (T_VARIABLE), expecting identifier (T_STRING) or function (T_FUNCTION) or const (T_CONST) or \\ (T_NS_SEPARATOR) in E:\ezshoot.git\src\Shell\Task\AppUsesTask.php on line 17

I'm done! If I'm forced to re-bake and organized the old code... cakePHP 3.0 will NOT be used!

I am willing to supply the backups and output files, but only to the developers of the upgrade tool.

Thanks in advance for any assistance,
GLK

Automatically replace names in links and urls.

Stuff like

return $this->redirect(array('controller' => 'users', 'action' => 'index')); // now: Users

and

$this->Html->link(..., array('plugin' => 'my_plugin', 'controller' => 'users', 'action' => 'index'))

could automatically be replaced with their CamelCase version for plugin, controller, etc.

It is quite the tedious work without automation.

Command line unable to access file

I installed composer, I made this:

cd /path/to/upgrade
bin/cake upgrade all /home/mark/Sites/my-app
Then I get tons of error like this in windows command shell.

error: Could not access ''C:\mydir\upgrade\tmp\upgrade\a2d4223f62e3499a84b6ca30be24bfdb4cb6de40'' Update C:\mydir\myapp\lib\Cake\View\Helper\CacheHelper.php error: Could not access ''C:\mydir\upgrade\tmp\upgrade\7fbe7651712387f351b1eb670b14c18e1161fcb8'' Update C:\mydir\myapp\lib\Cake\View\Helper\HtmlHelper.php error: Could not access ''C:\mydir\upgrade\tmp\upgrade\2301f9bed1167ddb29ca4e06706d0d21bd015766'' Update C:\mydir\myapp\lib\Cake\View\Helper\NumberHelper.php error: Could not access ''C:\mydir\upgrade\tmp\upgrade\e71af0cbc7df7ff76e801c5fb06ec07ee7f45233'' Update C:\mydir\myapp\lib\Cake\View\Helper\PaginatorHelper.php error: Could not access ''C:\mydir\upgrade\tmp\upgrade\1b04b5a763ca4e798d1e176111e49008b7486724'' Update C:\mydir\myapp\lib\Cake\View\Helper\TextHelper.php error: Could not access ''C:\mydir\upgrade\tmp\upgrade\f8ead667c131610c1f70f38d10c7122b34d9a7fc'' Update C:\mydir\myapp\lib\Cake\View\Helper\TimeHelper.php error: Could not access ''C:\mydir\upgrade\tmp\upgrade\4a2c2e7f3f7e9faf744d10e6e1f3ff24bead7f08'' Update C:\mydir\myapp\lib\Cake\View\HelperCollection.php

I run command shell as administrator. What would be the problem ?

When I check folder during operation, I can see that temporary file exists in folder.

Closing directory separator is needed for the `locations` task to work properly

When passing a path to the shell that has no closing directory separator, like

upgrade locations my/path

the relative path extracted in LocationsTask::_relativeFromRoot() will start with a leading separator when the root is being stripped from it

$relativePath = substr($split[0], strlen($root));

wich will finally result in a path fragment with double leading separators trying to be replaced in

$new = str_replace(DS . $from . DS, DS . $to . DS, $new);

causing nothing to be replaced, and thus no files being moved.

Bug with reordnering of App::uses()

The use statement reordering graps all (inline) use statements to reorder them on the top.
So far so good.
But the regexp needs to have a negative lookahead or sth similar to prevent Traits of being moved to the top:

class SomeHelper {

    use SomeTrait;

}

This trait would need to stay there as it is, and not be affected by the run.

blank page after upgrade to 3.0 from 2.5.5

Hi,

I am getting a blank page in localhost after upgrading cakephp from 2.5.5 to 3.0 by using the upgrade tool.

I have checked all prerequisites (PHP 7.0 + mbstring and intl extension are present).

Thanks for your help.

Error when updating 2x to 3x

After installing the dependencies with composer I use the command upgrade all and I get the following:

is not in the implicit class map

Fatal error: Class 'PHPUnit\Framework\TestCase' not found in C:\wamp64\www\upgrade\vendor\cakephp\cakephp\src\TestSuite\TestCase.php on line 32

what can I do for this error?

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.