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 #822: #822-trunk-events-donotinclude-unused-modules.2.patch

File #822-trunk-events-donotinclude-unused-modules.2.patch, 1.8 KB (added by bibo, 13 years ago)

updated after laurentj perf comments

  • lib/jelix/events/jEvent.class.php

     
    33* @package     jelix
    44* @subpackage  events
    55* @author      Croes Gérald, Patrice Ferlet
    6 * @contributor Laurent Jouanneau
    7 * @copyright 2001-2005 CopixTeam, 2005-2009 Laurent Jouanneau
     6* @contributor Laurent Jouanneau, Dominique Papin
     7* @copyright 2001-2005 CopixTeam, 2005-2009 Laurent Jouanneau, 2009 Dominique Papin
    88* This classes were get originally from the Copix project
    99* (CopixEvent*, CopixListener* from Copix 2.3dev20050901, http://www.copix.org)
    1010* Some lines of code are copyrighted 2001-2005 CopixTeam (LGPL licence).
     
    150150
    151151    /**
    152152    * because a listener can listen several events, we should
    153     * create only one instancy of a listener for performance, and 
     153    * create only one instancy of a listener for performance, and
    154154    * $hashListened will contains only reference to this listener.
    155155    * @var array of jEventListener
    156156    */
     
    176176        $inf = & $GLOBALS['JELIX_EVENTS'];
    177177        self::$hashListened[$eventName] = array();
    178178        if(isset($inf[$eventName])){
     179            $modules = & $GLOBALS['gJConfig']->_modulesPathList;
    179180            foreach ($inf[$eventName] as $listener){
    180181                list($module,$listenerName) = $listener;
     182                if (! isset($modules[$module]))  // some modules could be unused
     183                    continue;
    181184                if (! isset (self::$listenersSingleton[$module][$listenerName])){
    182185                    require_once ($GLOBALS['gJConfig']->_modulesPathList[$module].'classes/'.$listenerName.'.listener.php');
    183186                    $className = $listenerName.'Listener';