CakePHP Get Version

To find out current version of CakePHP, we can use following methods:

  • CakePHP 2.x

Open lib/Cake/VERSION.txt file, the version number is at bottom of file.

 

  • CakePHP 3.x

Open vendor/cakephp/cakephp/VERSION.txt file, the version number is at bottom of file.

 

And if you want to get version in code, we can use following code

 

Under the Hood

The Configure class is defined at lib/Cake/Core/Configuration.php file, reading the code we will find it’s actually reading the VERSION.txt file (the file we mentioned above) to find out current version as well.