manfred |
01-15-2004 10:06 AM |
Automated usage of is_executable
There has been problems with some people to recognize this new parameter usage and therefore I made a script to get rid of that.
It will check OS type and PHP version to determine if is_executable function can be used. Maybe we will see this in next release?
Replace this
PHP Code:
if (USE_IS_EXECUTABLE_COMMAND == 1) {
$is_exec_command_msword = is_executable(PHPDIG_PARSE_MSWORD);
$is_exec_command_msexcel = is_executable(PHPDIG_PARSE_MSEXCEL);
$is_exec_command_pdf = is_executable(PHPDIG_PARSE_PDF);
}
else {
$is_exec_command_msword = 1;
$is_exec_command_msexcel = 1;
$is_exec_command_pdf = 1;
}
with this
PHP Code:
if (preg_match ("/linux/i", $_ENV["OSTYPE"]) OR
preg_match ("/unix/i", $_ENV["OSTYPE"]) OR
phpversion() >= "5.0.0"){
$is_exec_command_msword = is_executable(PHPDIG_PARSE_MSWORD);
$is_exec_command_msexcel = is_executable(PHPDIG_PARSE_MSEXCEL);
$is_exec_command_pdf = is_executable(PHPDIG_PARSE_PDF);
}
else {
$is_exec_command_msword = 1;
$is_exec_command_msexcel = 1;
$is_exec_command_pdf = 1;
}
in robot_functions.php. After that you can delete this key from config.php
PHP Code:
define('USE_IS_EXECUTABLE_COMMAND','0');
This is tested in WinXP only because I don't have any nix machine to test this. Maybe somebody can help with testing.
Cheers
Manfred
|