Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display the installed Zend Framework version on the command line?

I have a ZF2 based upon the ZF2 Skeleton. How can I find out, which ZF2 version is currently being used?

like image 654
automatix Avatar asked Apr 17 '13 15:04

automatix


People also ask

How do I know what version of Zend Framework I have?

echo Zend_Version::VERSION; Which will result in something like this: 1.10. 8.

Which command is used to install Zend Framework 2?

Go to https://github.com/zendframework/ZendSkeletonApplication and click the “Zip” button. This will download a file with a name like ZendSkeletonApplication-master. zip or similar. Unzip this file into the directory where you keep all your vhosts and rename the resultant directory to zf2-tutorial.


3 Answers

As per zend framework official site, version can be retrieved with command

echo Zend_Version::getLatest();

So, to access PHP in Terminal run

php -a

then

echo "Zend engine version: " . zend_version();

and press enter button to get the version information something like

Zend engine version: 2.6.0

Or check VERSION value in file Zend/Version.php if your project is using some specific version of zend framework.

like image 158
zeeawan Avatar answered Sep 28 '22 00:09

zeeawan


With the Composer's show command in the root directory of the (ZF2 Skeleton based) project:

$ cd /path/to/project/
$ php composer show --installed
...
zendframework/zendframework 2.1.4 Zend Framework 2
...
like image 33
automatix Avatar answered Sep 28 '22 01:09

automatix


If for whatever reason you didn't use composer to install ZF2 (come on! what's wrong with you, always use composer :)) you can run your app from the console to check the version:

$ cd <project_root>
$ php public/index.php

This assumes that index.php is your ZF2 front controller.

This will output something like:

Zend Framework 2.1.4 application
Usage:
like image 20
radnan Avatar answered Sep 28 '22 02:09

radnan