CakePhp upgrade from 1.3 to 2.0.1 using Shell - cakephp

Can someone tell me the exact steps to follow on how to do this. the documentation on the cakephp site isnt very helpfull.
I have a clean vanilla copy of cake 2.0.1 on d:\cake201.
I have added the console path in this dir to my PATH var
the project is in d:\www\sbm\trunk\
when navigate to d:\www\sbm\trunk\ in command prompt and run cake upgrade all it modifies the d:\www\sbm\trunk\cake folder and files in there have syntax errors.
when i navigate to d:\www\sbm\trunk\app and run cake upgrade all it looks for the d:\www\sbm\trunk\cake\bootstrap.php but in v2 the cake folder is in d:\www\sbm\trunk\lib\cake
please help

I believe you need to have a copy of your App Folder into the D:\cake201 folder. Now navigate to d:\cake201\app and run cake upgrade all
This should do everything for you ! :)
NOTE: Try not to take the config folder with u and edit that manually, this will be much more easier

Related

ugprade cakephp 3 to latest version

i have cakephp3.3 windows and i need to upgrade to cakephp3.6. Checking the docs i see there is no tool available. Checking the migration guides i am not seeing any issues with my code in cake3.3 with newer versions.
Do i simply create a new instance of cake3.6 and create models,controllers again using bake and then copy over code to see if this works? what is an efficient way
The docs in cakephp are not clear on this process. do i upgrade to 3.4 then 3.5,3.6?
https://book.cakephp.org/3.0/en/appendices/3-x-migration-guide.html
Use composer.
For Windows, you can download it from here. After installation, locate composer.json file in your CakePHP application directory, and look for "require" part, and update line regarding CakePHP as follows:
"require": {
"php": ">=5.6",
"cakephp/cakephp": "3.6.*",
....
}
Then, in command line, navigate to your CakePHP installation directory and fire composer update. After a while you should have your CakePHP upgraded.
More info about updating to new version can be found in docs:
Keeping up to date with latest CakePHP changes
Another solution was given which was to install a new instance of cakephp and just copy over scr folder and other relevant code in the new instance. This is more work but the conversion from 3.3 to 3.6 isnt very clean with a composer update

Cannot find the correct root for cake console

I've trying to get the CakePHP console running, reading and watching as many tutorials as I can find but to no avail. I got the latest realese of Cake from their Git, 3.08 in this case, because the composer instalation wasn't working I had to manually configure everyhing and so far so good.
The problem is that I cannot for the life of me find the cake console, much of the tutorial I find make reference to a lib, app or console folder.
The only thing that resembles what I've seen in tutorial is on the bin folder, where a cake.php, cake.bat and cake file reside, there is no console folder there though, no exceptions etc, using the file finder for console turns out like 10 result but none with the cake.bat and these other files together.
I know this must be a very dumb question but what I am doing wrong? I already added the bin folder, PHP and mySQL root to my PATH yet typing cake on the console does nothing, not even a error code.
Adding to path as ;C:\wamp\www\cake\bin
Any help would be great.
You can run it like this:
cd \wamp\www\cake
bin\cake
To try to fix your problem type PATH in your console to see if bake was added.
If you haven't reboot you can run
SET PATH=%PATH%;C:\CmdShortcuts
Or simply reboot and try again after adding it to PATH.
Check this:
Update Windows Path
Install Cakephp Console Windows
This happened to me too, when I started on cakephp, I really pain in the *** , anyway, this is the correct path
C:\wamp\www\cake\lib\Cake\Console;
That keeps working for me .

Cake php migration from 1.3 to 2.0 , cake upgrade all command not working

Hi i follow the migrion guide for cakephp 2.0 from thier site in order to update my site framework from 1.3 to 2.0 , but the command
cake upgrade all
doing nothhing . it dont change the name of any files when i run the command i get the following out put
Welcome to CakePHP v2.0.0 Console
---------------------------------------------------------------
App : Console
Path: C:\xampp\htdocs\cakephp-2.0.0\app\Console\
---------------------------------------------------------------
Running tests
Running locations
Running i18n
Done updating C:\xampp\htdocs\cakephp-2.0.0\app\Console\cake.php
Running helpers
Done updating C:\xampp\htdocs\cakephp-2.0.0\app\Console\cake.php
Running basics
Done updating C:\xampp\htdocs\cakephp-2.0.0\app\Console\cake.php
Running request
Done updating C:\xampp\htdocs\cakephp-2.0.0\app\Console\cake.php
Running configure
Done updating C:\xampp\htdocs\cakephp-2.0.0\app\Console\cake.php
Running constants
Done updating C:\xampp\htdocs\cakephp-2.0.0\app\Console\cake.php
Running components
Done updating C:\xampp\htdocs\cakephp-2.0.0\app\Console\cake.php
NOTE Also when i open cake console i get this out put
Welcome to CakePHP v2.0.0 Console
---------------------------------------------------------------
App : Console
Path: C:\xampp\htdocs\cakephp-2.0.0\app\Console\
---------------------------------------------------------------
Current Paths:
-app: Console
-working: C:\xampp\htdocs\cakephp-2.0.0\app\Console
-root: C:\xampp\htdocs\cakephp-2.0.0\app
-core: C:\xampp\htdocs\cakephp-2.0.0\lib
Changing Paths:
Your working path should be the same as your application path to change your pat
h use the '-app' param.
Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp
Is it be working path issue or i am missing something? Any help will be appreciated.
Thanks to #mark for pointing me in right direction , for future readers
The issue i was in wrong folder . and i was running command like cd Console/cake (the worng way)
RIGHT WAY
Fow linux or mac users after opening your app folder in CMD run the command.
./Console/cake upgrade all
Fow windows users after opening your app folder in CMD run the command.
.\Console\cake upgrade all

Integrate whmcs into my cakephp

I have a cake app and want to integrate my license of whmcs. Whmcs have installed it ina whmcs folder in the public html folder and my cake files are here too. When run example.com/whmcs I get a cakephp error what am I doing wrong?
All help appreciated
Try building a CakePHP component and place your whmsc scripts in the vendor directory.
hope this helps

Cakephp Problems with the bake script

I have apache, php, and Mysql installed on my computer. I have added the PHP directory and C:\Apache\htdocs\cake\cake\console to my environmental variables path. When i load the path to the console on my CLI it loads cake.php then i type cake bake and it asks me for the path of my app, then database config. Now instead o f it loading the DMVC... menu it just returns to set the path and database and its like a loop. not sure what i am doing wrong.
All help appreciated
Thanks
Joe
Try cd'ing to your app's directory, and then run ../cake/console/cake bake
Try editing your path to C:\wamp\bin\php\php5.4.3; (I used the Wamp server, that's why mine is like that).

Resources