developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Ticket #854: ticket854.patch

File ticket854.patch, 3.9 KB (added by laurentj, 12 years ago)

the patch

  • lib/jelix/core/jCoordinator.class.php

     
    44* @subpackage   core
    55* @author       Laurent Jouanneau
    66* @contributor  Thibault PIRONT < nuKs >, Julien Issler, Dominique Papin
    7 * @copyright    2005-2008 laurent Jouanneau
     7* @copyright    2005-2009 laurent Jouanneau
    88* @copyright    2007 Thibault PIRONT
    99* @copyright    2008 Julien Issler
    1010* @copyright    2008 Dominique Papin
     
    110110    private function _loadPlugins(){
    111111        global $gJConfig;
    112112
    113         foreach($gJConfig->coordplugins as $name=>$conf){
    114             if($conf && isset($gJConfig->_pluginsPathList_coord[$name])){
    115                 if($conf=='1'){
    116                     $conf = array();
    117                 }else{
    118                    $conff = $conf;
    119                    if(!file_exists(JELIX_APP_CONFIG_PATH.$conff))
    120                         die("Jelix Error: Error in the main configuration. Configuration file '$conff' for coord plugin $name doesn't exist!");
    121                    if( false === ($conf = parse_ini_file(JELIX_APP_CONFIG_PATH.$conff,true)))
    122                         die("Jelix Error: Error in the configuration file of plugin $name ($conff)!");
    123                 }
    124                 include( $gJConfig->_pluginsPathList_coord[$name].$name.'.coord.php');
    125                 $class= $name.'CoordPlugin';
    126                 $this->plugins[strtolower($name)] = new $class($conf);
     113        foreach ($gJConfig->coordplugins as $name=>$conf) {
     114            // the config compiler has removed all deactivated plugins
     115            // so we don't have to check if the value $conf is empty or not
     116            if ($conf == '1') {
     117                $conf = array();
    127118            }
     119            else {
     120                $conff = JELIX_APP_CONFIG_PATH.$conf;
     121                if (false === ($conf = parse_ini_file($conff,true)))
     122                    die("Jelix Error: Error in the configuration file of plugin $name ($conff)!");
     123            }
     124            include( $gJConfig->_pluginsPathList_coord[$name].$name.'.coord.php');
     125            $class= $name.'CoordPlugin';
     126            $this->plugins[strtolower($name)] = new $class($conf);
    128127        }
    129128    }
    130129
  • lib/jelix/core/jConfigCompiler.class.php

     
    44* @subpackage   core
    55* @author       Jouanneau Laurent
    66* @contributor  Thibault PIRONT < nuKs >, Christophe Thiriot, Philippe Schelté
    7 * @copyright    2006-2008 Jouanneau laurent
     7* @copyright    2006-2009 Jouanneau laurent
    88* @copyright    2007 Thibault PIRONT, 2008 Christophe Thiriot, 2008 Philippe Schelté
    99* @link         http://www.jelix.org
    1010* @licence      GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html
     
    111111
    112112        self::_loadPluginsPathList($config);
    113113
     114        $coordplugins = array();
     115        foreach ($config->coordplugins as $name=>$conf) {
     116            if (!isset($config->_pluginsPathList_coord[$name])) {
     117                die("Jelix Error: Error in the main configuration. The coord plugin $name doesn't exist!");
     118            }
     119            if ($conf) {
     120                if ($conf != '1' && !file_exists(JELIX_APP_CONFIG_PATH.$conf)) {
     121                    die("Jelix Error: Error in the main configuration. Configuration file '$conf' for coord plugin $name doesn't exist!");
     122                }
     123                $coordplugins[$name] = $conf;
     124            }
     125        }
     126        $config->coordplugins = $coordplugins;
     127
    114128        if($config->checkTrustedModules){
    115129            $config->_trustedModules = explode(',',$config->trustedModules);
    116130            if(!in_array('jelix',$config->_trustedModules))