Page 1 of 1

How to _reliably_ define Zend presence and its version?

Posted: Sun Nov 30, 2008 2:39 pm
by PaulMM
hi all,

I need to define if users of my script have Zend Optimizer installed at their servers. I'm using
function_exists('zend_optimizer_version')
for that but it doesn't work as a good indicator sometimes. 10% of my users _do_ have Zend Optimizer installed, it is seen in phpinfo and zend-encoded scripts work good at their servers, but they still don't have 'zend_optimizer_version' function so my check doesn't work at their servers. So I need to surely define if people have zend or not. Two questions:

1. Is there any other way to reliably define Zend Optimizer's presence?
2. How can I get the top lines from phpinfo() which indicate zend version? (i want to extract from phpinfo because it looks very reliably for me).

I don't want to check for existence of 'zend_optimizer_version' function because it failed very often on some servers. Any ideas for me? Thanks.

Re: How to _reliably_ define Zend presence and its version?

Posted: Tue Dec 02, 2008 9:27 am
by PaulMM
Anyone?

Re: How to _reliably_ define Zend presence and its version?

Posted: Tue Dec 02, 2008 10:58 am
by Christopher
Have you checked phpinfo() to see how it is reported? It is probably indicated somewhere like $_SERVER["SERVER_SOFTWARE"].

Re: How to _reliably_ define Zend presence and its version?

Posted: Wed Dec 03, 2008 9:32 am
by PaulMM
Unfortunately $_SERVER[SERVER_SOFTWARE] has '=> Apache/2.2.4 (Win32) mod_ssl/2.2.4 OpenSSL/0.9.8d PHP/4.4.7' info which doesn't help as it doesn't have anything related to Zend Optimizer version nor indicates if it is installed.

And yes, I did check phpinfo(). It displays all the info I needed in the first section phpinfo('INFO_GENERAL');
It displays very fine that Zend Optimizer is installed, its version and everything looks cool. But there is a big problem which I cannot solve: there is no possible way to request all the info into the variable from the first section of phpinfo();. In other words, phpinfo() can display the info to the client, but I cannot grab that info programmatically nor use it for my own purposes. I can only display this to a client. :( Any ideas for me?

Re: How to _reliably_ define Zend presence and its version?

Posted: Thu Dec 04, 2008 1:15 pm
by PaulMM
Still need ideas, may anyone know how can I extract the info about ZendOptimizer from the _first_ section of phpinfo();? I tried, but seems there is no such a function for that.
Or does ZendOptimizer has any other functions which I can check or if it works as a module/extension?

Re: How to _reliably_ define Zend presence and its version?

Posted: Thu Dec 04, 2008 1:47 pm
by dude81
Doesnt it print in $GLOBALS

Re: How to _reliably_ define Zend presence and its version?

Posted: Thu Dec 04, 2008 2:14 pm
by PaulMM
Nothing there. I bet there must be something else except "zend_optimizer_version". It can't be the only single function of Zend Optimized, should be something else there. But what?

Re: How to _reliably_ define Zend presence and its version?

Posted: Thu Dec 04, 2008 2:26 pm
by dude81
see what parameters are added in php.ini, when zend optimizer is installed.then you can check through ini_get('whatever_version_parameter_it_wirtes_to_ini')

Re: How to _reliably_ define Zend presence and its version?

Posted: Thu Dec 04, 2008 2:37 pm
by PaulMM
it is loaded to:
zend_extension_ts = "C:\Program Files\Zend\ZendOptimizer-3.2.0\lib\ZendExtensionManager.dll"
[Zend]
zend_extension_manager.optimizer_ts = "C:\Program Files\Zend\ZendOptimizer-3.2.0\lib\Optimizer-3.2.0"

but neither
print_r(ini_get(zend_extension_ts))
nor
print_r(ini_get(nor zend_extension_manager.optimizer_ts))
produce no output.

Re: How to _reliably_ define Zend presence and its version?

Posted: Thu Dec 04, 2008 2:48 pm
by dude81
You should have it quoted

Code: Select all

 
print_r(ini_get('zend_extension_manager.optimizer_ts'));
 

Re: How to _reliably_ define Zend presence and its version?

Posted: Thu Dec 04, 2008 8:35 pm
by PaulMM
Sorry, copy-pasted it wrong. I did type it quoted and both lines produced no output.
print_r(ini_get('zend_extension_ts'));
print_r(ini_get('zend_extension_manager.optimizer_ts'));

Looking for other solutions.

Re: How to _reliably_ define Zend presence and its version?

Posted: Fri Dec 05, 2008 6:13 am
by dude81

Code: Select all

 
print_r(ini_get_all ());
 

Re: How to _reliably_ define Zend presence and its version?

Posted: Fri Dec 05, 2008 6:48 am
by PaulMM
now it has big output, but still nothing related to zend.