[Svn-src-all:2690] [version-2_12-dev 21589] #1633 (エラーハンドリングの改善)

Seasoft admin @ mail.ec-cube.net
2012年 3月 4日 (日) 22:25:28 JST


Subversion committed to /home/svn/open 21589
http://svn.ec-cube.net/open_trac/changeset/21589
┌────────────────────────────┐
│更新者 :  Seasoft                                      │
│更新日時:  2012-03-04 22:25:28 +0900 (日, 04  3月 2012)│
└────────────────────────────┘

Log:
--------------------------------------------------------
#1633 (エラーハンドリングの改善)
#1613 (typo修正・ソース整形・ソースコメントの改善)

Changed:                      [U:修正,A:追加,D:削除]
--------------------------------------------------------
U   branches/version-2_12-dev/data/class/SC_Query.php
U   branches/version-2_12-dev/data/class/SC_View.php
U   branches/version-2_12-dev/data/class/helper/SC_Helper_Purchase.php
U   branches/version-2_12-dev/data/class/util/GC_Utils.php

変更: branches/version-2_12-dev/data/class/SC_Query.php
===================================================================
--- branches/version-2_12-dev/data/class/SC_Query.php	2012-03-04 13:16:24 UTC (rev 21588)
+++ branches/version-2_12-dev/data/class/SC_Query.php	2012-03-04 13:25:28 UTC (rev 21589)
@@ -1081,7 +1081,7 @@
             $msg .= 'PlaceHolder: ' . var_export($arrVal, true) . "\n";
         }
 
-        $msg .= 'execution time: ' . sprintf("%.2f sec", $timeExecTime) . "\n";
+        $msg .= 'execution time: ' . sprintf('%.2f sec', $timeExecTime) . "\n";
         GC_Utils_Ex::gfPrintLog($msg, DB_LOG_REALFILE);
     }
 }

変更: branches/version-2_12-dev/data/class/SC_View.php
===================================================================
--- branches/version-2_12-dev/data/class/SC_View.php	2012-03-04 13:16:24 UTC (rev 21588)
+++ branches/version-2_12-dev/data/class/SC_View.php	2012-03-04 13:25:28 UTC (rev 21589)
@@ -56,7 +56,7 @@
         // XXX register_function で登録すると if で使用できないのではないか?
         $this->_smarty->register_function('sfIsHTTPS', array('SC_Utils_Ex', 'sfIsHTTPS'));
         $this->_smarty->register_function('sfSetErrorStyle', array('SC_Utils_Ex', 'sfSetErrorStyle'));
-        $this->_smarty->register_function('printXMLDeclaration', array('SC_Utils_Ex', 'printXMLDeclaration'));
+        $this->_smarty->register_function('printXMLDeclaration', array('GC_Utils_Ex', 'printXMLDeclaration'));
         $this->_smarty->default_modifiers = array('script_escape');
 
         if (ADMIN_MODE == '1') {

変更: branches/version-2_12-dev/data/class/helper/SC_Helper_Purchase.php
===================================================================
--- branches/version-2_12-dev/data/class/helper/SC_Helper_Purchase.php	2012-03-04 13:16:24 UTC (rev 21588)
+++ branches/version-2_12-dev/data/class/helper/SC_Helper_Purchase.php	2012-03-04 13:25:28 UTC (rev 21589)
@@ -78,14 +78,14 @@
 
         $orderTemp['status'] = $orderStatus;
         $cartkey = $objCartSession->getKey();
-        $orderId = $this->registerOrderComplete($orderTemp, $objCartSession, $cartkey);
+        $order_id = $this->registerOrderComplete($orderTemp, $objCartSession, $cartkey);
         $isMultiple = SC_Helper_Purchase::isMultiple();
         $shippingTemp =& $this->getShippingTemp($isMultiple);
         foreach ($shippingTemp as $shippingId => $val) {
-            $this->registerShipmentItem($orderId, $shippingId, $val['shipment_item']);
+            $this->registerShipmentItem($order_id, $shippingId, $val['shipment_item']);
         }
 
-        $this->registerShipping($orderId, $shippingTemp);
+        $this->registerShipping($order_id, $shippingTemp);
         $objQuery->commit();
 
         //会員情報の最終購入日、購入合計を更新
@@ -93,10 +93,9 @@
             SC_Customer_Ex::updateOrderSummary($customerId);
         }
 
-        $this->cleanupSession($orderId, $objCartSession, $objCustomer, $cartkey);
+        $this->cleanupSession($order_id, $objCartSession, $objCustomer, $cartkey);
 
-        GC_Utils_Ex::gfFrontLog('order complete. customerId=' . $customerId);
-
+        GC_Utils_Ex::gfPrintLog('order complete. order_id=' . $order_id);
     }
 
     /**
@@ -515,7 +514,7 @@
      */
     function extractShipping($arrSrc) {
         $arrKey = array();
-        foreach($this->arrShippingKey as $key) {
+        foreach ($this->arrShippingKey as $key) {
             $arrKey[] = 'shipping_' . $key;
         }
         return SC_Utils_Ex::sfArrayIntersectKeys($arrSrc, $arrKey);

変更: branches/version-2_12-dev/data/class/util/GC_Utils.php
===================================================================
--- branches/version-2_12-dev/data/class/util/GC_Utils.php	2012-03-04 13:16:24 UTC (rev 21588)
+++ branches/version-2_12-dev/data/class/util/GC_Utils.php	2012-03-04 13:25:28 UTC (rev 21589)
@@ -105,7 +105,7 @@
                 break 1;
             }
             if (($arrLine['class'] === 'GC_Utils' || $arrLine['class'] === 'GC_Utils_Ex')
-                && $arrLine['function'] === 'gfDebugLog'
+                && ($arrLine['function'] === 'gfDebugLog' || $arrLine['function'] === 'gfPrintLog')
             ) {
                 break 1;
             }
@@ -388,4 +388,18 @@
     function isInstallFunction() {
         return defined('INSTALL_FUNCTION') && INSTALL_FUNCTION === true;
     }
+
+    /**
+     * XML宣言を出力する.
+     *
+     * XML宣言があると問題が発生する UA は出力しない.
+     *
+     * @return string XML宣言の文字列
+     */
+    function printXMLDeclaration() {
+        $ua = $_SERVER['HTTP_USER_AGENT'];
+        if (!preg_match('/MSIE/', $ua) || preg_match('/MSIE 7/', $ua)) {
+            echo '<?xml version="1.0" encoding="' . CHAR_CODE . '"?>' . "\n";
+        }
+    }
 }




Svn-src-all メーリングリストの案内