2

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

Mittul At TechnoBrave
  • 1,142
  • 3
  • 25
  • 70
  • 1
    Do you just want to be able to see the version number yourself, or are you looking for something that a script could call to make decisions based on? – Greg Schmidt Sep 21 '16 at 19:23

2 Answers2

8

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.

Mittul At TechnoBrave
  • 1,142
  • 3
  • 25
  • 70
2

Because it doens't show the version when simply typing bin/cake in the project forlder, I also recommend this approach:

  1. Browse to your project forlder
  2. continue browsing to the bin forlder ( cd bin)
  3. then type cake version

That works for me and it shown 3.5.6

Also I recommend including PHP in the system or user path if so you can type php -version anywhere in the prompt to get your php version.

levolutionniste
  • 424
  • 1
  • 6
  • 16