How to check Cakephp version from command line?

Mittul At TechnoBrave picture Mittul At TechnoBrave · Sep 21, 2016 · Viewed 11k times · Source

I am using Cakephp 3.x but i want to know the exact version number using command line ? is there any command available which can show us the correct version which we are using in our application ?

i know we can use this echo Configure::version(); to check version using code, i was just curious to know if i can come to know the same thing using command line interface only..

FYI, i have windows 7 as OS, xampp as server with composer and other stuff installed in my cakephp application ..

Command for any OS (ubuntu,windows) will be welcomed to come to know about it ..

Thanks

Answer

Mittul At TechnoBrave picture Mittul At TechnoBrave · Sep 21, 2016

According to their documentation for version 3.x , this is how you can do this. Shells, Tasks & Console Tools

In which they have mentioned to go to directory first using command line tool and then by typing bin/cake Something like this

cd /path/to/app
bin/cake

And in response you will be able to see not only CakePHP's current version but also PHP's current version and few more information.

Welcome to CakePHP v3.0.0 Console
---------------------------------------------------------------
App : App
Path: /Users/markstory/Sites/cakephp-app/src/
---------------------------------------------------------------
Current Paths:

 -app: src
 -root: /Users/markstory/Sites/cakephp-app
 -core: /Users/markstory/Sites/cakephp-app/vendor/cakephp/cakephp

Changing Paths:

Your working path should be the same as your application path. To change your path use the '-app' param.
Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp

Available Shells:

[Bake] bake

[Migrations] migrations

[CORE] i18n, orm_cache, plugin, routes, server

[app] behavior_time, console, orm

To run an app or core command, type cake shell_name [args]
To run a plugin command, type cake Plugin.shell_name [args]
To get help on a specific command, type cake shell_name --help

Also I am not so sure this will work for older version than CakePHP 3.x as I have tried this in version 3.x only.. so please take a note on that too.