Passed
Branch feature/babel (9a8402)
by John
03:52
created
app/Http/Controllers/ContestController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     public function index()
23 23
     {
24 24
         $contestModel=new ContestModel();
25
-        $return_list=$contestModel->list(Auth::check()?Auth::user()->id:0);
25
+        $return_list=$contestModel->list(Auth::check() ?Auth::user()->id : 0);
26 26
         $featured=$contestModel->featured();
27 27
         return view('contest.index', [
28 28
             'page_title'=>"Contest",
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             ];
158 158
         }
159 159
 
160
-        $editor_left_width = $accountModel->getExtraInfo(Auth::user()->id)['editor_left_width'] ?? '40';
160
+        $editor_left_width=$accountModel->getExtraInfo(Auth::user()->id)['editor_left_width'] ?? '40';
161 161
 
162 162
         return view('contest.board.editor', [
163 163
             'page_title'=>"Problem Detail",
Please login to merge, or discard this patch.
app/Http/Controllers/MainController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,11 +56,11 @@
 block discarded – undo
56 56
     public function oldRedirect(Request $request)
57 57
     {
58 58
         $all_data=$request->all();
59
-        $method=isset($all_data["method"])?$all_data["method"]:null;
60
-        $id=isset($all_data["id"])?$all_data["id"]:null;
61
-        if($method=="showdetail" && !is_null($id)){
59
+        $method=isset($all_data["method"]) ? $all_data["method"] : null;
60
+        $id=isset($all_data["id"]) ? $all_data["id"] : null;
61
+        if ($method=="showdetail" && !is_null($id)) {
62 62
             $problemModel=new ProblemModel();
63
-            return ($problemModel->existPCode("NOJ$id"))?Redirect::route('problem_detail', ['pcode' => "NOJ$id"]):Redirect::route('problem_index');
63
+            return ($problemModel->existPCode("NOJ$id")) ?Redirect::route('problem_detail', ['pcode' => "NOJ$id"]) : Redirect::route('problem_index');
64 64
         }
65 65
         return Redirect::route('home');
66 66
     }
Please login to merge, or discard this patch.
app/Console/Commands/upgrade.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,14 +11,14 @@  discard block
 block discarded – undo
11 11
      *
12 12
      * @var string
13 13
      */
14
-    protected $signature = 'upgrade';
14
+    protected $signature='upgrade';
15 15
 
16 16
     /**
17 17
      * The console command description.
18 18
      *
19 19
      * @var string
20 20
      */
21
-    protected $description = 'Upgrade to the Latest of NOJ';
21
+    protected $description='Upgrade to the Latest of NOJ';
22 22
 
23 23
     /**
24 24
      * Create a new command instance.
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      */
38 38
     public function handle()
39 39
     {
40
-        $bar = $this->output->createProgressBar(8);
40
+        $bar=$this->output->createProgressBar(8);
41 41
         $bar->setFormat("%current%/%max% [%bar%] %percent:3s%%\n<info>%message%</info>");
42 42
 
43 43
         $bar->setMessage("Enable Maintenance Mode.");
Please login to merge, or discard this patch.
app/Http/Controllers/Ajax/GroupController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
         $groupModel=new GroupModel();
84 84
         $clearance=$groupModel->judgeClearance($all_data["gid"], Auth::user()->id);
85
-        if ($clearance < 2){
85
+        if ($clearance<2) {
86 86
             return ResponseModel::err(2001);
87 87
         }
88 88
 
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
 
102 102
         $groupModel=new GroupModel();
103 103
         $clearance=$groupModel->judgeClearance($all_data["gid"], Auth::user()->id);
104
-        if ($clearance < 2){
104
+        if ($clearance<2) {
105 105
             return ResponseModel::err(2001);
106 106
         }
107 107
 
108
-        if ($all_data["join_policy"] < 1 || $all_data["join_policy"] > 3){
108
+        if ($all_data["join_policy"]<1 || $all_data["join_policy"]>3) {
109 109
             return ResponseModel::err(1007);
110 110
         }
111 111
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
             'gid' => 'required|integer',
120 120
         ]);
121 121
 
122
-        $all_data = $request->all();
122
+        $all_data=$request->all();
123 123
 
124 124
         if (!empty($request->file('img')) && $request->file('img')->isValid()) {
125 125
             $extension=$request->file('img')->extension();
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
         $groupModel=new GroupModel();
133 133
         $clearance=$groupModel->judgeClearance($all_data["gid"], Auth::user()->id);
134
-        if ($clearance < 2){
134
+        if ($clearance<2) {
135 135
             return ResponseModel::err(2001);
136 136
         }
137 137
 
@@ -169,18 +169,18 @@  discard block
 block discarded – undo
169 169
         $clearance=$groupModel->judgeClearance($all_data["gid"], Auth::user()->id);
170 170
         $target_clearance=$groupModel->judgeClearance($all_data["gid"], $all_data['uid']);
171 171
 
172
-        if($target_clearance == -3){
172
+        if ($target_clearance==-3) {
173 173
             return ResponseModel::err(7004);
174 174
         }
175 175
 
176
-        if($target_clearance >= $clearance || $clearance < 2 || $all_data['permission'] >= $clearance){
176
+        if ($target_clearance>=$clearance || $clearance<2 || $all_data['permission']>=$clearance) {
177 177
             return ResponseModel::err(2001);
178 178
         }
179 179
 
180 180
         $groupModel->changeClearance($all_data['uid'], $all_data["gid"], $all_data['permission']);
181 181
 
182
-        $result_info = $groupModel->userProfile($all_data['uid'],$all_data["gid"]);
183
-        return ResponseModel::success(200,null,$result_info);
182
+        $result_info=$groupModel->userProfile($all_data['uid'], $all_data["gid"]);
183
+        return ResponseModel::success(200, null, $result_info);
184 184
     }
185 185
 
186 186
     public function generateContestAccount(Request $request)
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
         $clearance=$groupModel->judgeClearance($all_data["gid"], Auth::user()->id);
261 261
         $targetClearance=$groupModel->judgeClearance($all_data["gid"], $all_data["uid"]);
262 262
         if ($clearance>1) {
263
-            if($targetClearance!=0) {
263
+            if ($targetClearance!=0) {
264 264
                 return ResponseModel::err(7003);
265 265
             }
266 266
             $groupModel->changeClearance($all_data["uid"], $all_data["gid"], 1);
Please login to merge, or discard this patch.
app/Models/SubmissionModel.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
                                             ->where(['verdict'=>'Waiting'])
413 413
                                             ->get()
414 414
                                             ->all();
415
-        foreach($ret as &$r){
415
+        foreach ($ret as &$r) {
416 416
             $r["ocode"]=DB::table("oj")->where(["oid"=>$r["oid"]])->first()["ocode"];
417 417
         }
418 418
         return $ret;
@@ -430,15 +430,15 @@  discard block
 block discarded – undo
430 430
         if (isset($sub['verdict'])) {
431 431
             $sub["color"]=$this->colorScheme[$sub['verdict']];
432 432
         }
433
-        $result = DB::table($this->tableName)->where(['sid'=>$sid])->update($sub);
434
-
435
-        $contestModel = new ContestModel();
436
-        $submission_info = DB::table($this->tableName) -> where(['sid'=>$sid]) -> get() -> first();
437
-        if ($submission_info['cid'] && $contestModel->isContestRunning($submission_info['cid'])){
438
-            $sub['pid'] = $submission_info['pid'];
439
-            $sub['uid'] = $submission_info['uid'];
440
-            $sub['cid'] = $submission_info['cid'];
441
-            $contestModel->updateContestRankTable($submission_info['cid'],$sub);
433
+        $result=DB::table($this->tableName)->where(['sid'=>$sid])->update($sub);
434
+
435
+        $contestModel=new ContestModel();
436
+        $submission_info=DB::table($this->tableName) -> where(['sid'=>$sid]) -> get() -> first();
437
+        if ($submission_info['cid'] && $contestModel->isContestRunning($submission_info['cid'])) {
438
+            $sub['pid']=$submission_info['pid'];
439
+            $sub['uid']=$submission_info['uid'];
440
+            $sub['cid']=$submission_info['cid'];
441
+            $contestModel->updateContestRankTable($submission_info['cid'], $sub);
442 442
         }
443 443
         return $result;
444 444
     }
@@ -509,15 +509,15 @@  discard block
 block discarded – undo
509 509
             'desc'
510 510
         );
511 511
 
512
-        if($filter["pcode"]){
512
+        if ($filter["pcode"]) {
513 513
             $paginator=$paginator->where(["pcode"=>$filter["pcode"]]);
514 514
         }
515 515
 
516
-        if($filter["result"]){
516
+        if ($filter["result"]) {
517 517
             $paginator=$paginator->where(["verdict"=>$filter["result"]]);
518 518
         }
519 519
 
520
-        if($filter["account"]){
520
+        if ($filter["account"]) {
521 521
             $paginator=$paginator->where(["name"=>$filter["account"]]);
522 522
         }
523 523
 
Please login to merge, or discard this patch.
app/Babel/Judge/Judger.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         $result=$submissionModel->getWaitingSubmission();
30 30
         foreach ($result as $row) {
31 31
             $ocode=$row["ocode"];
32
-            if(!isset($this->judger[$ocode]) || is_null($this->judger[$ocode])) {
32
+            if (!isset($this->judger[$ocode]) || is_null($this->judger[$ocode])) {
33 33
                 $this->judger[$ocode]=self::create($ocode);
34 34
             }
35 35
             $this->judger[$ocode]->judge($row);
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
 
39 39
     public static function create($ocode) {
40 40
         $name=$ocode;
41
-        $className = "App\\Babel\\Extension\\$name\\Judger";
42
-        if(class_exists($className)) {
41
+        $className="App\\Babel\\Extension\\$name\\Judger";
42
+        if (class_exists($className)) {
43 43
             return new $className();
44 44
         } else {
45 45
             return null;
Please login to merge, or discard this patch.
app/Babel/Submit/Submitter.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         ];
36 36
 
37 37
         $submitter=self::create($this->post_data["oj"], $sub, $all_data);
38
-        if(!is_null($submitter)) $submitter->submit();
38
+        if (!is_null($submitter)) $submitter->submit();
39 39
 
40 40
         // insert submission
41 41
 
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
         $submission->updateSubmission($this->post_data["sid"], $sub);
44 44
     }
45 45
 
46
-    public static function create($oj,& $sub, $all_data) {
47
-        $className = "App\\Babel\\Extension\\$oj\\Submitter";
48
-        if(class_exists($className)) {
46
+    public static function create($oj, & $sub, $all_data) {
47
+        $className="App\\Babel\\Extension\\$oj\\Submitter";
48
+        if (class_exists($className)) {
49 49
             return new $className($sub, $all_data);
50 50
         } else {
51 51
             return null;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,9 @@
 block discarded – undo
35 35
         ];
36 36
 
37 37
         $submitter=self::create($this->post_data["oj"], $sub, $all_data);
38
-        if(!is_null($submitter)) $submitter->submit();
38
+        if(!is_null($submitter)) {
39
+            $submitter->submit();
40
+        }
39 41
 
40 42
         // insert submission
41 43
 
Please login to merge, or discard this patch.
app/Babel/Submit/Curl.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@  discard block
 block discarded – undo
12 12
 
13 13
     protected function login($all_data)
14 14
     {
15
-        if(isset($all_data["url"]))    $url = $all_data["url"];       else throw new Exception("url is not exist in all_data");
16
-        if(isset($all_data["data"]))   $data = $all_data["data"];     else throw new Exception("data is not exist in all_data");
17
-        if(isset($all_data["oj"]))     $oj = $all_data["oj"];         else throw new Exception("oj is not exist in all_data");
18
-        if(isset($all_data["ret"]))    $ret = $all_data["ret"];       else $ret = 'false';
19
-        if(isset($all_data["handle"])) $handle = $all_data["handle"]; else $handle = "default";
15
+        if (isset($all_data["url"]))    $url=$all_data["url"]; else throw new Exception("url is not exist in all_data");
16
+        if (isset($all_data["data"]))   $data=$all_data["data"]; else throw new Exception("data is not exist in all_data");
17
+        if (isset($all_data["oj"]))     $oj=$all_data["oj"]; else throw new Exception("oj is not exist in all_data");
18
+        if (isset($all_data["ret"]))    $ret=$all_data["ret"]; else $ret='false';
19
+        if (isset($all_data["handle"])) $handle=$all_data["handle"]; else $handle="default";
20 20
 
21 21
         $datapost=curl_init();
22 22
         $headers=array("Expect:");
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
 
48 48
     protected function grab_page($all_data)
49 49
     {
50
-        if(isset($all_data["site"]))    $site = $all_data["site"];          else throw new Exception("site is not exist in all_data");
51
-        if(isset($all_data["oj"]))      $oj = $all_data["oj"];              else throw new Exception("oj is not exist in all_data");
52
-        if(isset($all_data["headers"])) $headers = $all_data["headers"];    else $headers = [];
53
-        if(isset($all_data["handle"]))  $handle = $all_data["handle"];      else $handle = "default";
50
+        if (isset($all_data["site"]))    $site=$all_data["site"]; else throw new Exception("site is not exist in all_data");
51
+        if (isset($all_data["oj"]))      $oj=$all_data["oj"]; else throw new Exception("oj is not exist in all_data");
52
+        if (isset($all_data["headers"])) $headers=$all_data["headers"]; else $headers=[];
53
+        if (isset($all_data["handle"]))  $handle=$all_data["handle"]; else $handle="default";
54 54
 
55 55
         $ch=curl_init();
56 56
         curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__)."/../Cookies/cacert.pem");
@@ -74,15 +74,15 @@  discard block
 block discarded – undo
74 74
 
75 75
     protected function post_data($all_data)
76 76
     {
77
-        if(isset($all_data["site"]))         $site = $all_data["site"];                 else throw new Exception("site is not exist in all_data");
78
-        if(isset($all_data["data"]))         $data = $all_data["data"];                 else throw new Exception("data is not exist in all_data");
79
-        if(isset($all_data["oj"]))           $oj = $all_data["oj"];                     else throw new Exception("oj is not exist in all_data");
80
-        if(isset($all_data["ret"]))          $ret = $all_data["ret"];                   else $ret = false;
81
-        if(isset($all_data["follow"]))       $follow = $all_data["follow"];             else $follow = true;
82
-        if(isset($all_data["returnHeader"])) $returnHeader = $all_data["returnHeader"]; else $returnHeader = true;
83
-        if(isset($all_data["postJson"]))     $postJson = $all_data["postJson"];         else $postJson = false;
84
-        if(isset($all_data["extraHeaders"])) $extraHeaders = $all_data["extraHeaders"]; else $extraHeaders = [];
85
-        if(isset($all_data["handle"]))       $handle = $all_data["handle"];             else $handle = "default";
77
+        if (isset($all_data["site"]))         $site=$all_data["site"]; else throw new Exception("site is not exist in all_data");
78
+        if (isset($all_data["data"]))         $data=$all_data["data"]; else throw new Exception("data is not exist in all_data");
79
+        if (isset($all_data["oj"]))           $oj=$all_data["oj"]; else throw new Exception("oj is not exist in all_data");
80
+        if (isset($all_data["ret"]))          $ret=$all_data["ret"]; else $ret=false;
81
+        if (isset($all_data["follow"]))       $follow=$all_data["follow"]; else $follow=true;
82
+        if (isset($all_data["returnHeader"])) $returnHeader=$all_data["returnHeader"]; else $returnHeader=true;
83
+        if (isset($all_data["postJson"]))     $postJson=$all_data["postJson"]; else $postJson=false;
84
+        if (isset($all_data["extraHeaders"])) $extraHeaders=$all_data["extraHeaders"]; else $extraHeaders=[];
85
+        if (isset($all_data["handle"]))       $handle=$all_data["handle"]; else $handle="default";
86 86
 
87 87
         $datapost=curl_init();
88 88
         $headers=array("Expect:");
Please login to merge, or discard this patch.
Braces   +90 added lines, -18 removed lines patch added patch discarded remove patch
@@ -12,11 +12,31 @@  discard block
 block discarded – undo
12 12
 
13 13
     protected function login($all_data)
14 14
     {
15
-        if(isset($all_data["url"]))    $url = $all_data["url"];       else throw new Exception("url is not exist in all_data");
16
-        if(isset($all_data["data"]))   $data = $all_data["data"];     else throw new Exception("data is not exist in all_data");
17
-        if(isset($all_data["oj"]))     $oj = $all_data["oj"];         else throw new Exception("oj is not exist in all_data");
18
-        if(isset($all_data["ret"]))    $ret = $all_data["ret"];       else $ret = 'false';
19
-        if(isset($all_data["handle"])) $handle = $all_data["handle"]; else $handle = "default";
15
+        if(isset($all_data["url"])) {
16
+            $url = $all_data["url"];
17
+        } else {
18
+            throw new Exception("url is not exist in all_data");
19
+        }
20
+        if(isset($all_data["data"])) {
21
+            $data = $all_data["data"];
22
+        } else {
23
+            throw new Exception("data is not exist in all_data");
24
+        }
25
+        if(isset($all_data["oj"])) {
26
+            $oj = $all_data["oj"];
27
+        } else {
28
+            throw new Exception("oj is not exist in all_data");
29
+        }
30
+        if(isset($all_data["ret"])) {
31
+            $ret = $all_data["ret"];
32
+        } else {
33
+            $ret = 'false';
34
+        }
35
+        if(isset($all_data["handle"])) {
36
+            $handle = $all_data["handle"];
37
+        } else {
38
+            $handle = "default";
39
+        }
20 40
 
21 41
         $datapost=curl_init();
22 42
         $headers=array("Expect:");
@@ -47,10 +67,26 @@  discard block
 block discarded – undo
47 67
 
48 68
     protected function grab_page($all_data)
49 69
     {
50
-        if(isset($all_data["site"]))    $site = $all_data["site"];          else throw new Exception("site is not exist in all_data");
51
-        if(isset($all_data["oj"]))      $oj = $all_data["oj"];              else throw new Exception("oj is not exist in all_data");
52
-        if(isset($all_data["headers"])) $headers = $all_data["headers"];    else $headers = [];
53
-        if(isset($all_data["handle"]))  $handle = $all_data["handle"];      else $handle = "default";
70
+        if(isset($all_data["site"])) {
71
+            $site = $all_data["site"];
72
+        } else {
73
+            throw new Exception("site is not exist in all_data");
74
+        }
75
+        if(isset($all_data["oj"])) {
76
+            $oj = $all_data["oj"];
77
+        } else {
78
+            throw new Exception("oj is not exist in all_data");
79
+        }
80
+        if(isset($all_data["headers"])) {
81
+            $headers = $all_data["headers"];
82
+        } else {
83
+            $headers = [];
84
+        }
85
+        if(isset($all_data["handle"])) {
86
+            $handle = $all_data["handle"];
87
+        } else {
88
+            $handle = "default";
89
+        }
54 90
 
55 91
         $ch=curl_init();
56 92
         curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__)."/../Cookies/cacert.pem");
@@ -74,15 +110,51 @@  discard block
 block discarded – undo
74 110
 
75 111
     protected function post_data($all_data)
76 112
     {
77
-        if(isset($all_data["site"]))         $site = $all_data["site"];                 else throw new Exception("site is not exist in all_data");
78
-        if(isset($all_data["data"]))         $data = $all_data["data"];                 else throw new Exception("data is not exist in all_data");
79
-        if(isset($all_data["oj"]))           $oj = $all_data["oj"];                     else throw new Exception("oj is not exist in all_data");
80
-        if(isset($all_data["ret"]))          $ret = $all_data["ret"];                   else $ret = false;
81
-        if(isset($all_data["follow"]))       $follow = $all_data["follow"];             else $follow = true;
82
-        if(isset($all_data["returnHeader"])) $returnHeader = $all_data["returnHeader"]; else $returnHeader = true;
83
-        if(isset($all_data["postJson"]))     $postJson = $all_data["postJson"];         else $postJson = false;
84
-        if(isset($all_data["extraHeaders"])) $extraHeaders = $all_data["extraHeaders"]; else $extraHeaders = [];
85
-        if(isset($all_data["handle"]))       $handle = $all_data["handle"];             else $handle = "default";
113
+        if(isset($all_data["site"])) {
114
+            $site = $all_data["site"];
115
+        } else {
116
+            throw new Exception("site is not exist in all_data");
117
+        }
118
+        if(isset($all_data["data"])) {
119
+            $data = $all_data["data"];
120
+        } else {
121
+            throw new Exception("data is not exist in all_data");
122
+        }
123
+        if(isset($all_data["oj"])) {
124
+            $oj = $all_data["oj"];
125
+        } else {
126
+            throw new Exception("oj is not exist in all_data");
127
+        }
128
+        if(isset($all_data["ret"])) {
129
+            $ret = $all_data["ret"];
130
+        } else {
131
+            $ret = false;
132
+        }
133
+        if(isset($all_data["follow"])) {
134
+            $follow = $all_data["follow"];
135
+        } else {
136
+            $follow = true;
137
+        }
138
+        if(isset($all_data["returnHeader"])) {
139
+            $returnHeader = $all_data["returnHeader"];
140
+        } else {
141
+            $returnHeader = true;
142
+        }
143
+        if(isset($all_data["postJson"])) {
144
+            $postJson = $all_data["postJson"];
145
+        } else {
146
+            $postJson = false;
147
+        }
148
+        if(isset($all_data["extraHeaders"])) {
149
+            $extraHeaders = $all_data["extraHeaders"];
150
+        } else {
151
+            $extraHeaders = [];
152
+        }
153
+        if(isset($all_data["handle"])) {
154
+            $handle = $all_data["handle"];
155
+        } else {
156
+            $handle = "default";
157
+        }
86 158
 
87 159
         $datapost=curl_init();
88 160
         $headers=array("Expect:");
Please login to merge, or discard this patch.
app/Babel/Crawl/CrawlerBase.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
 
52 52
     private function _cacheImage($data)
53 53
     {
54
-        if(!isset($data["ori"]) || !isset($data["path"]) || !isset($data["baseurl"]) || !isset($data["space_deli"]) || !isset($data["cookie"])){
54
+        if (!isset($data["ori"]) || !isset($data["path"]) || !isset($data["baseurl"]) || !isset($data["space_deli"]) || !isset($data["cookie"])) {
55 55
             throw new Exception("data is not completely exist in cacheImage");
56 56
         }
57
-        $ori = $data["ori"];
58
-        $path = $data["path"];
59
-        $baseurl = $data["baseurl"];
60
-        $space_deli = $data["space_deli"];
61
-        $cookie = $data["cookie"];
57
+        $ori=$data["ori"];
58
+        $path=$data["path"];
59
+        $baseurl=$data["baseurl"];
60
+        $space_deli=$data["space_deli"];
61
+        $cookie=$data["cookie"];
62 62
 
63 63
         $para["path"]=$path;
64 64
         $para["base"]=$baseurl;
@@ -103,10 +103,10 @@  discard block
 block discarded – undo
103 103
 
104 104
     public function procInfo($data)
105 105
     {
106
-        if(isset($data["path"]))       $path = $data["path"];             else throw new Exception("path is not exist in data");
107
-        if(isset($data["baseurl"]))    $baseurl = $data["baseurl"];       else throw new Exception("baseurl is not exist in data");
108
-        if(isset($data["space_deli"])) $space_deli = $data["space_deli"]; else $space_deli = true;
109
-        if(isset($data["cookie"]))     $cookie = $data["cookie"];         else $cookie = "";
106
+        if (isset($data["path"]))       $path=$data["path"]; else throw new Exception("path is not exist in data");
107
+        if (isset($data["baseurl"]))    $baseurl=$data["baseurl"]; else throw new Exception("baseurl is not exist in data");
108
+        if (isset($data["space_deli"])) $space_deli=$data["space_deli"]; else $space_deli=true;
109
+        if (isset($data["cookie"]))     $cookie=$data["cookie"]; else $cookie="";
110 110
 
111 111
         $this->pro["description"]=$this->_cacheImage($this->pro["description"], $path, $baseurl, $space_deli, $cookie);
112 112
         $this->pro["input"]=$this->_cacheImage($this->pro["input"], $path, $baseurl, $space_deli, $cookie);
Please login to merge, or discard this patch.
Braces   +20 added lines, -4 removed lines patch added patch discarded remove patch
@@ -103,10 +103,26 @@
 block discarded – undo
103 103
 
104 104
     public function procInfo($data)
105 105
     {
106
-        if(isset($data["path"]))       $path = $data["path"];             else throw new Exception("path is not exist in data");
107
-        if(isset($data["baseurl"]))    $baseurl = $data["baseurl"];       else throw new Exception("baseurl is not exist in data");
108
-        if(isset($data["space_deli"])) $space_deli = $data["space_deli"]; else $space_deli = true;
109
-        if(isset($data["cookie"]))     $cookie = $data["cookie"];         else $cookie = "";
106
+        if(isset($data["path"])) {
107
+            $path = $data["path"];
108
+        } else {
109
+            throw new Exception("path is not exist in data");
110
+        }
111
+        if(isset($data["baseurl"])) {
112
+            $baseurl = $data["baseurl"];
113
+        } else {
114
+            throw new Exception("baseurl is not exist in data");
115
+        }
116
+        if(isset($data["space_deli"])) {
117
+            $space_deli = $data["space_deli"];
118
+        } else {
119
+            $space_deli = true;
120
+        }
121
+        if(isset($data["cookie"])) {
122
+            $cookie = $data["cookie"];
123
+        } else {
124
+            $cookie = "";
125
+        }
110 126
 
111 127
         $this->pro["description"]=$this->_cacheImage($this->pro["description"], $path, $baseurl, $space_deli, $cookie);
112 128
         $this->pro["input"]=$this->_cacheImage($this->pro["input"], $path, $baseurl, $space_deli, $cookie);
Please login to merge, or discard this patch.