Show
Ignore:
Timestamp:
02/04/07 00:36:48 (2 years ago)
Author:
david
Message:

finally: caching. one config file per action, definitions can be specific to one or more request-method, each definition can contain settings specific to one or more output types, groups (like in smarty, multiple sources like string, locale, request param etc), cache TTL ('2 days 4 hours'), caching can be controlled on a per layer level, slots can be included in the cache, action attribs, template vars and request attribs (yes, with namespace) can be restored, restrictable to certain views, closes #78. also did some minor fixes here and there, added slots to sample app.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.11/src/controller/AgaviExecutionContainer.class.php

    r1568 r1635  
    9090   
    9191  /** 
     92   * Pre-serialization callback. 
     93   * 
     94   * Will set the name of the context instead of the instance, and the name of 
     95   * the output type instead of the instance. Both will be restored by __wakeup 
     96   * 
     97   * @author     David Zuelke <dz@bitxtender.com> 
     98   * @since      0.11.0 
     99   */ 
     100  public function __sleep() 
     101  { 
     102    $this->contextName = $this->context->getName(); 
     103    $this->outputTypeName = $this->outputType->getName(); 
     104    $arr = get_object_vars($this); 
     105    unset($arr['context'], $arr['outputType']); 
     106    return array_keys($arr); 
     107  } 
     108   
     109  /** 
     110   * Post-unserialization callback. 
     111   * 
     112   * Will restore the context and output type instances based on their names set 
     113   * by __sleep. 
     114   * 
     115   * @author     David Zuelke <dz@bitxtender.com> 
     116   * @since      0.11.0 
     117   */ 
     118  public function __wakeup() 
     119  { 
     120    $this->context = AgaviContext::getInstance($this->contextName); 
     121    $this->outputType = $this->context->getController()->getOutputType($this->outputTypeName); 
     122    unset($this->contextName, $this->outputTypeName); 
     123  } 
     124   
     125  /** 
    92126   * Initialize the container. This will create a response instance. 
    93127   * 
     
    105139     
    106140    $this->parameters = $parameters; 
    107      
    108     // create a new response instance for this action 
    109     $rfi = $this->context->getFactoryInfo('response'); 
    110     $this->response = new $rfi['class']; 
    111     $this->response->initialize($this->context, $rfi['parameters']); 
    112141  } 
    113142