@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | protected function mapWebRoutes() |
| 53 | 53 | { |
| 54 | 54 | Route::middleware('web') |
| 55 | - ->namespace($this->namespace) |
|
| 56 | - ->group(base_path('routes/web.php')); |
|
| 55 | + ->namespace($this->namespace) |
|
| 56 | + ->group(base_path('routes/web.php')); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | protected function mapApiRoutes() |
| 67 | 67 | { |
| 68 | 68 | Route::prefix('api') |
| 69 | - ->middleware('api') |
|
| 70 | - ->namespace($this->namespace) |
|
| 71 | - ->group(base_path('routes/api.php')); |
|
| 69 | + ->middleware('api') |
|
| 70 | + ->namespace($this->namespace) |
|
| 71 | + ->group(base_path('routes/api.php')); |
|
| 72 | 72 | } |
| 73 | 73 | } |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | $statusCode=200; |
| 15 | 15 | } |
| 16 | 16 | $output=[ |
| 17 | - 'ret' => $statusCode, |
|
| 17 | + 'ret' => $statusCode, |
|
| 18 | 18 | 'desc' => is_null($desc) ? self::desc($statusCode) : $desc, |
| 19 | 19 | 'data' => $data |
| 20 | 20 | ]; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $statusCode=1000; |
| 28 | 28 | } |
| 29 | 29 | $output=[ |
| 30 | - 'ret' => $statusCode, |
|
| 30 | + 'ret' => $statusCode, |
|
| 31 | 31 | 'desc' => is_null($desc) ? self::desc($statusCode) : $desc, |
| 32 | 32 | 'data' => $data |
| 33 | 33 | ]; |
@@ -44,9 +44,9 @@ discard block |
||
| 44 | 44 | '451' => "Unavailable For Legal Reasons", |
| 45 | 45 | |
| 46 | 46 | '1000' => "Unspecified Response", /** Under normal condictions those errors shouldn't been displayed to end users |
| 47 | - * unless they attempt to do so, some submissions should be intercepted |
|
| 48 | - * by the frontend before the request sended |
|
| 49 | - */ |
|
| 47 | + * unless they attempt to do so, some submissions should be intercepted |
|
| 48 | + * by the frontend before the request sended |
|
| 49 | + */ |
|
| 50 | 50 | '1001' => "Internal Sever Error", |
| 51 | 51 | '1002' => "Service Currently Unavailable", |
| 52 | 52 | '1003' => "Missing Params", |
@@ -153,7 +153,7 @@ |
||
| 153 | 153 | ->where( |
| 154 | 154 | function ($query) { |
| 155 | 155 | $query->where('public', 1) |
| 156 | - ->where('audit_status', 1); |
|
| 156 | + ->where('audit_status', 1); |
|
| 157 | 157 | } |
| 158 | 158 | ) |
| 159 | 159 | ->orWhere( |
@@ -81,41 +81,41 @@ discard block |
||
| 81 | 81 | }else{ |
| 82 | 82 | $this->pro['title'] = trim(self::find('/<h2 id="problem-name".* - (.*)<\/h2>/sU',$res->body)); |
| 83 | 83 | $temp = $res->body; |
| 84 | - $temp = explode('<tr><td>Time limit:</td><td>', $temp)[1]; |
|
| 85 | - $this->pro['time_limit']=trim(explode('s </td></tr>', $temp)[0]); //as for html arrange |
|
| 84 | + $temp = explode('<tr><td>Time limit:</td><td>', $temp)[1]; |
|
| 85 | + $this->pro['time_limit']=trim(explode('s </td></tr>', $temp)[0]); //as for html arrange |
|
| 86 | 86 | $temp = $res->body; |
| 87 | 87 | $temp = explode('<tr><td>Memory limit:</td><td>', $temp)[1]; |
| 88 | - $this->pro['memory_limit']=trim(explode('MB</td></tr>' , $temp)[0]); |
|
| 88 | + $this->pro['memory_limit']=trim(explode('MB</td></tr>' , $temp)[0]); |
|
| 89 | 89 | $temp = $res->body; |
| 90 | - $temp = explode('<tr><td>Languages:</td><td>', $temp)[1]; |
|
| 91 | - $this->pro['note'] = "Languages Limit:".explode('</td></tr>', $temp)[0]; |
|
| 90 | + $temp = explode('<tr><td>Languages:</td><td>', $temp)[1]; |
|
| 91 | + $this->pro['note'] = "Languages Limit:".explode('</td></tr>', $temp)[0]; |
|
| 92 | 92 | |
| 93 | 93 | if(strpos($res->body, "<tr><td>Resource:</td><td>")!==false) |
| 94 | - { |
|
| 95 | - $temp = $res->body; |
|
| 96 | - $temp = explode('<tr><td>Resource:</td><td>', $temp)[1]; |
|
| 97 | - $this->pro['source'] = strip_tags(explode('</td></tr>', $temp)[0]); |
|
| 98 | - }else { |
|
| 94 | + { |
|
| 95 | + $temp = $res->body; |
|
| 96 | + $temp = explode('<tr><td>Resource:</td><td>', $temp)[1]; |
|
| 97 | + $this->pro['source'] = strip_tags(explode('</td></tr>', $temp)[0]); |
|
| 98 | + }else { |
|
| 99 | 99 | $this->pro['source'] = "SPOJ-".$pid; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | if(strpos($res->body,"No tags")===false) |
| 103 | - { |
|
| 104 | - $temp = $res->body; |
|
| 105 | - $temp = explode('<div id="problem-tags" class="col-lg-12 text-center">', $temp)[1]; |
|
| 106 | - $temp = explode('</div>', $temp)[0]; |
|
| 107 | - $cat = explode('<a href="/problems/tag/', $temp); |
|
| 108 | - for($i = 1;$i < count($cat); $i++) |
|
| 109 | - { |
|
| 110 | - $temp = $cat[$i]; |
|
| 111 | - $temp = explode('">', $temp)[0]; |
|
| 112 | - array_push($cate,$temp); |
|
| 113 | - } |
|
| 114 | - } |
|
| 103 | + { |
|
| 104 | + $temp = $res->body; |
|
| 105 | + $temp = explode('<div id="problem-tags" class="col-lg-12 text-center">', $temp)[1]; |
|
| 106 | + $temp = explode('</div>', $temp)[0]; |
|
| 107 | + $cat = explode('<a href="/problems/tag/', $temp); |
|
| 108 | + for($i = 1;$i < count($cat); $i++) |
|
| 109 | + { |
|
| 110 | + $temp = $cat[$i]; |
|
| 111 | + $temp = explode('">', $temp)[0]; |
|
| 112 | + array_push($cate,$temp); |
|
| 113 | + } |
|
| 114 | + } |
|
| 115 | 115 | |
| 116 | 116 | $temp = $res->body; |
| 117 | - $temp = explode('<div id="problem-body">', $temp)[1]; |
|
| 118 | - $content = explode('<div class="text-center">', $temp)[0]; |
|
| 117 | + $temp = explode('<div id="problem-body">', $temp)[1]; |
|
| 118 | + $content = explode('<div class="text-center">', $temp)[0]; |
|
| 119 | 119 | |
| 120 | 120 | $this->pro['description'] = $this->cacheImage(HtmlDomParser::str_get_html(explode('<h3>Input</h3>', $content)[0], true, true, DEFAULT_TARGET_CHARSET, false)); |
| 121 | 121 | $content = explode('<h3>Input</h3>', $content)[1]; |
@@ -141,11 +141,11 @@ discard block |
||
| 141 | 141 | for($cnt = 1; $cnt < count($problemTable); $cnt++) { |
| 142 | 142 | $problemLink = $problemTable[$cnt]; |
| 143 | 143 | $problemLink = explode('<a href="/problems/', $problemLink)[1]; |
| 144 | - $pid=explode('">', $problemLink)[0]; |
|
| 144 | + $pid=explode('">', $problemLink)[0]; |
|
| 145 | 145 | |
| 146 | 146 | $problemLink = $problemTable[$cnt]; |
| 147 | 147 | $problemLink = explode('See the best solutions.">', $problemLink)[1]; |
| 148 | - $solved_count=explode('</a></td>', $problemLink)[0]; |
|
| 148 | + $solved_count=explode('</a></td>', $problemLink)[0]; |
|
| 149 | 149 | |
| 150 | 150 | $problemLink = $problemTable[$cnt]; |
| 151 | 151 | $index = self::find('/<td align="center">([\s]*?)<\/td>/',$problemLink); |