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/Spellcheck.php

    r258 r273  
    5757     * @return bool TRUE if dependencies are met, FALSE otherwise 
    5858     */ 
    59     static public function checkDependencies(Phergie_Driver_Abstract $client, array$plugins) 
    60     { 
    61         if (!extension_loaded('pspell') || !$client->getIni('spellcheck.lang')) { 
    62             return false; 
    63         } 
    64  
    65         return true; 
     59    static public function checkDependencies(Phergie_Driver_Abstract $client, array $plugins) 
     60    { 
     61        $errors = array(); 
     62 
     63        if (!extension_loaded('pspell')) { 
     64            $errors[] = 'pspell php extension is required'; 
     65        } 
     66        if (!$client->getIni('spellcheck.lang')) { 
     67            $errors[] = 'Ini setting spellcheck.lang must be filled-in'; 
     68        } 
     69 
     70        return empty($errors) ? true : $errors; 
    6671    } 
    6772