PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Mod Submissions

Reply
 
Thread Tools
Old 01-15-2004, 10:06 AM   #1
manfred
Orange Mole
 
Join Date: Nov 2003
Posts: 42
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
manfred is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory usage? Dave A How-to Forum 0 01-25-2006 03:50 PM
Call to undefined function: is_executable() switch Troubleshooting 3 03-13-2004 08:13 AM
Fatal error: Call to undefined function: is_executable() lionel.cleran Script Installation 1 03-09-2004 09:30 AM
is_executable & catdoc mbruere External Binaries 1 02-09-2004 08:43 AM
Cron jobs-Automated Updates siliconkibou How-to Forum 1 12-23-2003 06:51 AM


All times are GMT -8. The time now is 10:34 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.