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 — master ( 636838...8041ee )
by gyeong-won
06:25
created
tools/dbxml_validator/validate.php 4 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
  @return
174 174
  @param $xml_file
175 175
  @param $node
176
- @param $child_tag
176
+ @param string $child_tag
177 177
  */
178 178
 function checkDuplicateDescendants($xml_file, $node, $child_tag)
179 179
 {
@@ -199,13 +199,13 @@  discard block
 block discarded – undo
199 199
 	messages.
200 200
  @param $node
201 201
 	The XML node with the children to be checked.
202
- @param $child_tags
202
+ @param string[] $child_tags
203 203
 	Array with tag names for the children elements
204
- @param $attr_tags
204
+ @param string[] $attr_tags
205 205
 	Array with names of attributes to be checked. If multiple attributes
206 206
 	are given, than the first one that is present on a child is included
207 207
 	in the check.
208
- @param $key
208
+ @param boolean $key
209 209
 	True if child elements are required to expose at least one of the 
210 210
 	attribute. False if only the child nodes with some of the
211 211
 	attributes present are to be checked.
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
 	@return
490 490
 	@param $xml_file
491 491
 	@param $container_element
492
-	@param $child_tag
492
+	@param string $child_tag
493 493
 */
494 494
 function checkVarContentsValidation
495 495
 	(
Please login to merge, or discard this patch.
Indentation   +28 added lines, -29 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		@param $line_no
91 91
 		@param $message
92 92
 		@access
93
-	*/
93
+	 */
94 94
 	public function __construct($file, $line_no, $message)
95 95
 	{
96 96
 		parent::__construct("{$file}({$line_no}):\n\t$message");
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	@developer
113 113
 	@return
114 114
 	@access
115
-	*/
115
+	 */
116 116
 	public function __destruct()
117 117
 	{
118 118
 		libxml_clear_errors();
@@ -834,8 +834,7 @@  discard block
 block discarded – undo
834 834
 
835 835
 	@brief
836 836
 	@developer
837
-
838
-	*/
837
+	 */
839 838
 	class RestoreWorkDir
840 839
 	{
841 840
 		protected $dirname;
@@ -845,7 +844,7 @@  discard block
 block discarded – undo
845 844
 			@developer
846 845
 			@return
847 846
 			@access
848
-			*/
847
+		 */
849 848
 		public function __destruct()
850 849
 		{
851 850
 			try
@@ -868,7 +867,7 @@  discard block
 block discarded – undo
868 867
 			@developer
869 868
 			@return
870 869
 			@access
871
-			*/
870
+		 */
872 871
 		public function __construct()
873 872
 		{
874 873
 			$this->dirname = getcwd();
@@ -1113,7 +1112,7 @@  discard block
 block discarded – undo
1113 1112
 		@return
1114 1113
 		@access
1115 1114
 		@param $val
1116
-	*/
1115
+	 */
1117 1116
 	public function code($val = -1)
1118 1117
 	{
1119 1118
 		if($val == -1)
@@ -1135,7 +1134,7 @@  discard block
 block discarded – undo
1135 1134
 		@return
1136 1135
 		@access
1137 1136
 		@param $val
1138
-	*/
1137
+	 */
1139 1138
 	public function push($val)
1140 1139
 	{
1141 1140
 		$this->save = $this->exit_code;
@@ -1147,7 +1146,7 @@  discard block
 block discarded – undo
1147 1146
 		@developer
1148 1147
 		@access
1149 1148
 		@return
1150
-	*/
1149
+	 */
1151 1150
 	public function pop()
1152 1151
 	{
1153 1152
 		$this->exit_code = $this->save;
@@ -1160,7 +1159,7 @@  discard block
 block discarded – undo
1160 1159
 		@return
1161 1160
 		@access
1162 1161
 		@param $val
1163
-	*/
1162
+	 */
1164 1163
 	public function __construct($val = 0)
1165 1164
 	{
1166 1165
 		$this->save = self::RETCODE_VALIDATOR_INTERNAL;
@@ -1181,7 +1180,7 @@  discard block
 block discarded – undo
1181 1180
 		@developer
1182 1181
 		@access
1183 1182
 		@return
1184
-	*/
1183
+	 */
1185 1184
 	public function __destruct()
1186 1185
 	{
1187 1186
 		if($this->file_name)
@@ -1196,7 +1195,7 @@  discard block
 block discarded – undo
1196 1195
 		@access
1197 1196
 		@return
1198 1197
 		@param $file_name
1199
-	*/
1198
+	 */
1200 1199
 	public function __construct($file_name)
1201 1200
 	{
1202 1201
 		$this->file_name = $file_name;
@@ -1439,7 +1438,7 @@  discard block
 block discarded – undo
1439 1438
 
1440 1439
 			@brief
1441 1440
 			@developer
1442
-		*/
1441
+		 */
1443 1442
 		class Context
1444 1443
 		{
1445 1444
 			protected static $db_info = NULL;
@@ -1449,7 +1448,7 @@  discard block
 block discarded – undo
1449 1448
 				@developer
1450 1449
 				@return
1451 1450
 				@access
1452
-			*/
1451
+			 */
1453 1452
 			public static function isInstalled()
1454 1453
 			{
1455 1454
 				return TRUE;
@@ -1460,7 +1459,7 @@  discard block
 block discarded – undo
1460 1459
 				@developer
1461 1460
 				@return
1462 1461
 				@access
1463
-			*/
1462
+			 */
1464 1463
 			public static function getLangType()
1465 1464
 			{
1466 1465
 				return 'en';
@@ -1471,7 +1470,7 @@  discard block
 block discarded – undo
1471 1470
 				@developer
1472 1471
 				@return
1473 1472
 				@access
1474
-			*/
1473
+			 */
1475 1474
 			public static function getLang()
1476 1475
 			{
1477 1476
 				return 'en';
@@ -1482,7 +1481,7 @@  discard block
 block discarded – undo
1482 1481
 				@developer
1483 1482
 				@return
1484 1483
 				@access
1485
-			*/
1484
+			 */
1486 1485
 			public static function getDBType()
1487 1486
 			{
1488 1487
 				if(self::$db_info)
@@ -1501,7 +1500,7 @@  discard block
 block discarded – undo
1501 1500
 				@return
1502 1501
 				@access
1503 1502
 				@param $db_info
1504
-			*/
1503
+			 */
1505 1504
 			public static function setDBInfo($db_info)
1506 1505
 			{
1507 1506
 				self::$db_info = $db_info;
@@ -1512,7 +1511,7 @@  discard block
 block discarded – undo
1512 1511
 				@developer
1513 1512
 				@return
1514 1513
 				@access
1515
-			*/
1514
+			 */
1516 1515
 			public static function getDBInfo()
1517 1516
 			{
1518 1517
 				return self::$db_info;
@@ -1524,7 +1523,7 @@  discard block
 block discarded – undo
1524 1523
 				@return
1525 1524
 				@access
1526 1525
 				@param $str
1527
-			*/
1526
+			 */
1528 1527
 			public static function convertEncodingStr($str)
1529 1528
 			{
1530 1529
 				return $str;
@@ -1535,7 +1534,7 @@  discard block
 block discarded – undo
1535 1534
 				@developer
1536 1535
 				@return
1537 1536
 				@access
1538
-			*/
1537
+			 */
1539 1538
 			public static function setNoDBInfo()
1540 1539
 			{
1541 1540
 				$db_info = (object)NULL;
@@ -1562,7 +1561,7 @@  discard block
 block discarded – undo
1562 1561
 				@developer
1563 1562
 				@access
1564 1563
 				@return
1565
-			*/
1564
+			 */
1566 1565
 			public static function setMysqlDBInfo()
1567 1566
 			{
1568 1567
 				$db_info = (object)NULL;
@@ -1604,7 +1603,7 @@  discard block
 block discarded – undo
1604 1603
 				@developer
1605 1604
 				@return
1606 1605
 				@access
1607
-			*/
1606
+			 */
1608 1607
 			public static function setMysqliDBInfo()
1609 1608
 			{
1610 1609
 				$db_info = (object)NULL;
@@ -1646,7 +1645,7 @@  discard block
 block discarded – undo
1646 1645
 				@developer
1647 1646
 				@return
1648 1647
 				@access
1649
-			*/
1648
+			 */
1650 1649
 			public static function setCubridDBInfo()
1651 1650
 			{
1652 1651
 				$db_info = (object)NULL;
@@ -1688,7 +1687,7 @@  discard block
 block discarded – undo
1688 1687
 				@developer
1689 1688
 				@return
1690 1689
 				@access
1691
-			*/
1690
+			 */
1692 1691
 			public static function setMssqlDBInfo()
1693 1692
 			{
1694 1693
 				$db_info = (object)NULL;
@@ -1729,7 +1728,7 @@  discard block
 block discarded – undo
1729 1728
 		/**
1730 1729
 			@brief
1731 1730
 			@developer
1732
-		*/
1731
+		 */
1733 1732
 		class Any_prop_obj_base
1734 1733
 		{
1735 1734
 			/**
@@ -1738,7 +1737,7 @@  discard block
 block discarded – undo
1738 1737
 				@return
1739 1738
 				@param $property
1740 1739
 				@access
1741
-			*/
1740
+			 */
1742 1741
 			public function __get($property)
1743 1742
 			{
1744 1743
 				return NULL;
@@ -1748,7 +1747,7 @@  discard block
 block discarded – undo
1748 1747
 		/**
1749 1748
 			@brief
1750 1749
 			@developer
1751
-			*/
1750
+		 */
1752 1751
 		class LangArgFilterErrorMessage
1753 1752
 		{
1754 1753
 			/**
@@ -1757,7 +1756,7 @@  discard block
 block discarded – undo
1757 1756
 				@return
1758 1757
 				@param $property
1759 1758
 				@access
1760
-			*/
1759
+			 */
1761 1760
 			public function __get($property)
1762 1761
 			{
1763 1762
 				return 'Argument filter error';
Please login to merge, or discard this patch.
Spacing   +267 added lines, -286 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	{
96 96
 		parent::__construct("{$file}({$line_no}):\n\t$message");
97 97
 
98
-		$this->xml_file	= $file;
98
+		$this->xml_file = $file;
99 99
 		$this->xml_line_no = $line_no;
100 100
 		$this->xml_message = $message;
101 101
 	}
@@ -133,32 +133,32 @@  discard block
 block discarded – undo
133 133
 
134 134
 	$libXmlErrors = libxml_get_errors();
135 135
 
136
-	if(count($libXmlErrors))
136
+	if (count($libXmlErrors))
137 137
 	{
138
-		if(!$filename)
138
+		if (!$filename)
139 139
 		{
140 140
 			$filename = $libXmlErrors[0]->file;
141 141
 		}
142 142
 
143 143
 		$msg = '';
144 144
 
145
-		foreach($libXmlErrors as $libXmlError)
145
+		foreach ($libXmlErrors as $libXmlError)
146 146
 		{
147 147
 			$msg .= "{$libXmlError->file}({$libXmlError->line}):\n\t {$libXmlError->message}";
148 148
 		}
149 149
 
150
-		if($throw_error)
150
+		if ($throw_error)
151 151
 		{
152 152
 			throw new ErrorMessage($msg);
153 153
 		}
154 154
 		else
155 155
 		{
156
-			fwrite(STDERR, $msg . "\n");
156
+			fwrite(STDERR, $msg."\n");
157 157
 		}
158 158
 	}
159 159
 	else
160 160
 	{
161
-		if($throw_error)
161
+		if ($throw_error)
162 162
 		{
163 163
 			throw new ErrorMessage('Schema validation failed.');
164 164
 		}
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 {
180 180
 	$children = $node->getElementsByTagName($child_tag);
181 181
 
182
-	if($children->length > 1)
182
+	if ($children->length > 1)
183 183
 	{
184 184
 		throw 
185 185
 			new XmlSchemaError(
@@ -217,21 +217,21 @@  discard block
 block discarded – undo
217 217
 {
218 218
 	$key_values = array();
219 219
 
220
-	foreach($node->childNodes as $child_node)
220
+	foreach ($node->childNodes as $child_node)
221 221
 	{
222
-		if($child_node->nodeType == XML_ELEMENT_NODE
222
+		if ($child_node->nodeType == XML_ELEMENT_NODE
223 223
 					&&
224 224
 				in_array($child_node->tagName, $child_tags))
225 225
 		{
226 226
 			$key_value = NULL;
227 227
 
228
-			foreach($attr_tags as $attr_tag)
228
+			foreach ($attr_tags as $attr_tag)
229 229
 			{
230
-				if($child_node->hasAttribute($attr_tag))
230
+				if ($child_node->hasAttribute($attr_tag))
231 231
 				{
232 232
 					$key_value = $child_node->getAttribute($attr_tag);
233 233
 
234
-					if(array_key_exists($key_value, $key_values))
234
+					if (array_key_exists($key_value, $key_values))
235 235
 					{
236 236
 						throw
237 237
 							new XmlSchemaError(
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 				}
247 247
 			}
248 248
 
249
-			if(!$key_value && $key)
249
+			if (!$key_value && $key)
250 250
 			{
251 251
 				throw
252 252
 					new XmlSchemaError(
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 						$child_node->getLineNo(),
255 255
 						"<{$child_node->tagName}>: at least one of the following attributes is expected: "
256 256
 							.
257
-						implode(', ', $attr_tags) . '.'
257
+						implode(', ', $attr_tags).'.'
258 258
 					);
259 259
 			}
260 260
 		}
@@ -282,19 +282,19 @@  discard block
 block discarded – undo
282 282
 	$table_name = NULL;
283 283
 	$join_type = NULL;
284 284
 
285
-	if($table_element->hasAttribute('name'))
285
+	if ($table_element->hasAttribute('name'))
286 286
 	{
287 287
 		$table_name = $table_element->getAttribute('name');
288 288
 	}
289 289
 
290
-	if($table_element->hasAttribute('type'))
290
+	if ($table_element->hasAttribute('type'))
291 291
 	{
292 292
 		$join_type = $table_element->getAttribute('type');
293 293
 	}
294 294
 
295
-	if($table_element->getAttribute('query') == 'true')
295
+	if ($table_element->getAttribute('query') == 'true')
296 296
 	{
297
-		if($table_name !== NULL)
297
+		if ($table_name !== NULL)
298 298
 		{
299 299
 			throw
300 300
 				new XmlSchemaError(
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 				);
305 305
 		}
306 306
 
307
-		if($join_type !== NULL)
307
+		if ($join_type !== NULL)
308 308
 		{
309 309
 			throw
310 310
 				new XmlSchemaError(
@@ -322,9 +322,9 @@  discard block
 block discarded – undo
322 322
 		// check contents for a select list or a table-specification
323 323
 		$has_query_clauses = FALSE;
324 324
 
325
-		foreach($table_element->childNodes as $query_clause)
325
+		foreach ($table_element->childNodes as $query_clause)
326 326
 		{
327
-			if($query_clause->nodeType == XML_ELEMENT_NODE
327
+			if ($query_clause->nodeType == XML_ELEMENT_NODE
328 328
 						&&
329 329
 					(
330 330
 						$query_clause->tagName == 'columns' 
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 			}
336 336
 		}
337 337
 
338
-		if(!$has_query_clauses)
338
+		if (!$has_query_clauses)
339 339
 		{
340 340
 			throw
341 341
 				new XmlSchemaError(
@@ -351,17 +351,17 @@  discard block
 block discarded – undo
351 351
 	{
352 352
 		// base table or view
353 353
 
354
-		if($join_type !== NULL)
354
+		if ($join_type !== NULL)
355 355
 		{
356 356
 			$has_conditions_element = FALSE;
357 357
 
358
-			foreach($table_element->childNodes as $child_node)
358
+			foreach ($table_element->childNodes as $child_node)
359 359
 			{
360
-				if($child_node->nodeType == XML_ELEMENT_NODE)
360
+				if ($child_node->nodeType == XML_ELEMENT_NODE)
361 361
 				{
362
-					if($child_node->tagName == 'conditions')
362
+					if ($child_node->tagName == 'conditions')
363 363
 					{
364
-						if($has_conditions_element)
364
+						if ($has_conditions_element)
365 365
 						{
366 366
 							throw
367 367
 								new XmlSchemaError(
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 				}
388 388
 			}
389 389
 
390
-			if(!$has_conditions_element)
390
+			if (!$has_conditions_element)
391 391
 			{
392 392
 				throw
393 393
 					new XmlSchemaError(
@@ -399,9 +399,9 @@  discard block
 block discarded – undo
399 399
 		}
400 400
 		else
401 401
 		{
402
-			foreach($table_element->childNodes as $child_node)
402
+			foreach ($table_element->childNodes as $child_node)
403 403
 			{
404
-				if($child_node->nodeType == XML_ELEMENT_NODE)
404
+				if ($child_node->nodeType == XML_ELEMENT_NODE)
405 405
 				{
406 406
 					throw
407 407
 						new XmlSchemaError(
@@ -429,26 +429,25 @@  discard block
 block discarded – undo
429 429
  */
430 430
 function checkTablesClause($xml_file, $tables_element)
431 431
 {
432
-	checkUniqueKey
433
-		(
432
+	checkUniqueKey(
434 433
 			$xml_file,
435 434
 			$tables_element,
436
-			array('table'),				// child elements to be checked
437
-			array('alias', 'name'),		// attributes to be checked
435
+			array('table'), // child elements to be checked
436
+			array('alias', 'name'), // attributes to be checked
438 437
 			TRUE						// attributes are required
439 438
 		);
440 439
 
441
-	foreach($tables_element->childNodes as $table)
440
+	foreach ($tables_element->childNodes as $table)
442 441
 	{
443
-		if($table->nodeType == XML_ELEMENT_NODE
442
+		if ($table->nodeType == XML_ELEMENT_NODE
444 443
 					&&
445 444
 				$table->tagName == 'table')
446 445
 		{
447 446
 			checkTableExpression($xml_file, $table);
448 447
 
449
-			if($table->getAttribute('query') == 'true')
448
+			if ($table->getAttribute('query') == 'true')
450 449
 			{
451
-				validate_select_query($xml_file, $table);		// recursive call
450
+				validate_select_query($xml_file, $table); // recursive call
452 451
 			}
453 452
 		}
454 453
 	}
@@ -470,12 +469,11 @@  discard block
 block discarded – undo
470 469
  */
471 470
 function checkSelectListClause($xml_file, $columns_element)
472 471
 {
473
-	checkUniqueKey
474
-		(
472
+	checkUniqueKey(
475 473
 			$xml_file,
476 474
 			$columns_element,
477
-			array('column', 'query'),	// child elements
478
-			array('alias', 'name'),		// attributes
475
+			array('column', 'query'), // child elements
476
+			array('alias', 'name'), // attributes
479 477
 			FALSE						// ignore if no attributes present
480 478
 		);
481 479
 }
@@ -491,8 +489,7 @@  discard block
 block discarded – undo
491 489
 	@param $container_element
492 490
 	@param $child_tag
493 491
 */
494
-function checkVarContentsValidation
495
-	(
492
+function checkVarContentsValidation(
496 493
 		$xml_file,
497 494
 		$container_element,
498 495
 		$child_tag
@@ -503,23 +500,22 @@  discard block
 block discarded – undo
503 500
 
504 501
 	static
505 502
 		$var_attrs =
506
-			array
507
-			(
503
+			array(
508 504
 				'filter', 'notnull', 'minlength',
509 505
 				'maxlength'
510 506
 			);
511 507
 
512
-	foreach($container_element->childNodes as $child_node)
508
+	foreach ($container_element->childNodes as $child_node)
513 509
 	{
514
-		if($child_node->nodeType == XML_ELEMENT_NODE
510
+		if ($child_node->nodeType == XML_ELEMENT_NODE
515 511
 					&&
516 512
 				$child_node->tagName == $child_tag)
517 513
 		{
518
-			if(!$child_node->hasAttribute($key_attr))
514
+			if (!$child_node->hasAttribute($key_attr))
519 515
 			{
520
-				foreach($var_attrs as $var_attr)
516
+				foreach ($var_attrs as $var_attr)
521 517
 				{
522
-					if($child_node->hasAttribute($var_attr))
518
+					if ($child_node->hasAttribute($var_attr))
523 519
 					{
524 520
 						throw
525 521
 							new XmlSchemaError(
@@ -551,9 +547,9 @@  discard block
 block discarded – undo
551 547
 	$has_var_attribute = $condition->hasAttribute('var') || $condition->hasAttribute('default');
552 548
 	$query_line_no = -1;
553 549
 
554
-	foreach($condition->childNodes as $query_node)
550
+	foreach ($condition->childNodes as $query_node)
555 551
 	{
556
-		if($query_node->nodeType == XML_ELEMENT_NODE
552
+		if ($query_node->nodeType == XML_ELEMENT_NODE
557 553
 					&&
558 554
 				$query_node->tagName == 'query')
559 555
 		{
@@ -564,7 +560,7 @@  discard block
 block discarded – undo
564 560
 		}
565 561
 	}
566 562
 
567
-	if($child_query_node && $has_var_attribute)
563
+	if ($child_query_node && $has_var_attribute)
568 564
 	{
569 565
 		throw 
570 566
 			new XmlSchemaError(
@@ -574,7 +570,7 @@  discard block
 block discarded – undo
574 570
 			);
575 571
 	}
576 572
 
577
-	if(!($child_query_node || $has_var_attribute))
573
+	if (!($child_query_node || $has_var_attribute))
578 574
 	{
579 575
 		throw
580 576
 			new XmlSchemaError(
@@ -601,18 +597,18 @@  discard block
 block discarded – undo
601 597
 {
602 598
 	$first_child = TRUE;
603 599
 
604
-	foreach($conditions->childNodes as $child_node)
600
+	foreach ($conditions->childNodes as $child_node)
605 601
 	{
606
-		if($child_node->nodeType == XML_ELEMENT_NODE)
602
+		if ($child_node->nodeType == XML_ELEMENT_NODE)
607 603
 		{
608 604
 			// check for 'pipe' attribute
609
-			if($first_child)
605
+			if ($first_child)
610 606
 			{
611 607
 				$first_child = FALSE;
612 608
 			}
613 609
 			else
614 610
 			{
615
-				if(!$child_node->hasAttribute('pipe'))
611
+				if (!$child_node->hasAttribute('pipe'))
616 612
 				{
617 613
 					throw
618 614
 						new XmlSchemaError(
@@ -626,19 +622,19 @@  discard block
 block discarded – undo
626 622
 			}
627 623
 
628 624
 			// recurse in condition groups/queries
629
-			if($child_node->tagName == 'group')
625
+			if ($child_node->tagName == 'group')
630 626
 			{
631 627
 				checkConditionsGroup($xml_file, $child_node);
632 628
 			}
633 629
 			else
634 630
 			{
635
-				if($child_node->tagName == 'query')
631
+				if ($child_node->tagName == 'query')
636 632
 				{
637 633
 					validate_select_query($xml_file, $child_node);
638 634
 				}
639 635
 				else
640 636
 				{
641
-					if($child_node->tagName == 'condition')
637
+					if ($child_node->tagName == 'condition')
642 638
 					{
643 639
 						checkConditionElement($xml_file, $child_node);
644 640
 					}
@@ -664,12 +660,11 @@  discard block
 block discarded – undo
664 660
  */
665 661
 function checkNavigationClauses($xml_file, $navigation_element)
666 662
 {
667
-	foreach(array('list_count', 'page_count', 'page')
663
+	foreach (array('list_count', 'page_count', 'page')
668 664
 				as
669 665
 			$navigation_el)
670 666
 	{
671
-		checkDuplicateDescendants
672
-			(
667
+		checkDuplicateDescendants(
673 668
 				$xml_file,
674 669
 				$navigation_element,
675 670
 				$navigation_el
@@ -693,11 +688,11 @@  discard block
 block discarded – undo
693 688
  */
694 689
 function validate_select_query($xml_file, $query_element)
695 690
 {
696
-	foreach($query_element->childNodes as $select_clause)
691
+	foreach ($query_element->childNodes as $select_clause)
697 692
 	{
698
-		if($select_clause->nodeType == XML_ELEMENT_NODE)
693
+		if ($select_clause->nodeType == XML_ELEMENT_NODE)
699 694
 		{
700
-			switch($select_clause->tagName)
695
+			switch ($select_clause->tagName)
701 696
 			{
702 697
 				case 'columns':
703 698
 					checkSelectListClause($xml_file, $select_clause);
@@ -728,11 +723,11 @@  discard block
 block discarded – undo
728 723
  */
729 724
 function validate_update_query($xml_file, $query_element)
730 725
 {
731
-	foreach($query_element->childNodes as $update_clause)
726
+	foreach ($query_element->childNodes as $update_clause)
732 727
 	{
733
-		if($update_clause->nodeType == XML_ELEMENT_NODE)
728
+		if ($update_clause->nodeType == XML_ELEMENT_NODE)
734 729
 		{
735
-			switch($update_clause->tagName)
730
+			switch ($update_clause->tagName)
736 731
 			{
737 732
 				case 'tables':
738 733
 					checkTablesClause($xml_file, $update_clause);
@@ -755,11 +750,11 @@  discard block
 block discarded – undo
755 750
  */
756 751
 function validate_delete_query($xml_file, $query_element)
757 752
 {
758
-	foreach($query_element->childNodes as $delete_clause)
753
+	foreach ($query_element->childNodes as $delete_clause)
759 754
 	{
760
-		if($delete_clause->nodeType == XML_ELEMENT_NODE)
755
+		if ($delete_clause->nodeType == XML_ELEMENT_NODE)
761 756
 		{
762
-			switch($delete_clause->tagName)
757
+			switch ($delete_clause->tagName)
763 758
 			{
764 759
 				case 'conditions':
765 760
 					checkConditionsGroup($xml_file, $delete_clause);
@@ -778,11 +773,11 @@  discard block
 block discarded – undo
778 773
  */
779 774
 function validate_insert_select_query($xml_file, $query_element)
780 775
 {
781
-	foreach($query_element->childNodes as $statement_clause)
776
+	foreach ($query_element->childNodes as $statement_clause)
782 777
 	{
783
-		if($statement_clause->nodeType == XML_ELEMENT_NODE)
778
+		if ($statement_clause->nodeType == XML_ELEMENT_NODE)
784 779
 		{
785
-			switch($statement_clause->tagName)
780
+			switch ($statement_clause->tagName)
786 781
 			{
787 782
 				case 'query':
788 783
 					validate_select_query($xml_file, $statement_clause);
@@ -793,8 +788,7 @@  discard block
 block discarded – undo
793 788
 }
794 789
 
795 790
 $validate_query_type = 
796
-	array
797
-		(
791
+	array(
798 792
 			// 'insert' =>		
799 793
 							// there is currently nothing special to check
800 794
 							// for a plain insert, all the needed checks
@@ -818,13 +812,13 @@  discard block
 block discarded – undo
818 812
 
819 813
 	$action = $query_element->getAttribute('action');
820 814
 
821
-	if(array_key_exists($action, $validate_query_type))
815
+	if (array_key_exists($action, $validate_query_type))
822 816
 	{
823 817
 		$validate_query_type[$action]($xml_file, $query_element);
824 818
 	}
825 819
 }
826 820
 
827
-if(strpos(PHP_SAPI, 'cli') !== FALSE
821
+if (strpos(PHP_SAPI, 'cli') !== FALSE
828 822
 			|| 
829 823
 		strpos(PHP_SAPI, 'cgi') !== FALSE)
830 824
 {
@@ -857,7 +851,7 @@  discard block
 block discarded – undo
857 851
 				print "Failed to restore working dir {$this->dirname}.";
858 852
 			}
859 853
 
860
-			if(!$success)
854
+			if (!$success)
861 855
 			{
862 856
 				print "Failed to restore working dir {$this->dirname}.";
863 857
 			}
@@ -873,7 +867,7 @@  discard block
 block discarded – undo
873 867
 		{
874 868
 			$this->dirname = getcwd();
875 869
 
876
-			if(!$this->dirname)
870
+			if (!$this->dirname)
877 871
 			{
878 872
 				throw new ErrorMessage("Failed to get current directory.");
879 873
 			}
@@ -903,7 +897,7 @@  discard block
 block discarded – undo
903 897
 	$lowercase_name = strtolower($xml_path_info['basename']);
904 898
 	$uppercase_name = strtoupper($xml_path_info['basename']);
905 899
 
906
-	if(strlen($lowercase_name) != $filename_len
900
+	if (strlen($lowercase_name) != $filename_len
907 901
 				||
908 902
 			strlen($uppercase_name) != $filename_len)
909 903
 	{
@@ -916,9 +910,9 @@  discard block
 block discarded – undo
916 910
 
917 911
 	$varing_case_filename = '';
918 912
 
919
-	for($i = 0; $i < $filename_len; $i++)
913
+	for ($i = 0; $i < $filename_len; $i++)
920 914
 	{
921
-		if($lowercase_name[$i] != $uppercase_name[$i])
915
+		if ($lowercase_name[$i] != $uppercase_name[$i])
922 916
 		{
923 917
 			$varing_case_filename .= "[{$lowercase_name[$i]}{$uppercase_name[$i]}]";
924 918
 		}
@@ -932,13 +926,13 @@  discard block
 block discarded – undo
932 926
 
933 927
 	$restoreWorkDir = new RestoreWorkDir();
934 928
 
935
-	if($glob_pattern)
929
+	if ($glob_pattern)
936 930
 	{
937 931
 		// change current dir to the xml file directory to keep
938 932
 		// glob pattern shorter (maximum 260 chars).
939 933
 		$success = chdir($glob_pattern);
940 934
 
941
-		if(!$success)
935
+		if (!$success)
942 936
 		{
943 937
 			throw new ErrorMessage("Failed to change work dir to {$glob_pattern}.");
944 938
 		}
@@ -950,14 +944,14 @@  discard block
 block discarded – undo
950 944
 	// realpath() would have the same effect, but it is not documented as such
951 945
 	$matched_files = glob($glob_pattern, GLOB_NOSORT | GLOB_NOESCAPE | GLOB_ERR);
952 946
 
953
-	unset($RestoreWorkDir);		// restore work dir after call to glob()
947
+	unset($RestoreWorkDir); // restore work dir after call to glob()
954 948
 
955
-	if($matched_files === FALSE || !is_array($matched_files))
949
+	if ($matched_files === FALSE || !is_array($matched_files))
956 950
 	{
957 951
 		throw new ErrorMessage("Directory listing for $xml_file failed.");
958 952
 	}
959 953
 
960
-	switch(count($matched_files))
954
+	switch (count($matched_files))
961 955
 	{
962 956
 		case 0:
963 957
 			throw new ErrorMessage("Directory listing for $xml_file failed.");
@@ -968,9 +962,9 @@  discard block
 block discarded – undo
968 962
 		default:
969 963
 			// more than one files with the same name and different case
970 964
 			// case-sensitive file system
971
-			foreach($mached_files as $matched_file)
965
+			foreach ($mached_files as $matched_file)
972 966
 			{
973
-				if(pathinfo($matched_file, PATHINFO_BASENAME) == $xml_path_info['basename'])
967
+				if (pathinfo($matched_file, PATHINFO_BASENAME) == $xml_path_info['basename'])
974 968
 				{
975 969
 					return ($xml_path_info['filename'] == $query_id);
976 970
 				}
@@ -979,7 +973,7 @@  discard block
 block discarded – undo
979 973
 
980 974
 	}
981 975
 
982
-	throw new ErrorMessage("Internal application error.");  // unreachable
976
+	throw new ErrorMessage("Internal application error."); // unreachable
983 977
 }
984 978
 
985 979
 /**
@@ -1000,9 +994,9 @@  discard block
 block discarded – undo
1000 994
 */
1001 995
 function validate_schema_doc($xml_file, $table_element)
1002 996
 {
1003
-	foreach($table_element->childNodes as $col_node)
997
+	foreach ($table_element->childNodes as $col_node)
1004 998
 	{
1005
-		if($col_node->nodeType == XML_ELEMENT_NODE
999
+		if ($col_node->nodeType == XML_ELEMENT_NODE
1006 1000
 					&&
1007 1001
 				$col_node->tagName == 'column')
1008 1002
 		{
@@ -1010,12 +1004,11 @@  discard block
 block discarded – undo
1010 1004
 			$col_size = NULL;
1011 1005
 
1012 1006
 			// check auto-increment column
1013
-			if($col_node->hasAttribute('auto_increment'))
1007
+			if ($col_node->hasAttribute('auto_increment'))
1014 1008
 			{
1015
-				fwrite
1016
-					(
1009
+				fwrite(
1017 1010
 						fopen('php://stdout', 'wt'), 
1018
-						$xml_file . '(' . $col_node->getLineNo() . ")\n\t"
1011
+						$xml_file.'('.$col_node->getLineNo().")\n\t"
1019 1012
 							.
1020 1013
 						"<column>: attribute 'auto_increment' is currently supported only by SQL Server and mysql backends.\n"
1021 1014
 					);
@@ -1023,7 +1016,7 @@  discard block
 block discarded – undo
1023 1016
 				static
1024 1017
 					$autoinc_types = array('number', 'bignumber');
1025 1018
 
1026
-				if(!in_array($col_type, $autoinc_types))
1019
+				if (!in_array($col_type, $autoinc_types))
1027 1020
 				{
1028 1021
 					throw
1029 1022
 						new XmlSchemaError(
@@ -1031,30 +1024,29 @@  discard block
 block discarded – undo
1031 1024
 							$col_node->getLineNo(),
1032 1025
 							"<column>: attribute 'auto_increment' only expected for one of the following types: "
1033 1026
 								.
1034
-							implode(', ', $autoinc_types) . '.'
1027
+							implode(', ', $autoinc_types).'.'
1035 1028
 						);
1036 1029
 				}
1037 1030
 			}
1038 1031
 
1039 1032
 			// check tinytext
1040
-			if($col_type == 'tinytext')
1033
+			if ($col_type == 'tinytext')
1041 1034
 			{
1042
-				fwrite
1043
-					(
1035
+				fwrite(
1044 1036
 						fopen('php://stdout', 'wt'), 
1045
-						$xml_file . '(' . $col_node->getLineNo() . ")\n\t"
1037
+						$xml_file.'('.$col_node->getLineNo().")\n\t"
1046 1038
 							.
1047 1039
 						"<column>: type \"tinytext\" is supported only by CUBRID.\n"
1048 1040
 					);
1049 1041
 			}
1050 1042
 
1051 1043
 			// check size attribute
1052
-			if($col_node->hasAttribute('size'))
1044
+			if ($col_node->hasAttribute('size'))
1053 1045
 			{
1054 1046
 				$col_size = $col_node->getAttribute('size');
1055 1047
 			}
1056 1048
 
1057
-			if($col_type == 'varchar' && $col_size === NULL)
1049
+			if ($col_type == 'varchar' && $col_size === NULL)
1058 1050
 			{
1059 1051
 				throw 
1060 1052
 					new XmlSchemaError(
@@ -1068,7 +1060,7 @@  discard block
 block discarded – undo
1068 1060
 				$varsize_types = array('char', 'varchar', 'float');
1069 1061
 					
1070 1062
 
1071
-			if($col_size !== NULL  && !in_array($col_type, $varsize_types))
1063
+			if ($col_size !== NULL && !in_array($col_type, $varsize_types))
1072 1064
 			{
1073 1065
 				throw 
1074 1066
 					new XmlSchemaError(
@@ -1076,7 +1068,7 @@  discard block
 block discarded – undo
1076 1068
 							$col_node->getLineNo(),
1077 1069
 							"<column>: 'size' attribute only expected for the following types: "
1078 1070
 								.
1079
-							implode(', ', $varsize_types) . "."
1071
+							implode(', ', $varsize_types)."."
1080 1072
 						);
1081 1073
 			}
1082 1074
 		}
@@ -1102,8 +1094,8 @@  discard block
 block discarded – undo
1102 1094
 	const RETCODE_GENERIC_XML_SYNTAX = 50;
1103 1095
 	const RETCODE_QUERY_ELEMENT = 40;
1104 1096
 	const RETCODE_XSD_VALIDATION = 30;
1105
-	const RETCODE_BUILTIN_CHECKS =	20;
1106
-	const RETCODE_DB_SCHEMA_MATCH = 10;	// no schema match is currently implemented.
1097
+	const RETCODE_BUILTIN_CHECKS = 20;
1098
+	const RETCODE_DB_SCHEMA_MATCH = 10; // no schema match is currently implemented.
1107 1099
 	const RETCODE_SUCCESS = 0;
1108 1100
 
1109 1101
 
@@ -1116,13 +1108,13 @@  discard block
 block discarded – undo
1116 1108
 	*/
1117 1109
 	public function code($val = -1)
1118 1110
 	{
1119
-		if($val == -1)
1111
+		if ($val == -1)
1120 1112
 		{
1121 1113
 			return $this->exit_code;
1122 1114
 		}
1123 1115
 		else
1124 1116
 		{
1125
-			if($this->exit_code < $val)
1117
+			if ($this->exit_code < $val)
1126 1118
 			{
1127 1119
 				$this->exit_code = $val;
1128 1120
 			}
@@ -1184,7 +1176,7 @@  discard block
 block discarded – undo
1184 1176
 	*/
1185 1177
 	public function __destruct()
1186 1178
 	{
1187
-		if($this->file_name)
1179
+		if ($this->file_name)
1188 1180
 		{
1189 1181
 			unlink($this->file_name);
1190 1182
 			$this->file_name = NULL;
@@ -1214,12 +1206,12 @@  discard block
 block discarded – undo
1214 1206
 	$cmdname = CMD_NAME;
1215 1207
 
1216 1208
 	// php manual says resources should not normally be declared constant
1217
-	if(!defined('STDERR'))
1209
+	if (!defined('STDERR'))
1218 1210
 	{
1219 1211
 		define('STDERR', fopen('php://stderr', 'wt'));
1220 1212
 	}
1221 1213
 
1222
-	if(!defined('__DIR__'))
1214
+	if (!defined('__DIR__'))
1223 1215
 	{
1224 1216
 		define('__DIR__', dirname(__FILE__)); 
1225 1217
 	}
@@ -1234,7 +1226,7 @@  discard block
 block discarded – undo
1234 1226
 	$query_args = NULL;
1235 1227
 	$query_args_file = NULL;
1236 1228
 
1237
-	while($argc >= 2 && $argv[1][0] == '-')
1229
+	while ($argc >= 2 && $argv[1][0] == '-')
1238 1230
 	{
1239 1231
 		$option = $argv[1];
1240 1232
 
@@ -1242,17 +1234,17 @@  discard block
 block discarded – undo
1242 1234
 		$argv = array_values($argv);
1243 1235
 		$argc = count($argv);
1244 1236
 
1245
-		switch($option)
1237
+		switch ($option)
1246 1238
 		{
1247 1239
 			case '-s':
1248 1240
 			case '--schema':
1249 1241
 			case '--schema-language':
1250
-				if($query_args !== NULL)
1242
+				if ($query_args !== NULL)
1251 1243
 				{
1252 1244
 					throw new SyntaxError("Both --args-string and --schema-language options given.");
1253 1245
 				}
1254 1246
 
1255
-				if($query_args_file !== NULL)
1247
+				if ($query_args_file !== NULL)
1256 1248
 				{
1257 1249
 					throw new SyntaxError("Both --args-file and --schema-language options given.");
1258 1250
 				}
@@ -1272,7 +1264,7 @@  discard block
 block discarded – undo
1272 1264
 
1273 1265
 			case '--xe-path':
1274 1266
 			case '--xe':
1275
-				if($argc < 2)
1267
+				if ($argc < 2)
1276 1268
 				{
1277 1269
 					throw
1278 1270
 						new SyntaxError("Option '{$option}' requires an argument., see `{$cmdname} --help`");
@@ -1290,17 +1282,17 @@  discard block
 block discarded – undo
1290 1282
 			case '--args-string':
1291 1283
 			case '--arguments':
1292 1284
 			case '--args':
1293
-				if($schema_language !== NULL)
1285
+				if ($schema_language !== NULL)
1294 1286
 				{
1295 1287
 					throw new SyntaxError("Both --schema-language and --args-string options given.");
1296 1288
 				}
1297 1289
 
1298
-				if($query_args_file !== NULL)
1290
+				if ($query_args_file !== NULL)
1299 1291
 				{
1300 1292
 					throw new SyntaxError("Both --args-string and --args-file options given.");
1301 1293
 				}
1302 1294
 
1303
-				if($argc < 2)
1295
+				if ($argc < 2)
1304 1296
 				{
1305 1297
 					throw
1306 1298
 						new SyntaxError("Option '{$option}' requires an argument., see `{$cmdname} --help`");
@@ -1316,17 +1308,17 @@  discard block
 block discarded – undo
1316 1308
 
1317 1309
 			case '--arguments-file':
1318 1310
 			case '--args-file':
1319
-				if($schema_language !== NULL)
1311
+				if ($schema_language !== NULL)
1320 1312
 				{
1321 1313
 					throw new SyntaxError("Both --schema-language and --args-file options given.");
1322 1314
 				}
1323 1315
 
1324
-				if($query_args !== NULL)
1316
+				if ($query_args !== NULL)
1325 1317
 				{
1326 1318
 					throw new SyntaxError("Both --args-string and --args-file options given.");
1327 1319
 				}
1328 1320
 
1329
-				if($argc < 2)
1321
+				if ($argc < 2)
1330 1322
 				{
1331 1323
 					throw
1332 1324
 						new SyntaxError("Option '{$option}' requires an argument., see `{$cmdname} --help`");
@@ -1357,7 +1349,7 @@  discard block
 block discarded – undo
1357 1349
 		}
1358 1350
 	}
1359 1351
 
1360
-	if($argc < 2 ||
1352
+	if ($argc < 2 ||
1361 1353
 			(
1362 1354
 				$argc == 2
1363 1355
 					&&
@@ -1366,48 +1358,48 @@  discard block
 block discarded – undo
1366 1358
 	{
1367 1359
 		throw
1368 1360
 			new SyntaxError(
1369
-				"Validates an XML document against a given schema definition (XSD), using the standard php library.\n" .
1370
-				"Syntax:\n" .
1371
-				"	{$cmdname} schema.xsd document.xml...\n" .
1372
-				"	{$cmdname} [ --schema-language ] [--skip-query-id] ... [--] document.xml...\n" .
1373
-				"Where:\n" .
1374
-				"	--schema-language\n" .
1375
-				"	--schema\n" .
1376
-				"	-s\n" .
1377
-				"		If given, the document(s) are validated against XE XML Schema Language,\n" .
1378
-				"		otherwise document(s) are validated against XE XML Query Language.\n" .
1379
-				"\n" .
1380
-				"	--skip-query-id\n" .
1381
-				"		Do not check the query id, which should normally match the file name.\n" .
1382
-				"\n" .
1383
-				"	--xe-path\n" .
1384
-				"	--xe\n" .
1385
-				"		Path to XE installation. Used to load the database-specific parsers to generate\n" .
1386
-				"		SQL from the XML language files.\n" .
1387
-				"\n" .
1388
-				"	--validate-only\n" .
1389
-				"		Only check XML schemas, no SQL generated with the database-specific parsers.\n" .
1390
-				"\n" .
1391
-				"	--args-string   \" 'name' => 'val..', 'name' => 'val...' \"\n" .
1392
-				"	--args-file		args/file/name.php\n" .
1393
-				"		Variables and values for the query, if it has any (only for XML Query Language).\n" .
1394
-				"		Use a comma-separated 'var-name' => 'var_value...' pairs, in php syntax for an\n" .
1395
-				"		array constructor. The validator script will directly eval()/include() this content.\n" .
1396
-				"		The file named with --args-file should include an array() constructor around the\n" .
1397
-				"		name-value list, and should immediately return it, without a named array variable.\n" .
1398
-				"		E.g.:\n" .
1399
-				"			return \n" .
1400
-				"				array\n" .
1401
-				"					(\n" .
1402
-				"						'name' => 'val',\n" .
1403
-				"						'name' => 'val',\n" .
1404
-				"						...\n" .
1405
-				"					);\n" .
1406
-				"\n" .
1407
-				"	schema.xsd		if given, is the file name for the schema definition to validate the\n" .
1408
-				"					document against\n" .
1409
-				"\n" .
1410
-				"	document.xml	is the file name for the XML document to be validated against the schema.\n" .
1361
+				"Validates an XML document against a given schema definition (XSD), using the standard php library.\n".
1362
+				"Syntax:\n".
1363
+				"	{$cmdname} schema.xsd document.xml...\n".
1364
+				"	{$cmdname} [ --schema-language ] [--skip-query-id] ... [--] document.xml...\n".
1365
+				"Where:\n".
1366
+				"	--schema-language\n".
1367
+				"	--schema\n".
1368
+				"	-s\n".
1369
+				"		If given, the document(s) are validated against XE XML Schema Language,\n".
1370
+				"		otherwise document(s) are validated against XE XML Query Language.\n".
1371
+				"\n".
1372
+				"	--skip-query-id\n".
1373
+				"		Do not check the query id, which should normally match the file name.\n".
1374
+				"\n".
1375
+				"	--xe-path\n".
1376
+				"	--xe\n".
1377
+				"		Path to XE installation. Used to load the database-specific parsers to generate\n".
1378
+				"		SQL from the XML language files.\n".
1379
+				"\n".
1380
+				"	--validate-only\n".
1381
+				"		Only check XML schemas, no SQL generated with the database-specific parsers.\n".
1382
+				"\n".
1383
+				"	--args-string   \" 'name' => 'val..', 'name' => 'val...' \"\n".
1384
+				"	--args-file		args/file/name.php\n".
1385
+				"		Variables and values for the query, if it has any (only for XML Query Language).\n".
1386
+				"		Use a comma-separated 'var-name' => 'var_value...' pairs, in php syntax for an\n".
1387
+				"		array constructor. The validator script will directly eval()/include() this content.\n".
1388
+				"		The file named with --args-file should include an array() constructor around the\n".
1389
+				"		name-value list, and should immediately return it, without a named array variable.\n".
1390
+				"		E.g.:\n".
1391
+				"			return \n".
1392
+				"				array\n".
1393
+				"					(\n".
1394
+				"						'name' => 'val',\n".
1395
+				"						'name' => 'val',\n".
1396
+				"						...\n".
1397
+				"					);\n".
1398
+				"\n".
1399
+				"	schema.xsd		if given, is the file name for the schema definition to validate the\n".
1400
+				"					document against\n".
1401
+				"\n".
1402
+				"	document.xml	is the file name for the XML document to be validated against the schema.\n".
1411 1403
 				"					Multiple .xml files can be given.\n"
1412 1404
 			);
1413 1405
 	}
@@ -1415,23 +1407,23 @@  discard block
 block discarded – undo
1415 1407
 	$query_user_args = array();
1416 1408
 
1417 1409
 	// check $xe_path, $query_args
1418
-	if(!$validate_only)
1410
+	if (!$validate_only)
1419 1411
 	{
1420
-		if($xe_path == NULL)
1412
+		if ($xe_path == NULL)
1421 1413
 		{
1422 1414
 			// assume validator.php is in directory .../xe/tools/dbxml_validator/ in an XE installation
1423 1415
 			$xe_path = dirname(dirname(realpath(__DIR__)));
1424 1416
 		}
1425 1417
 
1426
-		if(!file_exists($xe_path . '/index.php'))
1418
+		if (!file_exists($xe_path.'/index.php'))
1427 1419
 		{
1428 1420
 			throw
1429 1421
 				new ErrorMessage("File index.php not found in {$xe_path}.");
1430 1422
 		}
1431 1423
 
1432
-		if(!defined('_XE_PATH_'))
1424
+		if (!defined('_XE_PATH_'))
1433 1425
 		{
1434
-			define('_XE_PATH_', $xe_path . '/');
1426
+			define('_XE_PATH_', $xe_path.'/');
1435 1427
 		}
1436 1428
 
1437 1429
 		/**
@@ -1485,7 +1477,7 @@  discard block
 block discarded – undo
1485 1477
 			*/
1486 1478
 			public static function getDBType()
1487 1479
 			{
1488
-				if(self::$db_info)
1480
+				if (self::$db_info)
1489 1481
 				{
1490 1482
 					return self::$db_info->master_db['db_type'];
1491 1483
 				}
@@ -1538,10 +1530,9 @@  discard block
 block discarded – undo
1538 1530
 			*/
1539 1531
 			public static function setNoDBInfo()
1540 1532
 			{
1541
-				$db_info = (object)NULL;
1533
+				$db_info = (object) NULL;
1542 1534
 				$db_info->master_db =
1543
-					array
1544
-						(
1535
+					array(
1545 1536
 							'db_type' => NULL,
1546 1537
 							'db_hostname' => NULL,
1547 1538
 							'db_port' => NULL,
@@ -1565,10 +1556,9 @@  discard block
 block discarded – undo
1565 1556
 			*/
1566 1557
 			public static function setMysqlDBInfo()
1567 1558
 			{
1568
-				$db_info = (object)NULL;
1559
+				$db_info = (object) NULL;
1569 1560
 				$db_info->master_db =
1570
-					array
1571
-						(
1561
+					array(
1572 1562
 							'db_type' => 'mysql',
1573 1563
 							'db_hostname' => NULL,
1574 1564
 							'db_port' => NULL,
@@ -1584,7 +1574,7 @@  discard block
 block discarded – undo
1584 1574
 
1585 1575
 				self::setDBInfo($db_info);
1586 1576
 
1587
-				if(array_key_exists('__DB__', $GLOBALS)
1577
+				if (array_key_exists('__DB__', $GLOBALS)
1588 1578
 							&&
1589 1579
 						array_key_exists($db_info->master_db['db_type'], $GLOBALS['__DB__']))
1590 1580
 				{
@@ -1607,10 +1597,9 @@  discard block
 block discarded – undo
1607 1597
 			*/
1608 1598
 			public static function setMysqliDBInfo()
1609 1599
 			{
1610
-				$db_info = (object)NULL;
1600
+				$db_info = (object) NULL;
1611 1601
 				$db_info->master_db =
1612
-					array
1613
-						(
1602
+					array(
1614 1603
 							'db_type' => 'mysqli',
1615 1604
 							'db_hostname' => NULL,
1616 1605
 							'db_port' => NULL,
@@ -1626,7 +1615,7 @@  discard block
 block discarded – undo
1626 1615
 
1627 1616
 				self::setDBInfo($db_info);
1628 1617
 
1629
-				if(array_key_exists('__DB__', $GLOBALS)
1618
+				if (array_key_exists('__DB__', $GLOBALS)
1630 1619
 							&&
1631 1620
 						array_key_exists($db_info->master_db['db_type'], $GLOBALS['__DB__']))
1632 1621
 				{
@@ -1649,10 +1638,9 @@  discard block
 block discarded – undo
1649 1638
 			*/
1650 1639
 			public static function setCubridDBInfo()
1651 1640
 			{
1652
-				$db_info = (object)NULL;
1641
+				$db_info = (object) NULL;
1653 1642
 				$db_info->master_db =
1654
-					array
1655
-						(
1643
+					array(
1656 1644
 							'db_type' => 'cubrid',
1657 1645
 							'db_hostname' => NULL,
1658 1646
 							'db_port' => NULL,
@@ -1668,7 +1656,7 @@  discard block
 block discarded – undo
1668 1656
 
1669 1657
 				self::setDBInfo($db_info);
1670 1658
 
1671
-				if(array_key_exists('__DB__', $GLOBALS)
1659
+				if (array_key_exists('__DB__', $GLOBALS)
1672 1660
 							&&
1673 1661
 						array_key_exists($db_info->master_db['db_type'], $GLOBALS['__DB__']))
1674 1662
 				{
@@ -1691,10 +1679,9 @@  discard block
 block discarded – undo
1691 1679
 			*/
1692 1680
 			public static function setMssqlDBInfo()
1693 1681
 			{
1694
-				$db_info = (object)NULL;
1682
+				$db_info = (object) NULL;
1695 1683
 				$db_info->master_db =
1696
-					array
1697
-						(
1684
+					array(
1698 1685
 							'db_type' => 'mssql',
1699 1686
 							'db_hostname' => NULL,
1700 1687
 							'db_port' => NULL,
@@ -1710,7 +1697,7 @@  discard block
 block discarded – undo
1710 1697
 
1711 1698
 				self::setDBInfo($db_info);
1712 1699
 
1713
-				if(array_key_exists('__DB__', $GLOBALS)
1700
+				if (array_key_exists('__DB__', $GLOBALS)
1714 1701
 							&&
1715 1702
 						array_key_exists($db_info->master_db['db_type'], $GLOBALS['__DB__']))
1716 1703
 				{
@@ -1765,49 +1752,49 @@  discard block
 block discarded – undo
1765 1752
 		}
1766 1753
 
1767 1754
 		global $lang;
1768
-		$lang = new Any_prop_obj_base();	// to return NULL on non-existent properties
1755
+		$lang = new Any_prop_obj_base(); // to return NULL on non-existent properties
1769 1756
 		$lang->filter = New LangArgFilterErrorMessage();
1770 1757
 
1771
-		if(!defined('__XE__'))
1758
+		if (!defined('__XE__'))
1772 1759
 		{
1773 1760
 			define('__XE__', TRUE);
1774 1761
 		}
1775 1762
 
1776
-		if(!defined('__ZBXE__'))
1763
+		if (!defined('__ZBXE__'))
1777 1764
 		{
1778 1765
 			define('__ZBXE__', TRUE);
1779 1766
 		}
1780 1767
 
1781
-		if(!defined('__DEBUG__'))
1768
+		if (!defined('__DEBUG__'))
1782 1769
 		{
1783 1770
 			define('__DEBUG__', 0);
1784 1771
 		}
1785 1772
 
1786
-		if(!defined('__DEBUG_QUERY__'))
1773
+		if (!defined('__DEBUG_QUERY__'))
1787 1774
 		{
1788 1775
 			define('__DEBUG_QUERY__', 0);
1789 1776
 		}
1790 1777
 
1791
-		include(_XE_PATH_ . 'classes/object/BaseObject.class.php');
1792
-		include(_XE_PATH_ . 'classes/handler/Handler.class.php');
1793
-		include(_XE_PATH_ . 'classes/file/FileHandler.class.php');
1794
-		include(_XE_PATH_ . 'classes/page/PageHandler.class.php');
1778
+		include(_XE_PATH_.'classes/object/BaseObject.class.php');
1779
+		include(_XE_PATH_.'classes/handler/Handler.class.php');
1780
+		include(_XE_PATH_.'classes/file/FileHandler.class.php');
1781
+		include(_XE_PATH_.'classes/page/PageHandler.class.php');
1795 1782
 
1796 1783
 		Context::setNoDBInfo();
1797 1784
 
1798
-		require_once(_XE_PATH_ . 'classes/db/DB.class.php');
1799
-		require_once(_XE_PATH_ . 'classes/db/DBMysql.class.php');
1800
-		require_once(_XE_PATH_ . 'classes/db/DBMysqli.class.php');
1801
-		require_once(_XE_PATH_ . 'classes/db/DBMysql_innodb.class.php');
1802
-		require_once(_XE_PATH_ . 'classes/db/DBCubrid.class.php');
1803
-		require_once(_XE_PATH_ . 'classes/db/DBMssql.class.php');
1804
-		require_once(_XE_PATH_ . 'classes/xml/XmlParser.class.php');
1805
-		require_once(_XE_PATH_ . 'classes/xml/XmlQueryParser.class.php');
1785
+		require_once(_XE_PATH_.'classes/db/DB.class.php');
1786
+		require_once(_XE_PATH_.'classes/db/DBMysql.class.php');
1787
+		require_once(_XE_PATH_.'classes/db/DBMysqli.class.php');
1788
+		require_once(_XE_PATH_.'classes/db/DBMysql_innodb.class.php');
1789
+		require_once(_XE_PATH_.'classes/db/DBCubrid.class.php');
1790
+		require_once(_XE_PATH_.'classes/db/DBMssql.class.php');
1791
+		require_once(_XE_PATH_.'classes/xml/XmlParser.class.php');
1792
+		require_once(_XE_PATH_.'classes/xml/XmlQueryParser.class.php');
1806 1793
 
1807
-		require_once(__DIR__ . '/connect_wrapper.php');
1794
+		require_once(__DIR__.'/connect_wrapper.php');
1808 1795
 
1809 1796
 		// check $query_args, $query_args_file
1810
-		if($query_args_file)
1797
+		if ($query_args_file)
1811 1798
 		{
1812 1799
 			try
1813 1800
 			{
@@ -1821,11 +1808,11 @@  discard block
 block discarded – undo
1821 1808
 		}
1822 1809
 		else
1823 1810
 		{
1824
-			if($query_args)
1811
+			if ($query_args)
1825 1812
 			{
1826 1813
 				try
1827 1814
 				{
1828
-					eval('$query_user_args = array(' . $query_args . ');');
1815
+					eval('$query_user_args = array('.$query_args.');');
1829 1816
 				}
1830 1817
 				catch (Exception $exc)
1831 1818
 				{
@@ -1841,26 +1828,25 @@  discard block
 block discarded – undo
1841 1828
 
1842 1829
 	$schema_file = NULL;
1843 1830
 	$schemas_set =
1844
-		array
1845
-			(
1846
-				'delete' => __DIR__ . '/xml_delete.xsd',
1847
-				'update' => __DIR__ . '/xml_update.xsd',
1848
-				'select' => __DIR__ . '/xml_select.xsd',
1849
-				'insert' => __DIR__ . '/xml_insert.xsd',
1850
-				'insert-select' => __DIR__ . '/xml_insert_select.xsd'
1831
+		array(
1832
+				'delete' => __DIR__.'/xml_delete.xsd',
1833
+				'update' => __DIR__.'/xml_update.xsd',
1834
+				'select' => __DIR__.'/xml_select.xsd',
1835
+				'insert' => __DIR__.'/xml_insert.xsd',
1836
+				'insert-select' => __DIR__.'/xml_insert_select.xsd'
1851 1837
 			);
1852
-	$table_schema = __DIR__ . '/xml_create_table.xsd';
1838
+	$table_schema = __DIR__.'/xml_create_table.xsd';
1853 1839
 
1854 1840
 	$domDocument = new DOMDocument();
1855 1841
 
1856 1842
 	$i = 1;
1857 1843
 
1858
-	if(pathinfo($argv[1], PATHINFO_EXTENSION) == 'xsd')
1844
+	if (pathinfo($argv[1], PATHINFO_EXTENSION) == 'xsd')
1859 1845
 	{
1860 1846
 		$schema_file = $argv[$i++];
1861 1847
 	}
1862 1848
 	
1863
-	for(; $i < count($argv); $i++)
1849
+	for (; $i < count($argv); $i++)
1864 1850
 	{
1865 1851
 		try
1866 1852
 		{
@@ -1869,7 +1855,7 @@  discard block
 block discarded – undo
1869 1855
 			$use_schema_language = $schema_language;
1870 1856
 
1871 1857
 			$retcode->push(ReturnCode::RETCODE_GENERIC_XML_SYNTAX);
1872
-			if($domDocument->load($argv[$i]))
1858
+			if ($domDocument->load($argv[$i]))
1873 1859
 			{
1874 1860
 				$retcode->pop();
1875 1861
 
@@ -1883,7 +1869,7 @@  discard block
 block discarded – undo
1883 1869
 					}
1884 1870
 				}
1885 1871
 
1886
-				if(!$schema_file && !$use_schema_language
1872
+				if (!$schema_file && !$use_schema_language
1887 1873
 							&&
1888 1874
 						(
1889 1875
 							$queryElement->tagName != 'query'
@@ -1895,15 +1881,15 @@  discard block
 block discarded – undo
1895 1881
 
1896 1882
 					throw
1897 1883
 						new ErrorMessage(
1898
-								"{$argv[$i]}:" .
1899
-								"		Root element should be <query> and should have an action attribute of:" .
1900
-								"		insert, insert-select, select, update or delete." .
1901
-								"		Otherwise an explicit schema, to validate the document with, should be" .
1884
+								"{$argv[$i]}:".
1885
+								"		Root element should be <query> and should have an action attribute of:".
1886
+								"		insert, insert-select, select, update or delete.".
1887
+								"		Otherwise an explicit schema, to validate the document with, should be".
1902 1888
 								"		specified as first argument on the command line."
1903 1889
 							);
1904 1890
 				}
1905 1891
 
1906
-				if(!$schema_file && !$use_schema_language && !$skip_query_id
1892
+				if (!$schema_file && !$use_schema_language && !$skip_query_id
1907 1893
 							&&
1908 1894
 						!validate_query_id($argv[$i], $queryElement->getAttribute('id')))
1909 1895
 				{
@@ -1912,28 +1898,28 @@  discard block
 block discarded – undo
1912 1898
 
1913 1899
 					throw
1914 1900
 						new ErrorMessage(
1915
-							"{$argv[$i]}(" . $queryElement->getLineNo() . "):\n\tQuery 'id' attribute value \"{$query_id}\" should match file name."
1901
+							"{$argv[$i]}(".$queryElement->getLineNo()."):\n\tQuery 'id' attribute value \"{$query_id}\" should match file name."
1916 1902
 						);
1917 1903
 				}
1918 1904
 
1919
-				if($use_schema_language)
1905
+				if ($use_schema_language)
1920 1906
 				{
1921 1907
 					$document_schema = $table_schema;
1922 1908
 				}
1923 1909
 				else
1924 1910
 				{
1925
-					if(!$document_schema)
1911
+					if (!$document_schema)
1926 1912
 					{
1927 1913
 						$document_schema = $schemas_set[$queryElement->getAttribute('action')];
1928 1914
 					}
1929 1915
 				}
1930 1916
 
1931 1917
 				$retcode->push(ReturnCode::RETCODE_XSD_VALIDATION);
1932
-				if($domDocument->schemaValidate($document_schema))
1918
+				if ($domDocument->schemaValidate($document_schema))
1933 1919
 				{
1934 1920
 					$retcode->pop();
1935 1921
 
1936
-					if($use_schema_language)
1922
+					if ($use_schema_language)
1937 1923
 					{
1938 1924
 						validate_schema_doc($argv[$i], $domDocument->documentElement);
1939 1925
 					}
@@ -1944,22 +1930,22 @@  discard block
 block discarded – undo
1944 1930
 					$success = TRUE;
1945 1931
 				}
1946 1932
 
1947
-				if(!$validate_only)
1933
+				if (!$validate_only)
1948 1934
 				{
1949 1935
 					// Generate SQL with the db provider back-ends
1950 1936
 
1951
-					if(function_exists('sys_get_temp_dir'))
1937
+					if (function_exists('sys_get_temp_dir'))
1952 1938
 					{
1953 1939
 						$tmpdir = sys_get_temp_dir();
1954 1940
 					}
1955 1941
 					else
1956 1942
 					{
1957 1943
 						$tmpdir = getenv('TEMP');
1958
-						if(!$tmpdir)
1944
+						if (!$tmpdir)
1959 1945
 						{
1960 1946
 							$tmpdir = getenv('TMP');
1961 1947
 						}
1962
-						if(!$tmpdir)
1948
+						if (!$tmpdir)
1963 1949
 						{
1964 1950
 							$tmpdir = '/tmp';
1965 1951
 						}
@@ -1968,30 +1954,29 @@  discard block
 block discarded – undo
1968 1954
 
1969 1955
 					global $_SERVER;
1970 1956
 
1971
-					if(!is_array($_SERVER))
1957
+					if (!is_array($_SERVER))
1972 1958
 					{
1973 1959
 						$_SERVER = array();
1974 1960
 					}
1975 1961
 
1976
-					if(!array_key_exists('REMOTE_ADDR', $_SERVER))
1962
+					if (!array_key_exists('REMOTE_ADDR', $_SERVER))
1977 1963
 					{
1978 1964
 						$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
1979 1965
 					}
1980 1966
 
1981 1967
 					$set_db_info_methods =
1982
-						array
1983
-							(
1968
+						array(
1984 1969
 								'mysql'		=> 'setMysqlDBInfo',
1985 1970
 								'mysqli'	=> 'setMysqliDBInfo',
1986 1971
 								'cubrid'	=> 'setCubridDBInfo',
1987 1972
 								'mssql'		=> 'setMssqlDBInfo'
1988 1973
 							);
1989 1974
 
1990
-					foreach($set_db_info_methods as $db_type => $set_info_method)
1975
+					foreach ($set_db_info_methods as $db_type => $set_info_method)
1991 1976
 					{
1992 1977
 						Context::$set_info_method(); // calls setMysqlDBInfo()/setCubridDBInfo()/...
1993 1978
 
1994
-						if($use_schema_language)
1979
+						if ($use_schema_language)
1995 1980
 						{
1996 1981
 							$GLOBALS['__DB__'][$db_type]->queries = '';
1997 1982
 							$GLOBALS['__DB__'][$db_type]->createTableByXmlFile($argv[$i]);
@@ -2010,39 +1995,38 @@  discard block
 block discarded – undo
2010 1995
 							// copied from classes/db/DB.class.php
2011 1996
 							$oParser = new XmlQueryParser();
2012 1997
 							$args_array =
2013
-								$oParser->parse_xml_query
2014
-									(
1998
+								$oParser->parse_xml_query(
2015 1999
 										pathinfo($argv[$i], PATHINFO_FILENAME), // query id
2016
-										$argv[$i],								// xml file
2000
+										$argv[$i], // xml file
2017 2001
 										$unlink_tmpfile->file_name				// cache file
2018 2002
 									);
2019 2003
 							$args_array = $args_array->queryTag->getArguments();
2020 2004
 
2021 2005
 							$GLOBALS['__DB__'][$db_type]->queries = '';
2022 2006
 							$k = 1;
2023
-							foreach($args_array as $arg)
2007
+							foreach ($args_array as $arg)
2024 2008
 							{
2025
-								if(// why would there be a query arg without a var name ?
2009
+								if (// why would there be a query arg without a var name ?
2026 2010
 										isset($arg->variable_name)
2027 2011
 											&&
2028 2012
 										!array_key_exists($arg->variable_name, $query_user_args))
2029 2013
 								{
2030
-									if(isset($arg->argument_validator))
2014
+									if (isset($arg->argument_validator))
2031 2015
 									{
2032
-										if(FALSE	// some default values are to be parsed by php, some are not...
2016
+										if (FALSE	// some default values are to be parsed by php, some are not...
2033 2017
 													&&
2034 2018
 												isset($arg->argument_validator->default_value)
2035 2019
 													&&
2036 2020
 												isset($arg->argument_validator->default_value->value))
2037 2021
 										{
2038 2022
 											$query_user_args[$arg->variable_name] =
2039
-												eval('return ' . $arg->argument_validator->default_value->toString() . ';');
2023
+												eval('return '.$arg->argument_validator->default_value->toString().';');
2040 2024
 										}
2041 2025
 										else
2042 2026
 										{
2043
-											if($arg->argument_validator->filter)
2027
+											if ($arg->argument_validator->filter)
2044 2028
 											{
2045
-												switch($arg->argument_validator->filter)
2029
+												switch ($arg->argument_validator->filter)
2046 2030
 												{
2047 2031
 													case 'email':
2048 2032
 													case 'email_address':
@@ -2081,18 +2065,17 @@  discard block
 block discarded – undo
2081 2065
 										}
2082 2066
 									}
2083 2067
 
2084
-									if(!array_key_exists($arg->variable_name, $query_user_args))
2068
+									if (!array_key_exists($arg->variable_name, $query_user_args))
2085 2069
 									{
2086 2070
 										$query_user_args[$arg->variable_name] = sprintf('%06d', $k);
2087 2071
 									}
2088 2072
 
2089
-									if(isset($arg->argument_validator))
2073
+									if (isset($arg->argument_validator))
2090 2074
 									{
2091
-										if(isset($arg->argument_validator->min_length))
2075
+										if (isset($arg->argument_validator->min_length))
2092 2076
 										{
2093 2077
 											$query_user_args[$arg->variable_name] =
2094
-												str_pad
2095
-													(
2078
+												str_pad(
2096 2079
 														$query_user_args[$arg->variable_name],
2097 2080
 														$arg->argument_validator->min_length,
2098 2081
 														isset($arg->argument_validator->filter) &&
@@ -2105,11 +2088,10 @@  discard block
 block discarded – undo
2105 2088
 													);
2106 2089
 										}
2107 2090
 
2108
-										if(isset($arg->argument_validator->max_length))
2091
+										if (isset($arg->argument_validator->max_length))
2109 2092
 										{
2110 2093
 											$query_user_args[$arg->variable_name] =
2111
-												substr
2112
-													(
2094
+												substr(
2113 2095
 														$query_user_args[$arg->variable_name],
2114 2096
 														0, 
2115 2097
 														$arg->argument_validator->max_length
@@ -2122,15 +2104,14 @@  discard block
 block discarded – undo
2122 2104
 							}
2123 2105
 
2124 2106
 							$resultset = 
2125
-								$GLOBALS['__DB__'][$db_type]->_executeQuery
2126
-									(
2127
-										$unlink_tmpfile->file_name,		// cache_file
2128
-										(object)$query_user_args,		// source_args
2129
-										basename($argv[$i]),			// query_id
2107
+								$GLOBALS['__DB__'][$db_type]->_executeQuery(
2108
+										$unlink_tmpfile->file_name, // cache_file
2109
+										(object) $query_user_args, // source_args
2110
+										basename($argv[$i]), // query_id
2130 2111
 										array()							// arg_columns
2131 2112
 									);
2132 2113
 
2133
-							if(is_a($resultset, 'BaseObject') && !$resultset->toBool())
2114
+							if (is_a($resultset, 'BaseObject') && !$resultset->toBool())
2134 2115
 							{
2135 2116
 								throw new XmlSchemaError($argv[$i], -1, 'mysql SQL query generation failed');
2136 2117
 							}
@@ -2147,7 +2128,7 @@  discard block
 block discarded – undo
2147 2128
 				}
2148 2129
 			}
2149 2130
 
2150
-			if(!$success)
2131
+			if (!$success)
2151 2132
 			{
2152 2133
 				libXmlDisplayError($argv[$i], TRUE);
2153 2134
 			}
@@ -2156,21 +2137,21 @@  discard block
 block discarded – undo
2156 2137
 		{
2157 2138
 			$retcode->code(ReturnCode::RETCODE_BUILTIN_CHECKS);
2158 2139
 
2159
-			fwrite(STDERR, $exc->getMessage() . "\n");
2140
+			fwrite(STDERR, $exc->getMessage()."\n");
2160 2141
 		}
2161 2142
 		catch (ErrorMessage $exc)
2162 2143
 		{
2163
-			if($retcode->code() == ReturnCode::RETCODE_SUCCESS)
2144
+			if ($retcode->code() == ReturnCode::RETCODE_SUCCESS)
2164 2145
 			{
2165 2146
 				$retcode->code(ReturnCode::RETCODE_VALIDATOR_INTERNAL);
2166 2147
 			}
2167 2148
 
2168
-			fwrite(STDERR, $exc->getMessage() . "\n");
2149
+			fwrite(STDERR, $exc->getMessage()."\n");
2169 2150
 			libXmlDisplayError($argv[$i]);
2170 2151
 		}
2171 2152
 		catch (ErrorException $exc)
2172 2153
 		{
2173
-			if($retcode->code() == ReturnCode::RETCODE_SUCCESS)
2154
+			if ($retcode->code() == ReturnCode::RETCODE_SUCCESS)
2174 2155
 			{
2175 2156
 				$retcode->code(ReturnCode::RETCODE_VALIDATOR_INTERNAL);
2176 2157
 			}
@@ -2183,7 +2164,7 @@  discard block
 block discarded – undo
2183 2164
 		{
2184 2165
 			$retcode->code(ReturnCode::RETCODE_VALIDATOR_INTERNAL);
2185 2166
 
2186
-			fwrite(STDERR, $exc->getMessage() . "\n");
2167
+			fwrite(STDERR, $exc->getMessage()."\n");
2187 2168
 			fwrite(STDERR, $exc->getTraceAsString());
2188 2169
 			libXmlDisplayError($argv[$i]);
2189 2170
 		}
@@ -2193,22 +2174,22 @@  discard block
 block discarded – undo
2193 2174
 }
2194 2175
 catch (SyntaxError $syntax)
2195 2176
 {
2196
-	fwrite(STDERR, $syntax->getMessage() . "\n");
2197
-	exit(254);	// wrong command line
2177
+	fwrite(STDERR, $syntax->getMessage()."\n");
2178
+	exit(254); // wrong command line
2198 2179
 				// 255 is reserved by php (for parse errors, etc.)
2199 2180
 }
2200 2181
 catch (ErrorMessage $exc)
2201 2182
 {
2202
-	fwrite(STDERR, $exc->getMessage() . "\n");
2183
+	fwrite(STDERR, $exc->getMessage()."\n");
2203 2184
 	libXmlDisplayError();
2204
-	exit(ReturnCode::RETCODE_VALIDATOR_INTERNAL);		// internal validator error
2185
+	exit(ReturnCode::RETCODE_VALIDATOR_INTERNAL); // internal validator error
2205 2186
 }
2206 2187
 catch (Exception $exc)
2207 2188
 {
2208
-	fwrite(STDERR, $exc->getFile() . '(' . $exc->getLine() . ")\n\t" . $exc->getMessage() . "\n");
2189
+	fwrite(STDERR, $exc->getFile().'('.$exc->getLine().")\n\t".$exc->getMessage()."\n");
2209 2190
 	fwrite(STDERR, $exc->getTraceAsString());
2210 2191
 	libXmlDisplayError();
2211
-	exit(ReturnCode::RETCODE_VALIDATOR_INTERNAL);		// internal validator error
2192
+	exit(ReturnCode::RETCODE_VALIDATOR_INTERNAL); // internal validator error
2212 2193
 }
2213 2194
 
2214 2195
 /* End of file validate.php */
Please login to merge, or discard this patch.
Braces   +33 added lines, -66 removed lines patch added patch discarded remove patch
@@ -150,13 +150,11 @@  discard block
 block discarded – undo
150 150
 		if($throw_error)
151 151
 		{
152 152
 			throw new ErrorMessage($msg);
153
-		}
154
-		else
153
+		} else
155 154
 		{
156 155
 			fwrite(STDERR, $msg . "\n");
157 156
 		}
158
-	}
159
-	else
157
+	} else
160 158
 	{
161 159
 		if($throw_error)
162 160
 		{
@@ -346,8 +344,7 @@  discard block
 block discarded – undo
346 344
 					"\nANSI SQL-99 declares the table specification as required."
347 345
 				);
348 346
 		}
349
-	}
350
-	else
347
+	} else
351 348
 	{
352 349
 		// base table or view
353 350
 
@@ -369,13 +366,11 @@  discard block
 block discarded – undo
369 366
 									$child_node->getLineNo(),
370 367
 									'Duplicate <conditions> elements.'
371 368
 								);
372
-						}
373
-						else
369
+						} else
374 370
 						{
375 371
 							$has_conditions_element = TRUE;
376 372
 						}
377
-					}
378
-					else
373
+					} else
379 374
 					{
380 375
 						throw
381 376
 							new XmlSchemaError(
@@ -396,8 +391,7 @@  discard block
 block discarded – undo
396 391
 						'Expected <conditions> element as content.'
397 392
 					);
398 393
 			}
399
-		}
400
-		else
394
+		} else
401 395
 		{
402 396
 			foreach($table_element->childNodes as $child_node)
403 397
 			{
@@ -609,8 +603,7 @@  discard block
 block discarded – undo
609 603
 			if($first_child)
610 604
 			{
611 605
 				$first_child = FALSE;
612
-			}
613
-			else
606
+			} else
614 607
 			{
615 608
 				if(!$child_node->hasAttribute('pipe'))
616 609
 				{
@@ -629,14 +622,12 @@  discard block
 block discarded – undo
629 622
 			if($child_node->tagName == 'group')
630 623
 			{
631 624
 				checkConditionsGroup($xml_file, $child_node);
632
-			}
633
-			else
625
+			} else
634 626
 			{
635 627
 				if($child_node->tagName == 'query')
636 628
 				{
637 629
 					validate_select_query($xml_file, $child_node);
638
-				}
639
-				else
630
+				} else
640 631
 				{
641 632
 					if($child_node->tagName == 'condition')
642 633
 					{
@@ -851,8 +842,7 @@  discard block
 block discarded – undo
851 842
 			try
852 843
 			{
853 844
 				$success = chdir($this->dirname);
854
-			}
855
-			catch (Exception $e)
845
+			} catch (Exception $e)
856 846
 			{
857 847
 				print "Failed to restore working dir {$this->dirname}.";
858 848
 			}
@@ -921,8 +911,7 @@  discard block
 block discarded – undo
921 911
 		if($lowercase_name[$i] != $uppercase_name[$i])
922 912
 		{
923 913
 			$varing_case_filename .= "[{$lowercase_name[$i]}{$uppercase_name[$i]}]";
924
-		}
925
-		else
914
+		} else
926 915
 		{
927 916
 			$varing_case_filename .= $lowercase_name[$i];
928 917
 		}
@@ -1119,8 +1108,7 @@  discard block
 block discarded – undo
1119 1108
 		if($val == -1)
1120 1109
 		{
1121 1110
 			return $this->exit_code;
1122
-		}
1123
-		else
1111
+		} else
1124 1112
 		{
1125 1113
 			if($this->exit_code < $val)
1126 1114
 			{
@@ -1488,8 +1476,7 @@  discard block
 block discarded – undo
1488 1476
 				if(self::$db_info)
1489 1477
 				{
1490 1478
 					return self::$db_info->master_db['db_type'];
1491
-				}
1492
-				else
1479
+				} else
1493 1480
 				{
1494 1481
 					return NULL;
1495 1482
 				}
@@ -1588,8 +1575,7 @@  discard block
 block discarded – undo
1588 1575
 							&&
1589 1576
 						array_key_exists($db_info->master_db['db_type'], $GLOBALS['__DB__']))
1590 1577
 				{
1591
-				}
1592
-				else
1578
+				} else
1593 1579
 				{
1594 1580
 					$GLOBALS['__DB__'][$db_info->master_db['db_type']] =
1595 1581
 						new DBMysqlConnectWrapper();
@@ -1630,8 +1616,7 @@  discard block
 block discarded – undo
1630 1616
 							&&
1631 1617
 						array_key_exists($db_info->master_db['db_type'], $GLOBALS['__DB__']))
1632 1618
 				{
1633
-				}
1634
-				else
1619
+				} else
1635 1620
 				{
1636 1621
 					$GLOBALS['__DB__'][$db_info->master_db['db_type']] =
1637 1622
 						new DBMysqliConnectWrapper();
@@ -1672,8 +1657,7 @@  discard block
 block discarded – undo
1672 1657
 							&&
1673 1658
 						array_key_exists($db_info->master_db['db_type'], $GLOBALS['__DB__']))
1674 1659
 				{
1675
-				}
1676
-				else
1660
+				} else
1677 1661
 				{
1678 1662
 					$GLOBALS['__DB__'][$db_info->master_db['db_type']] =
1679 1663
 						new DBCubridConnectWrapper();
@@ -1714,8 +1698,7 @@  discard block
 block discarded – undo
1714 1698
 							&&
1715 1699
 						array_key_exists($db_info->master_db['db_type'], $GLOBALS['__DB__']))
1716 1700
 				{
1717
-				}
1718
-				else
1701
+				} else
1719 1702
 				{
1720 1703
 					$GLOBALS['__DB__'][$db_info->master_db['db_type']] =
1721 1704
 						new DBMssqlConnectWrapper();
@@ -1812,22 +1795,19 @@  discard block
 block discarded – undo
1812 1795
 			try
1813 1796
 			{
1814 1797
 				$query_user_args = require($query_args_file);
1815
-			}
1816
-			catch (Exception $exc)
1798
+			} catch (Exception $exc)
1817 1799
 			{
1818 1800
 				fwrite(STDERR, "Error in arguments file.\n");
1819 1801
 				throw $exc;
1820 1802
 			}
1821
-		}
1822
-		else
1803
+		} else
1823 1804
 		{
1824 1805
 			if($query_args)
1825 1806
 			{
1826 1807
 				try
1827 1808
 				{
1828 1809
 					eval('$query_user_args = array(' . $query_args . ');');
1829
-				}
1830
-				catch (Exception $exc)
1810
+				} catch (Exception $exc)
1831 1811
 				{
1832 1812
 					fwrite(STDERR, "Error in arguments string.\n");
1833 1813
 					throw $exc;
@@ -1919,8 +1899,7 @@  discard block
 block discarded – undo
1919 1899
 				if($use_schema_language)
1920 1900
 				{
1921 1901
 					$document_schema = $table_schema;
1922
-				}
1923
-				else
1902
+				} else
1924 1903
 				{
1925 1904
 					if(!$document_schema)
1926 1905
 					{
@@ -1936,8 +1915,7 @@  discard block
 block discarded – undo
1936 1915
 					if($use_schema_language)
1937 1916
 					{
1938 1917
 						validate_schema_doc($argv[$i], $domDocument->documentElement);
1939
-					}
1940
-					else
1918
+					} else
1941 1919
 					{
1942 1920
 						validate_xml_query($argv[$i], $domDocument->documentElement);
1943 1921
 					}
@@ -1951,8 +1929,7 @@  discard block
 block discarded – undo
1951 1929
 					if(function_exists('sys_get_temp_dir'))
1952 1930
 					{
1953 1931
 						$tmpdir = sys_get_temp_dir();
1954
-					}
1955
-					else
1932
+					} else
1956 1933
 					{
1957 1934
 						$tmpdir = getenv('TEMP');
1958 1935
 						if(!$tmpdir)
@@ -2001,8 +1978,7 @@  discard block
 block discarded – undo
2001 1978
 							print " {$db_type} query:\n";
2002 1979
 							print $GLOBALS['__DB__'][$db_type]->queries;
2003 1980
 							print "\n";
2004
-						}
2005
-						else
1981
+						} else
2006 1982
 						{
2007 1983
 							$unlink_tmpfile =
2008 1984
 								new UnlinkFile(tempnam($tmpdir, 'xe_'));
@@ -2037,8 +2013,7 @@  discard block
 block discarded – undo
2037 2013
 										{
2038 2014
 											$query_user_args[$arg->variable_name] =
2039 2015
 												eval('return ' . $arg->argument_validator->default_value->toString() . ';');
2040
-										}
2041
-										else
2016
+										} else
2042 2017
 										{
2043 2018
 											if($arg->argument_validator->filter)
2044 2019
 											{
@@ -2133,8 +2108,7 @@  discard block
 block discarded – undo
2133 2108
 							if(is_a($resultset, 'BaseObject') && !$resultset->toBool())
2134 2109
 							{
2135 2110
 								throw new XmlSchemaError($argv[$i], -1, 'mysql SQL query generation failed');
2136
-							}
2137
-							else
2111
+							} else
2138 2112
 							{
2139 2113
 								print "\n";
2140 2114
 								print pathinfo($argv[$i], PATHINFO_FILENAME);
@@ -2151,14 +2125,12 @@  discard block
 block discarded – undo
2151 2125
 			{
2152 2126
 				libXmlDisplayError($argv[$i], TRUE);
2153 2127
 			}
2154
-		}
2155
-		catch (XmlSchemaError $exc)
2128
+		} catch (XmlSchemaError $exc)
2156 2129
 		{
2157 2130
 			$retcode->code(ReturnCode::RETCODE_BUILTIN_CHECKS);
2158 2131
 
2159 2132
 			fwrite(STDERR, $exc->getMessage() . "\n");
2160
-		}
2161
-		catch (ErrorMessage $exc)
2133
+		} catch (ErrorMessage $exc)
2162 2134
 		{
2163 2135
 			if($retcode->code() == ReturnCode::RETCODE_SUCCESS)
2164 2136
 			{
@@ -2167,8 +2139,7 @@  discard block
 block discarded – undo
2167 2139
 
2168 2140
 			fwrite(STDERR, $exc->getMessage() . "\n");
2169 2141
 			libXmlDisplayError($argv[$i]);
2170
-		}
2171
-		catch (ErrorException $exc)
2142
+		} catch (ErrorException $exc)
2172 2143
 		{
2173 2144
 			if($retcode->code() == ReturnCode::RETCODE_SUCCESS)
2174 2145
 			{
@@ -2178,8 +2149,7 @@  discard block
 block discarded – undo
2178 2149
 			fwrite(STDERR, "{$exc->getFile()}({$exc->getLine()}):\n\t{$exc->getMessage()}.\n");
2179 2150
 			fwrite(STDERR, $exc->getTraceAsString());
2180 2151
 			libXmlDisplayError($argv[$i]);
2181
-		}
2182
-		catch (Exception $exc)
2152
+		} catch (Exception $exc)
2183 2153
 		{
2184 2154
 			$retcode->code(ReturnCode::RETCODE_VALIDATOR_INTERNAL);
2185 2155
 
@@ -2190,20 +2160,17 @@  discard block
 block discarded – undo
2190 2160
 	}
2191 2161
 
2192 2162
 	exit($retcode->code());
2193
-}
2194
-catch (SyntaxError $syntax)
2163
+} catch (SyntaxError $syntax)
2195 2164
 {
2196 2165
 	fwrite(STDERR, $syntax->getMessage() . "\n");
2197 2166
 	exit(254);	// wrong command line
2198 2167
 				// 255 is reserved by php (for parse errors, etc.)
2199
-}
2200
-catch (ErrorMessage $exc)
2168
+} catch (ErrorMessage $exc)
2201 2169
 {
2202 2170
 	fwrite(STDERR, $exc->getMessage() . "\n");
2203 2171
 	libXmlDisplayError();
2204 2172
 	exit(ReturnCode::RETCODE_VALIDATOR_INTERNAL);		// internal validator error
2205
-}
2206
-catch (Exception $exc)
2173
+} catch (Exception $exc)
2207 2174
 {
2208 2175
 	fwrite(STDERR, $exc->getFile() . '(' . $exc->getLine() . ")\n\t" . $exc->getMessage() . "\n");
2209 2176
 	fwrite(STDERR, $exc->getTraceAsString());
Please login to merge, or discard this patch.
addons/adminlogging/adminlogging.addon.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 
4
-if(!defined('__XE__'))
4
+if (!defined('__XE__'))
5 5
 	exit();
6 6
 
7 7
 /**
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  * @brief admin log
11 11
  */
12 12
 $logged_info = Context::get('logged_info');
13
-if($logged_info && $logged_info->is_admin == 'Y' && stripos(Context::get('act'), 'admin') !== false && $called_position == 'before_module_proc')
13
+if ($logged_info && $logged_info->is_admin == 'Y' && stripos(Context::get('act'), 'admin') !== false && $called_position == 'before_module_proc')
14 14
 {
15 15
 	$oAdminloggingController = getController('adminlogging');
16 16
 	$oAdminloggingController->insertLog($this->module, $this->act);
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,8 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 
4
-if(!defined('__XE__'))
4
+if(!defined('__XE__')) {
5 5
 	exit();
6
+}
6 7
 
7 8
 /**
8 9
  * @file adminlogging.addon.php
Please login to merge, or discard this patch.
addons/autolink/autolink.addon.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,8 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 
4
-if(!defined('__XE__'))
4
+if(!defined('__XE__')) {
5 5
 	exit();
6
+}
6 7
 
7 8
 /**
8 9
  * @file autolink.addon.php
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 
4
-if(!defined('__XE__'))
4
+if (!defined('__XE__'))
5 5
 	exit();
6 6
 
7 7
 /**
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @author NAVER ([email protected])
10 10
  * @brief Automatic link add-on
11 11
  */
12
-if($called_position == 'after_module_proc' && Context::getResponseMethod() == "HTML")
12
+if ($called_position == 'after_module_proc' && Context::getResponseMethod() == "HTML")
13 13
 {
14 14
 	Context::loadFile(array('./addons/autolink/autolink.js', 'body', '', null), true);
15 15
 }
Please login to merge, or discard this patch.
addons/captcha_member/captcha_member.addon.php 3 patches
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,7 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 
4
-if(!defined("__XE__")) exit();
4
+if(!defined("__XE__")) {
5
+	exit();
6
+}
5 7
 
6 8
 /**
7 9
  * @file captcha.addon.php
@@ -85,8 +87,7 @@  discard block
 block discarded – undo
85 87
 						$_SESSION['XE_VALIDATOR_RETURN_URL'] = Context::get('error_return_url');
86 88
 						$ModuleHandler->_setInputValueToSession();
87 89
 					}
88
-				}
89
-				else
90
+				} else
90 91
 				{
91 92
 					Context::addHtmlHeader('<script>
92 93
 						if(!captchaTargetAct) {var captchaTargetAct = [];}
@@ -216,8 +217,7 @@  discard block
 block discarded – undo
216 217
 
217 218
 					$background_color = imagecolorallocate($im[$i + 1], 255, 255, 255);
218 219
 					imagecolortransparent($im[$i + 1], $background_color);
219
-				}
220
-				else
220
+				} else
221 221
 				{
222 222
 					imagestring($im[$i + 1], (array_pop($ran) % 3) + 3, 2, (array_pop($ran) % 4), $str, $text_color);
223 223
 				}
@@ -315,7 +315,9 @@  discard block
 block discarded – undo
315 315
 
316 316
 		function compareCaptcha()
317 317
 		{
318
-			if(!in_array(Context::get('act'), $this->target_acts)) return true;
318
+			if(!in_array(Context::get('act'), $this->target_acts)) {
319
+				return true;
320
+			}
319 321
 
320 322
 			if($_SESSION['member_captcha_authed'])
321 323
 			{
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -275,6 +275,9 @@
 block discarded – undo
275 275
 			exit();
276 276
 		}
277 277
 
278
+		/**
279
+		 * @param string $string
280
+		 */
278 281
 		function createCaptchaAudio($string)
279 282
 		{
280 283
 			$data = '';
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 
4
-if(!defined("__XE__")) exit();
4
+if (!defined("__XE__")) exit();
5 5
 
6 6
 /**
7 7
  * @file captcha.addon.php
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @brief Captcha for a particular action
10 10
  * English alphabets and voice verification added
11 11
  * */
12
-if(!class_exists('AddonMemberCaptcha', false))
12
+if (!class_exists('AddonMemberCaptcha', false))
13 13
 {
14 14
 	class AddonMemberCaptcha
15 15
 	{
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 		function before_module_init(&$ModuleHandler)
33 33
 		{
34 34
 			$logged_info = Context::get('logged_info');
35
-			if($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)
35
+			if ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)
36 36
 			{
37 37
 				return false;
38 38
 			}
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
 			// {
41 41
 			// 	return false;
42 42
 			// }
43
-			if($_SESSION['XE_VALIDATOR_ERROR'] == -1)
43
+			if ($_SESSION['XE_VALIDATOR_ERROR'] == -1)
44 44
 			{
45 45
 				$_SESSION['member_captcha_authed'] = false;
46 46
 			}
47
-			if($_SESSION['member_captcha_authed'])
47
+			if ($_SESSION['member_captcha_authed'])
48 48
 			{
49 49
 				return false;
50 50
 			}
@@ -52,26 +52,26 @@  discard block
 block discarded – undo
52 52
 			$type = Context::get('captchaType');
53 53
 
54 54
 			$this->target_acts = array();
55
-			if($this->addon_info->apply_find_account == 'apply')
55
+			if ($this->addon_info->apply_find_account == 'apply')
56 56
 			{
57 57
 				$this->target_acts[] = 'procMemberFindAccount';
58 58
 			}
59
-			if($this->addon_info->apply_resend_auth_mail == 'apply')
59
+			if ($this->addon_info->apply_resend_auth_mail == 'apply')
60 60
 			{
61 61
 				$this->target_acts[] = 'procMemberResendAuthMail';
62 62
 			}
63
-			if($this->addon_info->apply_signup == 'apply')
63
+			if ($this->addon_info->apply_signup == 'apply')
64 64
 			{
65 65
 				$this->target_acts[] = 'procMemberInsert';
66 66
 			}
67 67
 
68
-			if(Context::getRequestMethod() != 'XMLRPC' && Context::getRequestMethod() !== 'JSON')
68
+			if (Context::getRequestMethod() != 'XMLRPC' && Context::getRequestMethod() !== 'JSON')
69 69
 			{
70
-				if($type == 'inline')
70
+				if ($type == 'inline')
71 71
 				{
72
-					if(!$this->compareCaptcha())
72
+					if (!$this->compareCaptcha())
73 73
 					{
74
-						Context::loadLang(_XE_PATH_ . 'addons/captcha_member/lang');
74
+						Context::loadLang(_XE_PATH_.'addons/captcha_member/lang');
75 75
 						$_SESSION['XE_VALIDATOR_ERROR'] = -1;
76 76
 						$_SESSION['XE_VALIDATOR_MESSAGE'] = Context::getLang('captcha_denied');
77 77
 						$_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error';
@@ -83,16 +83,16 @@  discard block
 block discarded – undo
83 83
 				{
84 84
 					Context::addHtmlHeader('<script>
85 85
 						if(!captchaTargetAct) {var captchaTargetAct = [];}
86
-						captchaTargetAct.push("' . implode('","', $this->target_acts) . '");
86
+						captchaTargetAct.push("' . implode('","', $this->target_acts).'");
87 87
 						</script>');
88 88
 					Context::loadFile(array('./addons/captcha/captcha.min.js', 'body', '', null), true);
89 89
 				}
90 90
 			}
91 91
 
92 92
 			// compare session when calling actions such as writing a post or a comment on the board/issue tracker module
93
-			if(!$_SESSION['member_captcha_authed'] && in_array(Context::get('act'), $this->target_acts))
93
+			if (!$_SESSION['member_captcha_authed'] && in_array(Context::get('act'), $this->target_acts))
94 94
 			{
95
-				Context::loadLang(_XE_PATH_ . 'addons/captcha_member/lang');
95
+				Context::loadLang(_XE_PATH_.'addons/captcha_member/lang');
96 96
 				$ModuleHandler->error = "captcha_denied";
97 97
 			}
98 98
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		function createKeyword()
103 103
 		{
104 104
 			$type = Context::get('captchaType');
105
-			if($type == 'inline' && $_SESSION['captcha_keyword'])
105
+			if ($type == 'inline' && $_SESSION['captcha_keyword'])
106 106
 			{
107 107
 				return;
108 108
 			}
@@ -115,19 +115,19 @@  discard block
 block discarded – undo
115 115
 
116 116
 		function before_module_init_setCaptchaSession()
117 117
 		{
118
-			if($_SESSION['member_captcha_authed'])
118
+			if ($_SESSION['member_captcha_authed'])
119 119
 			{
120 120
 				return false;
121 121
 			}
122 122
 			// Load language files
123
-			Context::loadLang(_XE_PATH_ . 'addons/captcha_member/lang');
123
+			Context::loadLang(_XE_PATH_.'addons/captcha_member/lang');
124 124
 			// Generate keywords
125 125
 			$this->createKeyword();
126 126
 
127 127
 			$target = Context::getLang('target_captcha');
128 128
 			header("Content-Type: text/xml; charset=UTF-8");
129 129
 			header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
130
-			header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
130
+			header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
131 131
 			header("Cache-Control: no-store, no-cache, must-revalidate");
132 132
 			header("Cache-Control: post-check=0, pre-check=0", false);
133 133
 			header("Pragma: no-cache");
@@ -144,11 +144,11 @@  discard block
 block discarded – undo
144 144
 
145 145
 		function before_module_init_captchaImage()
146 146
 		{
147
-			if($_SESSION['member_captcha_authed'])
147
+			if ($_SESSION['member_captcha_authed'])
148 148
 			{
149 149
 				return false;
150 150
 			}
151
-			if(Context::get('renew'))
151
+			if (Context::get('renew'))
152 152
 			{
153 153
 				$this->createKeyword();
154 154
 			}
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 		function createCaptchaImage($string)
171 171
 		{
172 172
 			$arr = array();
173
-			for($i = 0, $c = strlen($string); $i < $c; $i++)
173
+			for ($i = 0, $c = strlen($string); $i < $c; $i++)
174 174
 			{
175 175
 				$arr[] = $string{$i};
176 176
 			}
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 			shuffle($deg);
193 193
 
194 194
 			// Create an image for each letter
195
-			foreach($arr as $i => $str)
195
+			foreach ($arr as $i => $str)
196 196
 			{
197 197
 				$im[$i + 1] = @imagecreate($w, $h);
198 198
 				$background_color = imagecolorallocate($im[$i + 1], 255, 255, 255);
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 				$ran = range(1, 20);
203 203
 				shuffle($ran);
204 204
 
205
-				if(function_exists('imagerotate'))
205
+				if (function_exists('imagerotate'))
206 206
 				{
207 207
 					imagestring($im[$i + 1], (array_pop($ran) % 3) + 3, 2, (array_pop($ran) % 8), $str, $text_color);
208 208
 					$im[$i + 1] = imagerotate($im[$i + 1], array_pop($deg), 0);
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 			}
218 218
 
219 219
 			// Combine images of each character
220
-			for($i = 1; $i < count($im); $i++)
220
+			for ($i = 1; $i < count($im); $i++)
221 221
 			{
222 222
 				imagecopy($im[0], $im[$i], (($w + 2) * ($i - 1)), 0, 0, 0, $w, $h);
223 223
 				imagedestroy($im[$i]);
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 			imagecopyresized($big, $im[0], 0, 0, 0, 0, ($w + 2) * $big_count * $c, $h * $big_count, ($w + 2) * $c, $h);
230 230
 			imagedestroy($im[0]);
231 231
 
232
-			if(function_exists('imageantialias'))
232
+			if (function_exists('imageantialias'))
233 233
 			{
234 234
 				imageantialias($big, true);
235 235
 			}
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 			$h = $h * $big_count;
242 242
 			$d = array_pop($deg);
243 243
 
244
-			for($i = -abs($d); $i < $h + abs($d); $i = $i + 7)
244
+			for ($i = -abs($d); $i < $h + abs($d); $i = $i + 7)
245 245
 			{
246 246
 				imageline($big, 0, $i + $d, $w, $i, $line_color);
247 247
 			}
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 			$x = range(0, ($w - 10));
250 250
 			shuffle($x);
251 251
 
252
-			for($i = 0; $i < 200; $i++)
252
+			for ($i = 0; $i < 200; $i++)
253 253
 			{
254 254
 				imagesetpixel($big, $x[$i] % $w, $x[$i + 1] % $h, $line_color);
255 255
 			}
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 
260 260
 		function before_module_init_captchaAudio()
261 261
 		{
262
-			if($_SESSION['member_captcha_authed'])
262
+			if ($_SESSION['member_captcha_authed'])
263 263
 			{
264 264
 				return false;
265 265
 			}
@@ -271,8 +271,8 @@  discard block
 block discarded – undo
271 271
 			header("Content-Disposition: attachment; filename=\"captcha_audio.mp3\"");
272 272
 			header('Cache-Control: no-store, no-cache, must-revalidate');
273 273
 			header('Expires: Sun, 1 Jan 2000 12:00:00 GMT');
274
-			header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
275
-			header('Content-Length: ' . strlen($data));
274
+			header('Last-Modified: '.gmdate('D, d M Y H:i:s').'GMT');
275
+			header('Content-Length: '.strlen($data));
276 276
 
277 277
 			echo $data;
278 278
 			Context::close();
@@ -283,17 +283,17 @@  discard block
 block discarded – undo
283 283
 		{
284 284
 			$data = '';
285 285
 			$_audio = './addons/captcha/audio/F_%s.mp3';
286
-			for($i = 0, $c = strlen($string); $i < $c; $i++)
286
+			for ($i = 0, $c = strlen($string); $i < $c; $i++)
287 287
 			{
288 288
 				$_data = FileHandler::readFile(sprintf($_audio, $string{$i}));
289 289
 
290 290
 				$start = rand(5, 68); // Random start in 4-byte header and 64 byte data
291 291
 				$datalen = strlen($_data) - $start - 256; // Last unchanged 256 bytes
292 292
 
293
-				for($j = $start; $j < $datalen; $j+=64)
293
+				for ($j = $start; $j < $datalen; $j += 64)
294 294
 				{
295 295
 					$ch = ord($_data{$j});
296
-					if($ch < 9 || $ch > 119)
296
+					if ($ch < 9 || $ch > 119)
297 297
 					{
298 298
 						continue;
299 299
 					}
@@ -308,14 +308,14 @@  discard block
 block discarded – undo
308 308
 
309 309
 		function compareCaptcha()
310 310
 		{
311
-			if(!in_array(Context::get('act'), $this->target_acts)) return true;
311
+			if (!in_array(Context::get('act'), $this->target_acts)) return true;
312 312
 
313
-			if($_SESSION['member_captcha_authed'])
313
+			if ($_SESSION['member_captcha_authed'])
314 314
 			{
315 315
 				return true;
316 316
 			}
317 317
 
318
-			if(strtoupper($_SESSION['captcha_keyword']) == strtoupper(Context::get('secret_text')))
318
+			if (strtoupper($_SESSION['captcha_keyword']) == strtoupper(Context::get('secret_text')))
319 319
 			{
320 320
 				$_SESSION['member_captcha_authed'] = true;
321 321
 				return true;
@@ -328,14 +328,14 @@  discard block
 block discarded – undo
328 328
 
329 329
 		function before_module_init_captchaCompare()
330 330
 		{
331
-			if(!$this->compareCaptcha())
331
+			if (!$this->compareCaptcha())
332 332
 			{
333 333
 				return false;
334 334
 			}
335 335
 
336 336
 			header("Content-Type: text/xml; charset=UTF-8");
337 337
 			header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
338
-			header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
338
+			header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
339 339
 			header("Cache-Control: no-store, no-cache, must-revalidate");
340 340
 			header("Cache-Control: post-check=0, pre-check=0", false);
341 341
 			header("Pragma: no-cache");
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 			unset($_SESSION['member_captcha_authed']);
351 351
 			$this->createKeyword();
352 352
 
353
-			$swfURL = getUrl() . 'addons/captcha/swf/play.swf';
353
+			$swfURL = getUrl().'addons/captcha/swf/play.swf';
354 354
 			Context::unloadFile('./addons/captcha/captcha.min.js');
355 355
 			Context::loadFile(array('./addons/captcha/inline_captcha.js', 'body'));
356 356
 
@@ -388,18 +388,18 @@  discard block
 block discarded – undo
388 388
 
389 389
 $oAddonMemberCaptcha = &$GLOBALS['__AddonMemberCaptcha__'];
390 390
 
391
-if(method_exists($oAddonMemberCaptcha, $called_position))
391
+if (method_exists($oAddonMemberCaptcha, $called_position))
392 392
 {
393
-	if(!call_user_func_array(array(&$oAddonMemberCaptcha, $called_position), array(&$this)))
393
+	if (!call_user_func_array(array(&$oAddonMemberCaptcha, $called_position), array(&$this)))
394 394
 	{
395 395
 		return false;
396 396
 	}
397 397
 }
398 398
 
399 399
 $addon_act = Context::get('captcha_action');
400
-if($addon_act && method_exists($oAddonMemberCaptcha, $called_position . '_' . $addon_act))
400
+if ($addon_act && method_exists($oAddonMemberCaptcha, $called_position.'_'.$addon_act))
401 401
 {
402
-	if(!call_user_func_array(array(&$oAddonMemberCaptcha, $called_position . '_' . $addon_act), array(&$this)))
402
+	if (!call_user_func_array(array(&$oAddonMemberCaptcha, $called_position.'_'.$addon_act), array(&$this)))
403 403
 	{
404 404
 		return false;
405 405
 	}
Please login to merge, or discard this patch.
addons/counter/counter.addon.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 
4
-if(!defined('__XE__'))
4
+if (!defined('__XE__'))
5 5
 	exit();
6 6
 
7 7
 /**
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  * @brief Counter add-on
11 11
  */
12 12
 // Execute if called_position is before_display_content
13
-if($called_position == 'before_module_init' && Context::get('module') != 'admin' && Context::getResponseMethod() == 'HTML' && Context::isInstalled() && !isCrawler())
13
+if ($called_position == 'before_module_init' && Context::get('module') != 'admin' && Context::getResponseMethod() == 'HTML' && Context::isInstalled() && !isCrawler())
14 14
 {
15 15
 	$oCounterController = getController('counter');
16 16
 	$oCounterController->counterExecute();
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,8 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 
4
-if(!defined('__XE__'))
4
+if(!defined('__XE__')) {
5 5
 	exit();
6
+}
6 7
 
7 8
 /**
8 9
  * @file counter.addon.php
Please login to merge, or discard this patch.
addons/member_communication/member_communication.addon.php 2 patches
Braces   +10 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,8 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 
4
-if(!defined('__XE__'))
4
+if(!defined('__XE__')) {
5 5
 	exit();
6
+}
6 7
 
7 8
 /**
8 9
  * @file member_communication.addon.php
@@ -44,8 +45,7 @@  discard block
 block discarded – undo
44 45
 		$text = preg_replace('@\r?\n@', '\\n', addslashes(Context::getLang('alert_new_message_arrived')));
45 46
 		Context::addHtmlFooter("<script type=\"text/javascript\">jQuery(function(){ xeNotifyMessage('{$text}','{$new_message_count}'); });</script>");
46 47
 	}
47
-}
48
-elseif($this->act == 'getMemberMenu' && $called_position == 'before_module_proc')
48
+} elseif($this->act == 'getMemberMenu' && $called_position == 'before_module_proc')
49 49
 {
50 50
 	$member_srl = Context::get('target_srl');
51 51
 	$oCommunicationModel = getModel('communication');
@@ -60,8 +60,7 @@  discard block
 block discarded – undo
60 60
 		// Display a list of friends
61 61
 		$oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationFriend'), 'cmd_view_friend', '', 'self');
62 62
 		// If not, Add menus to send message and to add friends
63
-	}
64
-	else
63
+	} else
65 64
 	{
66 65
 		// Get member information
67 66
 		$oMemberModel = getModel('member');
@@ -73,11 +72,13 @@  discard block
 block discarded – undo
73 72
 
74 73
 		$oMemberController = getController('member');
75 74
 		// Add a menu for sending message
76
-		if($logged_info->is_admin == 'Y' || $target_member_info->allow_message == 'Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl)))
77
-			$oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationSendMessage', 'receiver_srl', $member_srl), 'cmd_send_message', '', 'popup');
75
+		if($logged_info->is_admin == 'Y' || $target_member_info->allow_message == 'Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl))) {
76
+					$oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationSendMessage', 'receiver_srl', $member_srl), 'cmd_send_message', '', 'popup');
77
+		}
78 78
 		// Add a menu for listing friends (if a friend is new)
79
-		if(!$oCommunicationModel->isAddedFriend($member_srl))
80
-			$oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationAddFriend', 'target_srl', $member_srl), 'cmd_add_friend', '', 'popup');
79
+		if(!$oCommunicationModel->isAddedFriend($member_srl)) {
80
+					$oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationAddFriend', 'target_srl', $member_srl), 'cmd_add_friend', '', 'popup');
81
+		}
81 82
 	}
82 83
 }
83 84
 /* End of file member_communication.addon.php */
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 
4
-if(!defined('__XE__'))
4
+if (!defined('__XE__'))
5 5
 	exit();
6 6
 
7 7
 /**
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  */
16 16
 // Stop if non-logged-in user is
17 17
 $logged_info = Context::get('logged_info');
18
-if(!$logged_info|| isCrawler())
18
+if (!$logged_info || isCrawler())
19 19
 {
20 20
 	return;
21 21
 }
@@ -23,35 +23,35 @@  discard block
 block discarded – undo
23 23
 /**
24 24
  * Message/Friend munus are added on the pop-up window and member profile. Check if a new message is received
25 25
  * */
26
-if($this->module != 'member' && $called_position == 'before_module_init')
26
+if ($this->module != 'member' && $called_position == 'before_module_init')
27 27
 {
28 28
 	// Load a language file from the communication module
29
-	Context::loadLang(_XE_PATH_ . 'modules/communication/lang');
29
+	Context::loadLang(_XE_PATH_.'modules/communication/lang');
30 30
 	// Add menus on the member login information
31 31
 	$oMemberController = getController('member');
32 32
 	$oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend');
33 33
 	$oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box');
34 34
 
35
-	$flag_file = _XE_PATH_ . 'files/member_extra_info/new_message_flags/' . getNumberingPath($logged_info->member_srl) . $logged_info->member_srl;
36
-	if($addon_info->use_alarm != 'N' && file_exists($flag_file))
35
+	$flag_file = _XE_PATH_.'files/member_extra_info/new_message_flags/'.getNumberingPath($logged_info->member_srl).$logged_info->member_srl;
36
+	if ($addon_info->use_alarm != 'N' && file_exists($flag_file))
37 37
 	{
38 38
 		// Pop-up to display messages if a flag on new message is set
39 39
 		$new_message_count = (int) trim(FileHandler::readFile($flag_file));
40 40
 		FileHandler::removeFile($flag_file);
41
-		Context::loadLang(_XE_PATH_ . 'addons/member_communication/lang');
41
+		Context::loadLang(_XE_PATH_.'addons/member_communication/lang');
42 42
 		Context::loadFile(array('./addons/member_communication/tpl/member_communication.js'), true);
43 43
 
44 44
 		$text = preg_replace('@\r?\n@', '\\n', addslashes(Context::getLang('alert_new_message_arrived')));
45 45
 		Context::addHtmlFooter("<script type=\"text/javascript\">jQuery(function(){ xeNotifyMessage('{$text}','{$new_message_count}'); });</script>");
46 46
 	}
47 47
 }
48
-elseif($this->act == 'getMemberMenu' && $called_position == 'before_module_proc')
48
+elseif ($this->act == 'getMemberMenu' && $called_position == 'before_module_proc')
49 49
 {
50 50
 	$member_srl = Context::get('target_srl');
51 51
 	$oCommunicationModel = getModel('communication');
52 52
 
53 53
 	// Add a feature to display own message box.
54
-	if($logged_info->member_srl == $member_srl)
54
+	if ($logged_info->member_srl == $member_srl)
55 55
 	{
56 56
 		$mid = Context::get('cur_mid');
57 57
 		$oMemberController = getController('member');
@@ -66,17 +66,17 @@  discard block
 block discarded – undo
66 66
 		// Get member information
67 67
 		$oMemberModel = getModel('member');
68 68
 		$target_member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
69
-		if(!$target_member_info->member_srl)
69
+		if (!$target_member_info->member_srl)
70 70
 		{
71 71
 			return;
72 72
 		}
73 73
 
74 74
 		$oMemberController = getController('member');
75 75
 		// Add a menu for sending message
76
-		if($logged_info->is_admin == 'Y' || $target_member_info->allow_message == 'Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl)))
76
+		if ($logged_info->is_admin == 'Y' || $target_member_info->allow_message == 'Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl)))
77 77
 			$oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationSendMessage', 'receiver_srl', $member_srl), 'cmd_send_message', '', 'popup');
78 78
 		// Add a menu for listing friends (if a friend is new)
79
-		if(!$oCommunicationModel->isAddedFriend($member_srl))
79
+		if (!$oCommunicationModel->isAddedFriend($member_srl))
80 80
 			$oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationAddFriend', 'target_srl', $member_srl), 'cmd_add_friend', '', 'popup');
81 81
 	}
82 82
 }
Please login to merge, or discard this patch.
addons/member_extra_info/member_extra_info.addon.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 
4
-if(!defined('__XE__'))
4
+if (!defined('__XE__'))
5 5
 {
6 6
 	exit();
7 7
 }
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 /**
18 18
  * Just before displaying, change image name/ image mark
19 19
  */
20
-if($called_position != "before_display_content" || Context::get('act') == 'dispPageAdminContentModify' || Context::getResponseMethod() != 'HTML' || isCrawler())
20
+if ($called_position != "before_display_content" || Context::get('act') == 'dispPageAdminContentModify' || Context::getResponseMethod() != 'HTML' || isCrawler())
21 21
 {
22 22
 	return;
23 23
 }
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 require_once('./addons/member_extra_info/member_extra_info.lib.php');
26 26
 // 1. Find a part <div class="member_MemberSerialNumber"> content </div> in the output document, change it to image name/mark by using MemberController::transImageName()
27 27
 $temp_output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'memberTransImageName', $output);
28
-if($temp_output)
28
+if ($temp_output)
29 29
 {
30 30
 	$output = $temp_output;
31 31
 }
Please login to merge, or discard this patch.
addons/oembed/oembed.addon.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 
4
-if(!defined('__XE__'))
4
+if (!defined('__XE__'))
5 5
 {
6 6
 	exit();
7 7
 }
8 8
 
9
-if($called_position == 'after_module_proc' && Context::getResponseMethod() == 'HTML')
9
+if ($called_position == 'after_module_proc' && Context::getResponseMethod() == 'HTML')
10 10
 {
11 11
 	Context::loadFile('./addons/oembed/jquery.oembed.css');
12 12
 	Context::loadFile(array('./addons/oembed/jquery.oembed.js', 'body', '', null), true);
Please login to merge, or discard this patch.
addons/point_level_icon/point_level_icon.addon.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,8 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 
4
-if(!defined('__XE__'))
4
+if(!defined('__XE__')) {
5 5
 	exit();
6
+}
6 7
 
7 8
 /**
8 9
  * @file point.addon.php
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 
4
-if(!defined('__XE__'))
4
+if (!defined('__XE__'))
5 5
 	exit();
6 6
 
7 7
 /**
@@ -12,15 +12,15 @@  discard block
 block discarded – undo
12 12
  * Display point level icon before user name when point system is enabled.
13 13
  * */
14 14
 // return unless before_display_content
15
-if($called_position != "before_display_content" || Context::get('act') == 'dispPageAdminContentModify' || Context::getResponseMethod() != 'HTML' || isCrawler())
15
+if ($called_position != "before_display_content" || Context::get('act') == 'dispPageAdminContentModify' || Context::getResponseMethod() != 'HTML' || isCrawler())
16 16
 {
17 17
 	return;
18 18
 }
19 19
 
20
-require_once(_XE_PATH_ . 'addons/point_level_icon/point_level_icon.lib.php');
20
+require_once(_XE_PATH_.'addons/point_level_icon/point_level_icon.lib.php');
21 21
 
22 22
 $temp_output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9\-]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'pointLevelIconTrans', $output);
23
-if($temp_output)
23
+if ($temp_output)
24 24
 {
25 25
 	$output = $temp_output;
26 26
 }
Please login to merge, or discard this patch.