Determining Zend Framework version without version.php file - php

The problem is that I can't find the version.php file on the server within the Zend folder. The developer left so all I got is the source code which are also encrypted. I tried to call echo Zend_Version::VERSION; but Zend said "version.php" is not there. So I am out of means.
So I need to know:
What is the Zend Framework number? ( 1.? or 2.?)
As encrypted as the source code now is from what I see on the server, is it possible for someone to keep developing it? (I know PHP but not Zend Framework.)
Appreciated.

I think you can identify ZF major version by looking at directory structure even files are obfuscated.
ZF 1.12 Directory Structure
ZF 1.12 module Structure
ZF 2.0 Directory Structure

For ZF2 < 2.5 you can go to vendor/zendframework/zendframework/library/Zend/Version/Version.php
For Zf2 >= 2.5 you can go to
vendor/zendframework/zend-version/src/Version.php
And then in this class Version.php you have a constant wich tells you what version do you have (complete form with minor)
For Zf1 I have no clue, since I'm not using it.

For ZF1, you can check via /library/Zend/Version.php

Related

Installed Zend Framework 2.x skeleton program in XAMPP, what's next?

I've just successfully installed the zend framework using XAMPP. The skeleton application works well. What I'm missing is which is the main file I can edit now for future programming?
Is it c:\xampp\apps\myapp\htdocs\public\index.php?
I noticed that when I edit it the homepage actually changes but I'm not 100% sure that it's the right file.
Thanks for the answers!
Cheers
Zend Framework 2 is an MVC framework, it means that models (the objects you will manipulate), the views (the pages that will be displayed) and the controllers (the logic and the links beetwen models and views) are separated. So you will have to edit several files for each actions, plus the glue and the configuration files.
If you don't know what to edit and are not sure of what you do, I strongly suggest you to read and follow the tutorial, wich will help you to learn Zend Framework 2, developping a small application: https://framework.zend.com/manual/2.4/en/user-guide/overview.html
c:\xampp\apps\myapp\htdocs\public\index.php is the file wich will iniialize and start the framework. You should not modify it.

Method "getParam" does not exist and was not trapped in __call()

I have moved my project files to another server, and now i'm getting this in all my pages, it's like i have missed some config, does anyone know what can i do?
I'm using Zend Framework 1.11.11 !
Which informations did you need?
SOLVED! I was using a different framework version! All my code was in 1.12, and i had configured 1.11.

Zend Server CE installation

I've so far been unable to find a working answer for this... And, let me say, I'm brand new to Zend/MVC.
I've installed Zend Server CE on CentOS, running Apache. I'm able to use the Zend GUI interface (with the options like "Monitor, Applications, Server Setup, etc.). PHP is running and executing fine.
All is ok, except when I try to instantiate any Zend Custom Classes. For instance when I try to create a Zend_Rest_Controller class, I receive the following message:
Fatal error: Class 'Zend_Rest_Controller' not found in /mnt/hgfs/API/index.php on line 15
This stays the same for any class I try. I read things about altering the php.ini file, or including the Zend library in the index.php page, but nothing has helped so far.
My question is: What steps in addition to installing Zend do I need to do to let me use the Zend classes?
Sorry if this is an ignorant question, but I appreciate the help.
There are two different products of Zend, which I think you are confusing. There is Zend Server CE (which you just installed). And there is the Zend Framework. As far as I know, Zend Server CE is distributing the Zend Framework with it, but it probably distributes version 2. And, looking at the name of the class you are referring to, that is a class from version 1 of the Zend Framework. Since version 2, the Zend Framework uses namespaces, and thus the class Zend_Rest_Controller does no longer exist. If you want to use version 1 Zend Framework, you will have to install that seperately.

Why Zend Framework has to be configured through include_path

Why do I have to configure an include_path when installing Zend Framework instead of just manually including? I've never done this before and can't really see the point, also I've spent some time trying to figure this out with no luck hence why I ask.
Actually I add Zend framework to the include path to be able to use Zend tool.
If you want to create a project structure and add controllers or models or even scripts using Zend Tool you will have to have Zend framework added to your include path.
Another reason you may want to ship your project without the library itself so that the end user doesn't update the framework version himself and break your code.
Also if you are working on different project at a time you may want to keep only one version of the framework shared between different projects. This is handy when you need to update your version of the framework without going through all projects every time.
You don't have to set your php include_path to include the ZF library you could just copy the whole ZEND directory into your applications Library directory and continue on.
But a lot of us are working on more then one project or don't want to have the library in our application so we add it to the php include_path so php and our application can find it.
Now if you are refering to the windows or linux path, those are required to use the ZF cli components ZF.bat and ZF.sh
When modifying the Include Path you can use Zend Framework without knowing the Full-Path of it. You can simply use require('Zend/Loader/Autoloader.php') and PHP will search in every include path.
For more information have a look at: http://php.net/manual/en/ini.core.php#ini.include-path

How should I extend the Zend Framework as a folder organisation point of view?

I am currently integrating the Zend Framework in my current project named VMM.
I decided to put the Zend Framework directory as a standalone project next to my VMM project in Eclipse.
I need to do some customization of the zend framework (For example I need to add Irradiance.php into Measure) and I would like to know where is the best place to put all my customizations.
I know that I need to follow the Zend Framework naming convention and the same directory structure.
So for example Irradiance.php contain the Mylib_Measure_Irradiance class.
I was thinking to put the Mylib folder into ZendFramework/library/Mylib next to the Zend folder.
Is it the regular way to extend and customize the Zend Framework?
If not, should I put the customizations inside my VMM project or as an other standalone project?
Thanks!
UPDATE
This question helped me but I still need some help...
I tend not to put my own library style files into the ZF folder mainly because when you come to upgrade ZF you'll have to copy them all over to the new ZF.
On my localhost I have something like this
my-project is the project I am working on and contains all the models, views, controllers,etc for that project
/htdocs/my-project/application
/htdocs/my-project/public
library is my own library files and mimics the ZF structure
/htdocs/library/Db/
/htdocs/library/Validate/
I then have my current ZF in /usr/lib/php/ZendFramework-x.xx.x this folder contains the latest ZF and can be changed easily without changing my projects or library code base.
Edit:
David's comments about 'pointers' reminded me, I always set up a sym link in /usr/lib/php/ called ZendLatest, this points to the latest copy of ZF, this means I don't have to keep changing my code or my php.ini.
There are many ressources out there:
http://www.slideshare.net/PHPBelgium/extending-zend-framework-presentation
http://cslai.coolsilon.com/2009/03/28/extending-zend-framework/

Categories