Changeset 9951

Show
Ignore:
Timestamp:
11/17/08 08:56:20 (2 months ago)
Author:
afz
Message:

revert every thing to before starting cache stuffs

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/0.8/jaws/html/include/Jaws.php

    r9932 r9951  
    9797        $this->Registry->Init(); 
    9898        $this->InstanceSession(); 
    99         $this->InstanceCache(); 
    10099   
    101100        $this->loadDefaults(); 
  • branches/0.8/jaws/html/include/Jaws/EventShouter.php

    r9907 r9951  
    2222     * @return  boolean True if shouter was added, otherwise returns Jaws_Error 
    2323     */ 
    24     function NewShouter($gadget, $call, $time
     24    function NewShouter($gadget, $call
    2525    { 
    2626        $params = array(); 
    2727        $params['gadget'] = $gadget; 
    2828        $params['call']   = $call; 
    29         $params['time']   = $time; 
    3029 
    3130        $sql = ' 
    3231            INSERT INTO [[shouters]] 
    33                 ([gadget], [event], [event_time]
     32                ([gadget], [event]
    3433            VALUES 
    35                 ({gadget}, {call}, {time})'; 
     34                ({gadget}, {call})'; 
    3635 
    3736        $rs = $GLOBALS['db']->query($sql, $params); 
     
    8180     * @return  boolean True if shouter didn't returned a Jaws_Error, otherwise returns Jaws_Error 
    8281     */ 
    83     function Shout($call, $param, $time = null
     82    function Shout($call, $param
    8483    { 
    85         if (is_null($time) || $time <= time()) { 
    86             $GLOBALS['app']->loadClass('Listener', 'Jaws_EventListener'); 
    87             $res = $GLOBALS['app']->Listener->Listen($call, $param); 
    88         } else { 
    89             $res = $this->NewShouter($param, $call, $time); 
    90         } 
    91  
     84        $GLOBALS['app']->loadClass('Listener', 'Jaws_EventListener'); 
     85        $res = $GLOBALS['app']->Listener->Listen($call, $param); 
    9286        if (Jaws_Error::IsError($res)) { 
    9387            return new Jaws_Error(_t('GLOBAL_ERROR_EVENTS_LISTENER_ERROR'), 'CORE'); 
  • branches/0.8/jaws/html/include/Jaws/Gadget.php

    r9927 r9951  
    543543        $GLOBALS['app']->ACL->deleteCacheFile($gadget); 
    544544 
    545         //remove all cached actions files 
    546         $GLOBALS['app']->Cache->delete($gadget); 
    547  
    548545        // After anything finished 
    549546        $res = $GLOBALS['app']->Shouter->Shout('onAfterUninstallingGadget', $gadget); 
     
    726723        // Commit all the recent core changes 
    727724        $GLOBALS['app']->Registry->Commit('core'); 
    728  
    729         //remove all cached actions files 
    730         $GLOBALS['app']->Cache->delete($gadget); 
    731725 
    732726        // After anything finished 
  • branches/0.8/jaws/html/include/Jaws/Layout.php

    r9925 r9951  
    7878 
    7979    /** 
    80      * Is gadget's action cacheable? 
    81      * @var    boolean 
    82      * @access private 
    83      */ 
    84     var $_IsCurrentActionCacheable = true; 
    85  
    86     /** 
    8780     * Requested gadget's action 
    8881     * 
     
    188181    { 
    189182        return !isset($this->_SectionAttributes['narrow']); 
    190     } 
    191  
    192     /** 
    193      * Is gadget's action cacheable? 
    194      * 
    195      * @access public 
    196      * @return boolean 
    197      */ 
    198     function IsCurrentActionCacheable() 
    199     { 
    200         return $this->_IsCurrentActionCacheable; 
    201     } 
    202  
    203     /** 
    204      * Set is gadget's action cacheable? 
    205      * 
    206      * @access public 
    207      * @return boolean 
    208      */ 
    209     function SetCurrentActionCacheable($state = true) 
    210     { 
    211         $this->_IsCurrentActionCacheable = $state; 
    212183    } 
    213184 
     
    592563            } else { 
    593564                if ($requested === true) { 
    594                     $request =& Jaws_Request::getInstance(); 
    595                     $params = $request->getRawAll('get'); 
    596                     unset($params['gadget'], $params['action']); 
    597                     $output = $GLOBALS['app']->Cache->get($gadget, $action, $params); 
    598                     if (is_null($output)) { 
    599                         $this->SetCurrentActionCacheable(false); 
    600                         $goGadget = $GLOBALS['app']->loadGadget($gadget, 'HTML'); 
    601                         $goGadget->SetAction($action); 
    602                         //$this->_Template->SetVariable('ELEMENT', $goGadget->Execute()); 
    603                         $output = $goGadget->Execute(); 
    604                         if ($this->IsCurrentActionCacheable()) { 
    605                             $GLOBALS['app']->Cache->set($gadget, $action, $params, $output); 
    606                         } 
    607                     } 
     565                    $goGadget = $GLOBALS['app']->loadGadget($gadget, 'HTML'); 
     566                    $goGadget->SetAction($action); 
     567                    //$this->_Template->SetVariable('ELEMENT', $goGadget->Execute()); 
     568                    $output = $goGadget->Execute(); 
    608569                } else { 
    609570                    preg_match_all('/^([a-z0-9]+)\((.*?)\)$/i', $action, $matches); 
     
    614575                    } 
    615576 
    616                     $output = $GLOBALS['app']->Cache->get($gadget, $action, $params); 
    617                     if (is_null($output)) { 
    618                         $this->SetCurrentActionCacheable(false); 
    619                         $goGadget = $GLOBALS['app']->loadGadget($gadget, 'LayoutHTML'); 
    620                         if (!Jaws_Error::isError($goGadget)) { 
    621                             $GLOBALS['app']->Registry->LoadFile($gadget); 
    622                             if (method_exists($goGadget, $action)) { 
    623                                 $output = $goGadget->$action($params); 
    624                                 if ($this->IsCurrentActionCacheable()) { 
    625                                     $GLOBALS['app']->Cache->set($gadget, $action, $params, $output); 
    626                                 } 
    627                             } elseif (isset($GLOBALS['log'])) { 
    628                                 $GLOBALS['log']->Log(JAWS_LOG_ERR, "Action $action in $gadget's LayoutHTML dosn't exist."); 
    629                             } 
    630                         } else { 
    631                             //$this->_Template->SetVariable('ELEMENT', ''); 
    632                             if (isset($GLOBALS['log'])) { 
    633                                 $GLOBALS['log']->Log(JAWS_LOG_ERR, $gadget ." is missing the LayoutHTML. Jaws can't execute Layout " . 
    634                                                      "actions if the file doesn't exists"); 
    635                             } 
     577                    $goGadget = $GLOBALS['app']->loadGadget($gadget, 'LayoutHTML'); 
     578                    if (!Jaws_Error::isError($goGadget)) { 
     579                        $GLOBALS['app']->Registry->LoadFile($gadget); 
     580                        if (method_exists($goGadget, $action)) { 
     581                            $output = $goGadget->$action($params); 
     582                        } elseif (isset($GLOBALS['log'])) { 
     583                            $GLOBALS['log']->Log(JAWS_LOG_ERR, "Action $action in $gadget's LayoutHTML dosn't exist."); 
     584                        } 
     585                    } else { 
     586                        //$this->_Template->SetVariable('ELEMENT', ''); 
     587                        if (isset($GLOBALS['log'])) { 
     588                            $GLOBALS['log']->Log(JAWS_LOG_ERR, $gadget ." is missing the LayoutHTML. Jaws can't execute Layout " . 
     589                                                 "actions if the file doesn't exists"); 
    636590                        } 
    637591                    }