stanley-king 4 лет назад
Родитель
Сommit
3bcc2576eb
5 измененных файлов с 15 добавлено и 6 удалено
  1. 1 1
      helper/fcgisrv/BaseServer.php
  2. 10 0
      helper/fcgisrv/RAccServer.php
  3. 0 3
      racc/control/refill.php
  4. 2 0
      racc/racc.php
  5. 2 2
      test/TestAccRefill.php

+ 1 - 1
helper/fcgisrv/BaseServer.php

@@ -27,7 +27,7 @@ abstract class BaseServer
 
     protected function is_exclude($file)
     {
-        $path = BASE_ROOT_PATH . '/mobile/';
+        $path = BASE_ROOT_PATH . "/" . $this->mSubPath;
         $file = str_replace($path,'',$file);
         return in_array($file,$this->mExFiles);
     }

+ 10 - 0
helper/fcgisrv/RAccServer.php

@@ -26,6 +26,16 @@ class RAccServer extends BaseServer
         parent::__construct($subPath);
     }
 
+    static private $stInstance = NULL;
+    static public function instance()
+    {
+        if(self::$stInstance == NULL) {
+            self::$stInstance = new RAccServer('racc');
+
+        }
+        return self::$stInstance;
+    }
+
 
     function handle_req($file)
     {

+ 0 - 3
racc/control/refill.php

@@ -1,8 +1,5 @@
 <?php
 
-use refill\CalcMerchantPrice;
-
-require_once(BASE_ROOT_PATH .   '/mobile/control/merchant.php');
 require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
 require_once(BASE_HELPER_PATH . '/mtopcard/mtopcard.php');
 require_once(BASE_HELPER_PATH . '/model/member_info.php');

+ 2 - 0
racc/racc.php

@@ -37,6 +37,8 @@ require_once(BASE_ROOT_PATH . '/helper/url_helper.php');
 require_once(BASE_ROOT_PATH . '/helper/activity_helper.php');
 require_once(BASE_HELPER_PATH . '/fcgisrv/RAccServer.php');
 
+use fcgisrv;
+
 
 function all_channels() {
     return ['ch_index','activity','goods','refill'];

+ 2 - 2
test/TestAccRefill.php

@@ -35,7 +35,7 @@ class TestAccRefill extends TestCase
             $this->mMchid = 1;
             $this->mKey = '1ff02223b771c0414468c8892151c602';
         } else {
-            $this->mReqHost = 'https://www.xyzshops.cn';
+            $this->mReqHost = 'http://121.89.212.167';
             $this->mMchid = 1092;
             $this->mKey = '210fe406954220f56085997d6a4c5b80';
         }
@@ -283,7 +283,7 @@ class TestAccRefill extends TestCase
 
     public function testAddoil()
     {
-        $url = $this->mReqHost . "/mobile/index.php";
+        $url = $this->mReqHost . "/racc/index.php";
         $notifyurl = 'https://www.xyzshops.cn/mobile/signature.php';
         $params = ['mchid' => $this->mMchid,
             'cardno' => '1000111100020445281',