Ignore:
Timestamp:
2012/04/11 02:58:27 (15 years ago)
Author:
Seasoft
Message:

#1613 (typo修正・ソース整形・ソースコメントの改善)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/api/SC_Api_Operation.php

    r21722 r21734  
    9898    protected function checkReferer() { 
    9999        $ret = false; 
    100         if(!SC_Utils_Ex::isBlank($_SERVER['HTTP_REFERER'])) { 
     100        if (!SC_Utils_Ex::isBlank($_SERVER['HTTP_REFERER'])) { 
    101101            $domain  = SC_Utils_Ex::sfIsHTTPS() ? HTTPS_URL : HTTP_URL; 
    102102            $pattern = sprintf('|^%s.*|', $domain); 
    … …  
    144144        // Refer: https://images-na.ssl-images-amazon.com/images/G/09/associates/paapi/dg/index.html?Query_QueryAuth.html 
    145145        $check_str = ''; 
    146         foreach($arrParam as $key => $val) { 
     146        foreach ($arrParam as $key => $val) { 
    147147            switch ($key) { 
    148148                case 'Signature': 
    … …  
    159159                     . $check_str; 
    160160        $signature = base64_encode(hash_hmac('sha256', $check_str, $secret_key, true)); 
    161         if($signature === $arrParam['Signature']) { 
     161        if ($signature === $arrParam['Signature']) { 
    162162            return true; 
    163163        } 
    … …  
    206206            return false; 
    207207        } 
    208         $arrAuthTypes = explode("|", $arrApiConfig['auth_types']); 
     208        $arrAuthTypes = explode('|', $arrApiConfig['auth_types']); 
    209209        $result = false; 
    210210        foreach ($arrAuthTypes as $auth_type) { 
    … …  
    249249                    break; 
    250250            } 
    251             if($ret === true) { 
     251            if ($ret === true) { 
    252252                $result = true; 
    253             }else{ 
     253            } else { 
    254254                $result = false; 
    255255                break;  // 1つでもfalseがあれば,その時点で終了 
    … …  
    277277     * 
    278278     * @param array $arrPost リクエストパラメーター 
    279      * @return array( string レスポンス名, array レスポンス配列 ) 
     279     * @return array(string レスポンス名, array レスポンス配列) 
    280280     */ 
    281281    public function doApiAction($arrPost) { 
    … …  
    313313 
    314314                    // オペレーション結果処理 
    315                     if($operation_result) { 
     315                    if ($operation_result) { 
    316316                        $arrOperationRequestValid = $objApiOperation->getRequestValidate(); 
    317317                        $arrResponseBody =  $objApiOperation->getResponseArray(); 
    318318                        $response_group_name = $objApiOperation->getResponseGroupName(); 
    319                     }else{ 
     319                    } else { 
    320320                        $arrErr = $objApiOperation->getErrorArray(); 
    321321                    } 
    322                 }else{ 
     322                } else { 
    323323                    $arrErr['ECCUBE.Operation.NoLoad'] = 'オペレーションをロード出来ませんでした。'; 
    324324                } 
    325             }else{ 
     325            } else { 
    326326                $arrErr['ECCUBE.Authority.NoAuthority'] = 'オペレーションの実行権限がありません。'; 
    327327            } 
    … …  
    330330        if (count($arrErr) == 0) { 
    331331            // 実行成功 
    332             $arrResponseValidSection = array( 'Request' => array( 
     332            $arrResponseValidSection = array('Request' => array( 
    333333                                                            'IsValid' => 'True', 
    334334                                                            $operation_name . 'Request' => $arrOperationRequestValid 
    … …  
    343343                $arrResponseErrorSection[] = array('Code' => $error_code, 'Message' => $error_msg); 
    344344            } 
    345             $arrResponseValidSection = array( 'Request' => array( 
     345            $arrResponseValidSection = array('Request' => array( 
    346346                                                            'IsValid' => 'False', 
    347347                                                            'Errors' => array('Error' => $arrResponseErrorSection) 
    … …  
    350350            if (is_object($objApiOperation)) { 
    351351                $response_outer = $operation_name . 'Response'; 
    352             }else{ 
     352            } else { 
    353353                $response_outer = 'ECCUBEApiCommonResponse'; 
    354354            } 
    … …  
    381381                'Arguments' => array(), 
    382382                ); 
    383         foreach($arrParam as $key => $val) { 
     383        foreach ($arrParam as $key => $val) { 
    384384            $arrRet['Arguments'][] = array('_attributes' => array('Name' => htmlentities($key, ENT_NOQUOTES, 'UTF-8'), 'Value' => htmlentities($val, ENT_NOQUOTES, 'UTF-8'))); 
    385385        } 
    … …  
    390390    // TODO: ここらへんは SC_Displayに持って行きたい所だが・・ 
    391391    public function sendApiResponse($type, $response_outer_name, &$arrResponse) { 
    392         switch($type) { 
     392        switch ($type) { 
    393393            case 'xml': 
    394394                SC_Api_Utils_Ex::sendResponseXml($response_outer_name, $arrResponse); 
Note: See TracChangeset for help on using the changeset viewer.