Changeset 751

Show
Ignore:
Timestamp:
09/11/05 23:23:40 (8 years ago)
Author:
fproulx
Message:

2005-09-11 Francois Proulx <francois.proulx@…>

  • Fixed dependency check, found a workaround for the file_exists problem
Location:
trunk/wifidog-auth
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/ChangeLog

    r750 r751  
     12005-09-11 Francois Proulx <francois.proulx@gmail.com> 
     2        * Fixed dependency check, found a workaround for the file_exists problem 
     3         
    142005-09-11 Francois Proulx <francois.proulx@gmail.com> 
    25        * Added dependency check for Phlickr 
  • trunk/wifidog-auth/wifidog/classes/Dependencies.php

    r750 r751  
    3232                $components["ImageGraph"] = array ("name" => "PEAR::Image_Graph", "file" => "Image/Graph.php"); 
    3333                $components["Phlickr"] = array ("name" => "PEAR::Phlickr", "file" => "Phlickr/Api.php"); 
    34  
     34                 
    3535                if (isset ($components[$component])) 
    3636                { 
     37                        // Since file_exists does not take in account the include_path 
     38                        // Explode paths of include path 
     39                        $path_array = explode( PATH_SEPARATOR, get_include_path()); 
    3740                        $component_info = $components[$component]; 
    38                         if (include_once ($component_info["file"])) 
    39                                 return true; 
    40                         else 
    41                         { 
    42                                 $errmsg = $component_info["name"]._(" is not installed"); 
    43                                 return false; 
    44                         } 
     41                         
     42                        // For each path or the include path, check if the file exists 
     43                        foreach($path_array as $path) 
     44                                if (file_exists ($path."/".$component_info["file"])) 
     45                                        return true; 
     46                                         
     47                        // Otherwise, the requirement is not met 
     48                        $errmsg = $component_info["name"]._(" is not installed"); 
     49                        return false; 
    4550                } 
    4651                else