I'm upgrading a CakePHP 3 app to CakePHP 4, and following the Upgrade Guide.
However, the bin/cake upgrade rector --rules phpunit80 <path/to/app/tests>
tool hangs.
A little background, my app was made mostly in CakePHP 3.6. I upgraded it to 3.7, then 3.8, then 3.9 and made sure everything as working (no deprecation warnings) before attempting the upgrade to 4.
I'm following the CakePHP 4.0 upgrade guide. All steps are successful up to "Applying Rector Refactorings".
When I run this:
PS C:\xampp\htdocs\my_app\upgrade> bin/cake upgrade rector --rules phpunit80 C:\xampp\htdocs\my_app\tests
I get this result:
Rector v0.7.26
Then,
0/189 [>---------------------------] 0%
And it just hangs there (about 1 hour already).
Is there any advice on how to solve this?
Thanks! D.
Well, I sort of figured out a solution to the problem. Here it how I got Rector to work.
Class Cake\Composer\Installer\PluginInstaller is not autoloadable, can not call post-autoload-dump script
, I deleted my app\vendor folder, then rancomposer update
, and that seemed to fix that. Did not get that error up to here.composer install --no-dev
, again got the messageClass Cake\Composer\Installer\PluginInstaller is not autoloadable, can not call post-autoload-dump script
.bin/cake upgrade file_rename locales <path/to/app>
. No issues.Ran bin/cake upgrade file_rename templates <path/to/app>
. OK, no issues.config/app.php
to beApp=> paths => templates from 'templates' => [APP . 'Template' . DS], to 'templates' => [ROOT . DS . 'Template' . DS]
, (also did locales).bin/cake upgrade rector --rules phpunit80 <path/to/app/tests>
and now got results. It seemed to do all the updates, and output some errors, but I decided to go forward.bin/cake upgrade rector --rules cakephp40 <path/to/app/src>
, and now it seems to work. It shows the number of files updated, lots of progress bars, etc. It started outputting changes made in my controllers (in alphabetical order) but then it hangs after the first several controllers. However, looking into my src folders, I can see that all the controllers, models, etc are updated (last modified date is just now).composer require --update-with-dependencies "phpunit/phpunit:^8.0"
. Completes and looks OK.composer require --update-with-dependencies "cakephp/cakephp:4.0.
LOTS of dependancy issues here. I took some alternate steps and got everything updated (actually copied the composer.json from here). That seemed to fix the dependency problems, but there are still myriad issues with the upgraded app.I'm not going further here as this info above addresses the original question, and I have yet to complete a clean upgrade. Ultimately, I am leaning towards starting a fresh, clean app installation and rebuilding my app, copying and fixing code from the refactored files (like dype mentioned above).
Anyway, thanks for your replies. Have a good one, D.