Ignore:
Timestamp:
05/18/12 11:12:43 (12 years ago)
Author:
acoutinho
Message:

Ticket #2758 - Implementacao dos recursos de contatos dinamicos no modelo de rest

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.4-expresso-api/prototype/library/tonic/lib/tonic.php

    r5888 r6230  
    126126     
    127127    /** 
     128     * Body data of incoming request 
     129     * @var array 
     130     */ 
     131    public $dataDecoded; 
     132     
     133    /** 
    128134     * Array of if-match etags 
    129135     * @var str[] 
     
    298304        $this->method = strtoupper($this->getConfig($config, 'method', 'REQUEST_METHOD', $this->method)); 
    299305         
    300         // get HTTP request data 
    301         $this->data = $this->getConfig($config, 'data', NULL, file_get_contents("php://input")); 
    302          
     306        // get HTTP request data 
     307        $this->data = $this->getConfig($config, 'data', NULL, file_get_contents("php://input")); 
     308 
     309        // get HTTP request dataDecode into array 
     310        $this->dataDecoded  = $this->__decodeData( $this->data ); 
     311         
    303312        // conditional requests 
    304313        if ($config['ifMatch']) { 
     
    415424     
    416425    } 
    417      
     426 
     427     /** 
     428     * Convert the string data into a array data 
     429     * @return array 
     430     * @codeCoverageIgnore 
     431     */ 
     432    function __decodeData($data) { 
     433        $arrayData = array(); 
     434        if($data){ 
     435            $arrayIndex = explode('&', $data); 
     436            foreach($arrayIndex as $key => $value){ 
     437                list($i,$val) = explode ('=', $value); 
     438                $arrayData[$i] = $val; 
     439            } 
     440        } 
     441        return $arrayData; 
     442    } 
     443 
    418444    /** 
    419445     * Convert the object into a string suitable for printing 
Note: See TracChangeset for help on using the changeset viewer.