function testFindAllDrivers()
 {
     // non existing dir
     $r = DatabaseDriverManager::findAllDriversInDirectory('invalid');
     $this->assertTrue($r->is(new Error('PARAM_ISNOT_A_DIR', 'invalid')));
     // a file
     $r = DatabaseDriverManager::findAllDriversInDirectory('index.php');
     $this->assertTrue($r->is(new Error('PARAM_ISNOT_A_DIR', 'index.php')));
     // where morgos drivers are located
     $r = DatabaseDriverManager::findAllDriversInDirectory('core/dbdrivers');
     $this->assertFalse(isError($r));
     global $installedDrivers;
     $this->assertEquals($installedDrivers, DatabaseDriverManager::getAllInstalledDrivers());
 }
 function showRequirements($agreed)
 {
     $t =& $this->_pluginAPI->getI18NManager();
     if ($agreed == 'Y') {
         $sm =& $this->_pluginAPI->getSmarty();
         $sm->assign('canRun', true);
         if (version_compare(PHP_VERSION, '4.3', '>=')) {
             $sm->assign('phpError', false);
             $sm->assign('phpMessage', $t->translate('You are running PHP version %1 which is new enough to run MorgOS.', array(PHP_VERSION)));
         } else {
             $sm->assign('phpMessage', $t->translate('You are running PHP version %1 which is too old to run MorgOS, please upgrade to at least %2 .', array(PHP_VERSION, '4.3')));
             $sm->assign('phpError', true);
             $sm->assign('canRun', false);
         }
         $installedDrivers = DatabaseDriverManager::getAllInstalledDrivers();
         if (count($installedDrivers) >= 1) {
             $sm->assign('dbMError', false);
             $sm->assign('dbMMessage', $t->translate('You have at least installed 1 database driver.'));
         } else {
             $sm->assign('canRun', false);
             $sm->assign('dbMError', true);
             $s = '';
             foreach (DatabaseDriverManager::getAllFoundDrivers() as $driver) {
                 if (!empty($s)) {
                     $s .= ', ';
                 }
                 $s .= $driver;
             }
             $sm->assign('dbMMessage', $t->translate('You need to install one supported databasedrivers. Supported databases by MorgOS are: %1.', array($s)));
         }
         if (file_exists('skins_c')) {
             if (is_writable('skins_c')) {
                 $sm->assign('dirsError', false);
                 $sm->assign('dirsMessage', $t->translate('All required dirs are ok.'));
             } else {
                 $sm->assign('canRun', false);
                 $sm->assign('dirsError', true);
                 $sm->assign('dirsMessage', $t->translate('You need to make the dir "skins_c" writable for PHP.'));
             }
         } else {
             $a = @mkdir('skins_c');
             if ($a == false) {
                 $sm->assign('canRun', false);
                 $sm->assign('dirsError', true);
                 $sm->assign('dirsMessage', $t->translate('You need to have a dir skins_c that is writable by PHP.'));
             } else {
                 if (is_writable('skins_c')) {
                     $sm->assign('dirsError', false);
                     $sm->assign('dirsMessage', $t->translate('All required dirs are ok.'));
                 } else {
                     $sm->assign('canRun', false);
                     $sm->assign('dirsError', true);
                     $sm->assign('dirsMessage', $t->translate('You need to make the dir "skins_c" writable for PHP.'));
                 }
             }
         }
         $sm->display('installer/testreqs.tpl');
     } else {
         $aM =& $this->_pluginAPI->getActionManager();
         $aM->executeAction('installerShowLicense', array('language' => 'en'));
     }
 }