GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — develop ( 3cb0fc...5cf5e7 )
by gyeong-won
11:39
created
modules/autoinstall/autoinstall.admin.model.php 2 patches
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -19,19 +19,19 @@  discard block
 block discarded – undo
19 19
 	function preProcParam(&$order_target, &$order_type, &$page)
20 20
 	{
21 21
 		$order_target_array = array('newest' => 1, 'download' => 1, 'popular' => 1);
22
-		if(!isset($order_target_array[$order_target]))
22
+		if (!isset($order_target_array[$order_target]))
23 23
 		{
24 24
 			$order_target = 'newest';
25 25
 		}
26 26
 
27 27
 		$order_type_array = array('asc' => 1, 'desc' => 1);
28
-		if(!isset($order_type_array[$order_type]))
28
+		if (!isset($order_type_array[$order_type]))
29 29
 		{
30 30
 			$order_type = 'desc';
31 31
 		}
32 32
 
33 33
 		$page = (int) $page;
34
-		if($page < 1)
34
+		if ($page < 1)
35 35
 		{
36 36
 			$page = 1;
37 37
 		}
@@ -63,12 +63,12 @@  discard block
 block discarded – undo
63 63
 
64 64
 		$type_array = array('M' => 1, 'P' => 1);
65 65
 		$type = Context::get('type');
66
-		if(!isset($type_array[$type]))
66
+		if (!isset($type_array[$type]))
67 67
 		{
68 68
 			$type = 'P';
69 69
 		}
70 70
 
71
-		if($type == 'P')
71
+		if ($type == 'P')
72 72
 		{
73 73
 			$category_srl = $this->layout_category_srl;
74 74
 		}
@@ -95,12 +95,12 @@  discard block
 block discarded – undo
95 95
 
96 96
 		$type_array = array('M' => 1, 'P' => 1);
97 97
 		$type = Context::get('type');
98
-		if(!isset($type_array[$type]))
98
+		if (!isset($type_array[$type]))
99 99
 		{
100 100
 			$type = 'P';
101 101
 		}
102 102
 
103
-		if($type == 'P')
103
+		if ($type == 'P')
104 104
 		{
105 105
 			$category_srl = $this->module_skin_category_srl;
106 106
 		}
@@ -118,11 +118,11 @@  discard block
 block discarded – undo
118 118
 	 */
119 119
 	function getPackageList($type, $order_target = 'newest', $order_type = 'desc', $page = '1', $search_keyword = NULL, $category_srl = NULL, $parent_program = NULL)
120 120
 	{
121
-		if($type == 'menu')
121
+		if ($type == 'menu')
122 122
 		{
123 123
 			$params["act"] = "getResourceapiMenuPackageList";
124 124
 		}
125
-		elseif($type == 'skin')
125
+		elseif ($type == 'skin')
126 126
 		{
127 127
 			$params["act"] = "getResourceapiSkinPackageList";
128 128
 			$params['parent_program'] = $parent_program;
@@ -137,18 +137,18 @@  discard block
 block discarded – undo
137 137
 		$params["order_type"] = $order_type;
138 138
 		$params["page"] = $page;
139 139
 
140
-		if($category_srl)
140
+		if ($category_srl)
141 141
 		{
142 142
 			$params["category_srl"] = $category_srl;
143 143
 		}
144 144
 
145
-		if($search_keyword)
145
+		if ($search_keyword)
146 146
 		{
147 147
 			$params["search_keyword"] = $search_keyword;
148 148
 		}
149 149
 
150 150
 		$xmlDoc = XmlGenerater::getXmlDoc($params);
151
-		if($xmlDoc && $xmlDoc->response->packagelist->item)
151
+		if ($xmlDoc && $xmlDoc->response->packagelist->item)
152 152
 		{
153 153
 			$item_list = $oAdminView->rearranges($xmlDoc->response->packagelist->item);
154 154
 			$this->add('item_list', $item_list);
@@ -169,14 +169,14 @@  discard block
 block discarded – undo
169 169
 		
170 170
 		$is_authed = 0;
171 171
 		$output = $oAdminModel->checkUseDirectModuleInstall($package);
172
-		if($output->toBool()==TRUE)
172
+		if ($output->toBool() == TRUE)
173 173
 		{
174 174
 			$is_authed = 1;
175 175
 		}
176 176
 		else
177 177
 		{
178 178
 			$ftp_info = Context::getFTPInfo();
179
-			if(!$ftp_info->ftp_root_path)
179
+			if (!$ftp_info->ftp_root_path)
180 180
 			{
181 181
 				$is_authed = -1;
182 182
 			}
@@ -196,14 +196,14 @@  discard block
 block discarded – undo
196 196
 	{
197 197
 		$oModel = getModel('autoinstall');
198 198
 		$output = executeQueryArray('autoinstall.getNeedUpdate');
199
-		if(!is_array($output->data))
199
+		if (!is_array($output->data))
200 200
 		{
201 201
 			return NULL;
202 202
 		}
203 203
 
204 204
 		$result = array();
205 205
 		$xml = new XmlParser();
206
-		foreach($output->data as $package)
206
+		foreach ($output->data as $package)
207 207
 		{
208 208
 			$packageSrl = $package->package_srl;
209 209
 
@@ -213,27 +213,27 @@  discard block
 block discarded – undo
213 213
 			$packageInfo->type = $oModel->getTypeFromPath($package->path);
214 214
 			$packageInfo->url = $oModel->getUpdateUrlByPackageSrl($package->package_srl);
215 215
 
216
-			if($packageInfo->type == 'core')
216
+			if ($packageInfo->type == 'core')
217 217
 			{
218 218
 				$title = 'XpressEngine';
219 219
 			}
220 220
 			else
221 221
 			{
222 222
 				$configFile = $oModel->getConfigFilePath($packageInfo->type);
223
-				$xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($package->path) . $configFile);
223
+				$xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($package->path).$configFile);
224 224
 
225
-				if($xmlDoc)
225
+				if ($xmlDoc)
226 226
 				{
227 227
 					$type = $packageInfo->type;
228
-					if($type == "drcomponent")
228
+					if ($type == "drcomponent")
229 229
 					{
230 230
 						$type = "component";
231 231
 					}
232
-					if($type == "style" || $type == "m.skin")
232
+					if ($type == "style" || $type == "m.skin")
233 233
 					{
234 234
 						$type = "skin";
235 235
 					}
236
-					if($type == "m.layout")
236
+					if ($type == "m.layout")
237 237
 					{
238 238
 						$type = "layout";
239 239
 					}
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 		$oModel = getModel('autoinstall');
268 268
 
269 269
 		$targetpackages = array();
270
-		if($xmlDoc)
270
+		if ($xmlDoc)
271 271
 		{
272 272
 			$xmlPackage = $xmlDoc->response->package;
273 273
 			$package = new stdClass();
@@ -276,15 +276,15 @@  discard block
 block discarded – undo
276 276
 			$package->package_description = $xmlPackage->package_description->body;
277 277
 			$package->version = $xmlPackage->version->body;
278 278
 			$package->path = $xmlPackage->path->body;
279
-			if($xmlPackage->depends)
279
+			if ($xmlPackage->depends)
280 280
 			{
281
-				if(!is_array($xmlPackage->depends->item))
281
+				if (!is_array($xmlPackage->depends->item))
282 282
 				{
283 283
 					$xmlPackage->depends->item = array($xmlPackage->depends->item);
284 284
 				}
285 285
 
286 286
 				$package->depends = array();
287
-				foreach($xmlPackage->depends->item as $item)
287
+				foreach ($xmlPackage->depends->item as $item)
288 288
 				{
289 289
 					$dep_item = new stdClass();
290 290
 					$dep_item->package_srl = $item->package_srl->body;
@@ -297,23 +297,23 @@  discard block
 block discarded – undo
297 297
 
298 298
 				$packages = $oModel->getInstalledPackages(array_keys($targetpackages));
299 299
 				$package->deplist = "";
300
-				foreach($package->depends as $key => $dep)
300
+				foreach ($package->depends as $key => $dep)
301 301
 				{
302
-					if(!$packages[$dep->package_srl])
302
+					if (!$packages[$dep->package_srl])
303 303
 					{
304 304
 						$package->depends[$key]->installed = FALSE;
305
-						$package->package_srl .= "," . $dep->package_srl;
305
+						$package->package_srl .= ",".$dep->package_srl;
306 306
 					}
307 307
 					else
308 308
 					{
309 309
 						$package->depends[$key]->installed = TRUE;
310 310
 						$package->depends[$key]->cur_version = $packages[$dep->package_srl]->current_version;
311
-						if(version_compare($dep->version, $packages[$dep->package_srl]->current_version, ">"))
311
+						if (version_compare($dep->version, $packages[$dep->package_srl]->current_version, ">"))
312 312
 						{
313 313
 							$package->depends[$key]->need_update = TRUE;
314
-							$package->package_srl .= "," . $dep->package_srl;
314
+							$package->package_srl .= ",".$dep->package_srl;
315 315
 
316
-							if($dep->path === '.')
316
+							if ($dep->path === '.')
317 317
 							{
318 318
 								$package->contain_core = TRUE;
319 319
 								$package->contain_core_version = $dep->version;
@@ -328,14 +328,14 @@  discard block
 block discarded – undo
328 328
 			}
329 329
 
330 330
 			$installedPackage = $oModel->getInstalledPackage($packageSrl);
331
-			if($installedPackage)
331
+			if ($installedPackage)
332 332
 			{
333 333
 				$package->installed = TRUE;
334 334
 				$package->cur_version = $installedPackage->current_version;
335 335
 				$package->need_update = version_compare($package->version, $installedPackage->current_version, ">");
336 336
 			}
337 337
 
338
-			if($package->path === '.')
338
+			if ($package->path === '.')
339 339
 			{
340 340
 				$package->contain_core = TRUE;
341 341
 				$package->contain_core_version = $package->version;
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 	public function getAutoInstallAdminInstallInfo()
352 352
 	{
353 353
 		$packageSrl = Context::get('package_srl');
354
-		if(!$packageSrl)
354
+		if (!$packageSrl)
355 355
 		{
356 356
 			return new Object(-1, 'msg_invalid_request');
357 357
 		}
@@ -365,23 +365,23 @@  discard block
 block discarded – undo
365 365
 		$directModuleInstall = TRUE;
366 366
 		$arrUnwritableDir = array();
367 367
 		$output = $this->isWritableDir($package->path);
368
-		if($output->toBool()==FALSE)
368
+		if ($output->toBool() == FALSE)
369 369
 		{
370 370
 			$directModuleInstall = FALSE;
371 371
 			$arrUnwritableDir[] = $output->get('path');
372 372
 		}
373 373
 
374
-		foreach($package->depends as $dep)
374
+		foreach ($package->depends as $dep)
375 375
 		{
376 376
 			$output = $this->isWritableDir($dep->path);
377
-			if($output->toBool()==FALSE)
377
+			if ($output->toBool() == FALSE)
378 378
 			{
379 379
 				$directModuleInstall = FALSE;
380 380
 				$arrUnwritableDir[] = $output->get('path');
381 381
 			}
382 382
 		}
383 383
 
384
-		if($directModuleInstall==FALSE)
384
+		if ($directModuleInstall == FALSE)
385 385
 		{
386 386
 			$output = new Object(-1, 'msg_direct_inall_invalid');
387 387
 			$output->add('path', $arrUnwritableDir);
@@ -396,17 +396,17 @@  discard block
 block discarded – undo
396 396
 		$path_list = explode('/', dirname($path));
397 397
 		$real_path = './';
398 398
 
399
-		while($path_list)
399
+		while ($path_list)
400 400
 		{
401
-			$check_path = realpath($real_path . implode('/', $path_list));
402
-			if(FileHandler::isDir($check_path))
401
+			$check_path = realpath($real_path.implode('/', $path_list));
402
+			if (FileHandler::isDir($check_path))
403 403
 			{
404 404
 				break;
405 405
 			}
406 406
 			array_pop($path_list);
407 407
 		}
408 408
 
409
-		if(FileHandler::isWritableDir($check_path)==FALSE)
409
+		if (FileHandler::isWritableDir($check_path) == FALSE)
410 410
 		{
411 411
 			$output = new Object(-1, 'msg_unwritable_directory');
412 412
 			$output->add('path', FileHandler::getRealPath($check_path));
Please login to merge, or discard this patch.
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -71,8 +71,7 @@  discard block
 block discarded – undo
71 71
 		if($type == 'P')
72 72
 		{
73 73
 			$category_srl = $this->layout_category_srl;
74
-		}
75
-		else
74
+		} else
76 75
 		{
77 76
 			$category_srl = $this->mobile_layout_category_srl;
78 77
 		}
@@ -103,8 +102,7 @@  discard block
 block discarded – undo
103 102
 		if($type == 'P')
104 103
 		{
105 104
 			$category_srl = $this->module_skin_category_srl;
106
-		}
107
-		else
105
+		} else
108 106
 		{
109 107
 			$category_srl = $this->module_mobile_skin_category_srl;
110 108
 		}
@@ -121,13 +119,11 @@  discard block
 block discarded – undo
121 119
 		if($type == 'menu')
122 120
 		{
123 121
 			$params["act"] = "getResourceapiMenuPackageList";
124
-		}
125
-		elseif($type == 'skin')
122
+		} elseif($type == 'skin')
126 123
 		{
127 124
 			$params["act"] = "getResourceapiSkinPackageList";
128 125
 			$params['parent_program'] = $parent_program;
129
-		}
130
-		else
126
+		} else
131 127
 		{
132 128
 			$params["act"] = "getResourceapiPackagelist";
133 129
 		}
@@ -172,15 +168,13 @@  discard block
 block discarded – undo
172 168
 		if($output->toBool()==TRUE)
173 169
 		{
174 170
 			$is_authed = 1;
175
-		}
176
-		else
171
+		} else
177 172
 		{
178 173
 			$ftp_info = Context::getFTPInfo();
179 174
 			if(!$ftp_info->ftp_root_path)
180 175
 			{
181 176
 				$is_authed = -1;
182
-			}
183
-			else
177
+			} else
184 178
 			{
185 179
 				$is_authed = (int) isset($_SESSION['ftp_password']);
186 180
 			}
@@ -216,8 +210,7 @@  discard block
 block discarded – undo
216 210
 			if($packageInfo->type == 'core')
217 211
 			{
218 212
 				$title = 'XpressEngine';
219
-			}
220
-			else
213
+			} else
221 214
 			{
222 215
 				$configFile = $oModel->getConfigFilePath($packageInfo->type);
223 216
 				$xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($package->path) . $configFile);
@@ -238,8 +231,7 @@  discard block
 block discarded – undo
238 231
 						$type = "layout";
239 232
 					}
240 233
 					$title = $xmlDoc->{$type}->title->body;
241
-				}
242
-				else
234
+				} else
243 235
 				{
244 236
 					$pathInfo = explode('/', $package->path);
245 237
 					$title = $pathInfo[count($pathInfo) - 1];
@@ -303,8 +295,7 @@  discard block
 block discarded – undo
303 295
 					{
304 296
 						$package->depends[$key]->installed = FALSE;
305 297
 						$package->package_srl .= "," . $dep->package_srl;
306
-					}
307
-					else
298
+					} else
308 299
 					{
309 300
 						$package->depends[$key]->installed = TRUE;
310 301
 						$package->depends[$key]->cur_version = $packages[$dep->package_srl]->current_version;
@@ -318,8 +309,7 @@  discard block
 block discarded – undo
318 309
 								$package->contain_core = TRUE;
319 310
 								$package->contain_core_version = $dep->version;
320 311
 							}
321
-						}
322
-						else
312
+						} else
323 313
 						{
324 314
 							$package->need_update = FALSE;
325 315
 						}
Please login to merge, or discard this patch.