How to _reliably_ define Zend presence and its version?
Moderator: General Moderators
How to _reliably_ define Zend presence and its version?
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.
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.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: How to _reliably_ define Zend presence and its version?
Have you checked phpinfo() to see how it is reported? It is probably indicated somewhere like $_SERVER["SERVER_SOFTWARE"].
(#10850)
Re: How to _reliably_ define Zend presence and its version?
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?
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.
Re: How to _reliably_ define Zend presence and its version?
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?
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?
Doesnt it print in $GLOBALS
Re: How to _reliably_ define Zend presence and its version?
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?
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?
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.
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?
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?
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.
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?
Code: Select all
print_r(ini_get_all ());
Re: How to _reliably_ define Zend presence and its version?
now it has big output, but still nothing related to zend.