コード例 #1
0
 /**
  * Initialize this Request.
  *
  * @param      AgaviContext An AgaviContext instance.
  * @param      array        An associative array of initialization parameters.
  *
  * @throws     <b>AgaviInitializationException</b> If an error occurs while
  *                                                 initializing this Request.
  *
  * @author     Veikko Mäkinen <*****@*****.**>
  * @author     David Zülke <*****@*****.**>
  * @since      0.9.0
  */
 public function initialize(AgaviContext $context, array $parameters = array())
 {
     parent::initialize($context, $parameters);
     $rdhc = $this->getParameter('request_data_holder_class');
     $this->setRequestData(new $rdhc(array(constant("{$rdhc}::SOURCE_PARAMETERS") => array(), constant("{$rdhc}::SOURCE_HEADERS") => array())));
     $this->setMethod($this->getParameter('default_method', 'read'));
 }
コード例 #2
0
 /**
  * Initialize this Request.
  *
  * @param      AgaviContext An AgaviContext instance.
  * @param      array        An associative array of initialization parameters.
  *
  * @throws     <b>AgaviInitializationException</b> If an error occurs while
  *                                                 initializing this Request.
  *
  * @author     David Zülke <*****@*****.**>
  * @since      0.11.0
  */
 public function initialize(AgaviContext $context, array $parameters = array())
 {
     parent::initialize($context, $parameters);
     $decoded = (array) xmlrpc_decode_request($this->input, $this->invokedMethod, isset($parameters['encoding']) ? $parameters['encoding'] : 'utf-8');
     $akeys = array_keys($decoded);
     if (count($decoded) == 1 && is_int($key = array_pop($akeys)) && is_array($decoded[$key])) {
         $decoded = $decoded[$key];
     }
     $rdhc = $this->getParameter('request_data_holder_class');
     $rd = new $rdhc(array(constant("{$rdhc}::SOURCE_PARAMETERS") => (array) $decoded));
     if ($this->getParameter('use_module_action_parameters')) {
         $split = explode(':', $this->invokedMethod);
         if (count($split) == 2) {
             $rd->setParameter($this->getParameter('module_accessor'), $split[0]);
             $rd->setParameter($this->getParameter('action_accessor'), $split[1]);
         } else {
             $rd->setParameter($this->getParameter('action_accessor'), $this->invokedMethod);
         }
     }
     $this->setRequestData($rd);
 }