InstalledValidator Class Reference
[SystemUpdate]
Tools for checking if some third party tools are installed. More...
Public Member Functions |
|
validate_pear_modules_are_installed ($pear_classes) | |
Checks if given PEAR modules are installed.
|
Detailed Description
Tools for checking if some third party tools are installed.
Definition at line 8 of file installedvalidator.cls.php.
Member Function Documentation
InstalledValidator::validate_pear_modules_are_installed | ( | $ | pear_classes | ) |
Checks if given PEAR modules are installed.
- Attention:
- Usually PEAR modules follow the rule that a _ in a class name maps to a directory in the path name. E.g. module "Text_Diff" maps to file Text/Diff.php. Some PEAR modules however do not follow this convention, Mail_Mime for example. This should be reflected by passing "Mail_mime" in $pear_classes
- Parameters:
-
$pear_classes Array of Module names, e.g. "Text_Diff", "Mail_mime" etc
- Returns:
- Status
Definition at line 22 of file installedvalidator.cls.php.
00022 { 00023 $ret = new Status(); 00024 foreach(Arr::force($pear_classes, false) as $cls) { 00025 // A_B_C => A/B/C.php 00026 // There are PEAR modules that do not follow this convention, Mail_Mime, e.g. 00027 // which becomes Mail/mime.php - This should be reflected by passing 00028 // Mail_mime in $pear_classes 00029 $file = str_replace('_', '/', $cls) . '.php'; 00030 @include_once($file); 00031 if ((!class_exists($cls))) { 00032 $ret->append(tr('PEAR module %mod not installed! Please execute "pear install %mod"', 'systemupdate', array('%mod' => $cls))); 00033 } 00034 } 00035 00036 return $ret; 00037 }
The documentation for this class was generated from the following file:
- gyro/modules/systemupdate/lib/components/installedvalidator.cls.php