Assembla home | Assembla project page
 
Show
Ignore:
Timestamp:
08/01/08 09:58:43 (4 months ago)
Author:
Seldaek
Message:

* Plugins that can't load now return error messages to say why
fixes #35

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Phergie/Plugin/Karma.php

    r265 r273  
    202202     * @return bool TRUE if dependencies are met, FALSE otherwise 
    203203     */ 
    204     public static function checkDependencies(Phergie_Driver_Abstract $client, array$plugins) 
    205     { 
    206         if (!extension_loaded('PDO') || !extension_loaded('pdo_sqlite')) { 
    207             return false; 
    208         } 
    209  
    210         return true; 
     204    public static function checkDependencies(Phergie_Driver_Abstract $client, array $plugins) 
     205    { 
     206        $errors = array(); 
     207 
     208        if (!extension_loaded('PDO')) { 
     209            $errors[] = 'PDO php extension is required'; 
     210        } 
     211        if (!extension_loaded('pdo_sqlite')) { 
     212            $errors[] = 'pdo_sqlite php extension is required'; 
     213        } 
     214 
     215        return empty($errors) ? true : $errors; 
    211216    } 
    212217