Completed
Push — develop ( cb7ecf...5e631f )
by Dmytro
17s
created
install/src/controllers/summary.php 1 patch
Braces   +35 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,19 +1,22 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! function_exists('f_owc')){
2
+if( ! function_exists('f_owc')) {
3 3
     /**
4 4
      * @param $path
5 5
      * @param $data
6 6
      * @param null|int $mode
7 7
      */
8
-    function f_owc($path, $data, $mode = null){
8
+    function f_owc($path, $data, $mode = null)
9
+    {
9 10
         try {
10 11
             // make an attempt to create the file
11 12
             $hnd = fopen($path, 'w');
12 13
             fwrite($hnd, $data);
13 14
             fclose($hnd);
14 15
 
15
-            if(null !== $mode) chmod($path, $mode);
16
-        }catch(Exception $e){
16
+            if(null !== $mode) {
17
+                chmod($path, $mode);
18
+            }
19
+        } catch(Exception $e) {
17 20
             // Nothing, this is NOT normal
18 21
             unset($e);
19 22
         }
@@ -21,7 +24,9 @@  discard block
 block discarded – undo
21 24
 }
22 25
 
23 26
 $installMode = isset($_POST['installmode']) ? (int)$_POST['installmode'] : 0;
24
-if( ! isset($_lang)) $_lang = array();
27
+if( ! isset($_lang)) {
28
+    $_lang = array();
29
+}
25 30
 
26 31
 echo '<div class="stepcontainer">
27 32
       <ul class="progressbar">
@@ -57,7 +62,7 @@  discard block
 block discarded – undo
57 62
 // check if iconv is available
58 63
 echo '<p>' . $_lang['checking_iconv'];
59 64
 $iconv = (int) function_exists('iconv');
60
-if ($iconv == '0'){
65
+if ($iconv == '0') {
61 66
     echo '<span class="notok">' . $_lang['failed'].'</span></p><p><strong>'.$_lang['checking_iconv_note'].'</strong></p>';
62 67
     $errors++;
63 68
 } else {
@@ -119,7 +124,7 @@  discard block
 block discarded – undo
119 124
 
120 125
 // File Browser directories exists?
121 126
 echo '<p>'.$_lang['checking_if_images_exist'];
122
-switch(true){
127
+switch(true) {
123 128
     case !file_exists("../assets/images"):
124 129
     case !file_exists("../assets/files"):
125 130
     case !file_exists("../assets/backup"):
@@ -134,7 +139,7 @@  discard block
 block discarded – undo
134 139
 
135 140
 // File Browser directories writable?
136 141
 echo '<p>'.$_lang['checking_if_images_writable'];
137
-switch(true){
142
+switch(true) {
138 143
     case !is_writable("../assets/images"):
139 144
     case !is_writable("../assets/files"):
140 145
     case !is_writable("../assets/backup"):
@@ -268,7 +273,7 @@  discard block
 block discarded – undo
268 273
 if ($conn) {
269 274
     echo '<p>'. $_lang['checking_mysql_strict_mode'];
270 275
     $mysqlmode = mysqli_query($conn, "SELECT @@global.sql_mode");
271
-    if (mysqli_num_rows($mysqlmode) > 0){
276
+    if (mysqli_num_rows($mysqlmode) > 0) {
272 277
         $modes = mysqli_fetch_array($mysqlmode, MYSQLI_NUM);
273 278
         //$modes = array("STRICT_TRANS_TABLES"); // for testing
274 279
         // print_r($modes);
@@ -305,9 +310,9 @@  discard block
 block discarded – undo
305 310
     echo '<p>';
306 311
     echo $_lang['setup_cannot_continue'] . ' ';
307 312
 
308
-    if($errors > 1){
313
+    if($errors > 1) {
309 314
         echo $errors . " " . $_lang['errors'] . $_lang['please_correct_errors'] . $_lang['and_try_again_plural'];
310
-    }else{
315
+    } else {
311 316
         echo $_lang['error'] . $_lang['please_correct_error'] . $_lang['and_try_again'];
312 317
     }
313 318
 
@@ -343,23 +348,35 @@  discard block
 block discarded – undo
343 348
     <input type="hidden" value="<?php echo $_POST['installdata'] ?>" name="installdata" />
344 349
 <?php
345 350
     $templates = isset ($_POST['template']) ? $_POST['template'] : array ();
346
-    foreach ($templates as $i => $template) echo '<input type="hidden" name="template[]" value="'.$template.'" />';
351
+    foreach ($templates as $i => $template) {
352
+        echo '<input type="hidden" name="template[]" value="'.$template.'" />';
353
+    }
347 354
 
348 355
     $tvs = isset ($_POST['tv']) ? $_POST['tv'] : array ();
349
-    foreach ($tvs as $i => $tv) echo '<input type="hidden" name="tv[]" value="'.$tv.'" />';
356
+    foreach ($tvs as $i => $tv) {
357
+        echo '<input type="hidden" name="tv[]" value="'.$tv.'" />';
358
+    }
350 359
 
351 360
     $chunks = isset ($_POST['chunk']) ? $_POST['chunk'] : array ();
352
-    foreach ($chunks as $i => $chunk) echo '<input type="hidden" name="chunk[]" value="'.$chunk.'" />';
361
+    foreach ($chunks as $i => $chunk) {
362
+        echo '<input type="hidden" name="chunk[]" value="'.$chunk.'" />';
363
+    }
353 364
 
354 365
     $snippets = isset ($_POST['snippet']) ? $_POST['snippet'] : array ();
355
-    foreach ($snippets as $i => $snippet) echo '<input type="hidden" name="snippet[]" value="'.$snippet.'" />';
366
+    foreach ($snippets as $i => $snippet) {
367
+        echo '<input type="hidden" name="snippet[]" value="'.$snippet.'" />';
368
+    }
356 369
 
357 370
     $plugins = isset ($_POST['plugin']) ? $_POST['plugin'] : array ();
358
-    foreach ($plugins as $i => $plugin) echo '<input type="hidden" name="plugin[]" value="'.$plugin.'" />';
371
+    foreach ($plugins as $i => $plugin) {
372
+        echo '<input type="hidden" name="plugin[]" value="'.$plugin.'" />';
373
+    }
359 374
 
360 375
     $modules = isset ($_POST['module']) ? $_POST['module'] : array ();
361
-    foreach ($modules as $i => $module) echo '<input type="hidden" name="module[]" value="'.$module.'" />';
362
-?>
376
+    foreach ($modules as $i => $module) {
377
+        echo '<input type="hidden" name="module[]" value="'.$module.'" />';
378
+    }
379
+    ?>
363 380
 </div>
364 381
 
365 382
 <h2><?php echo $_lang['agree_to_terms'];?></h2>
Please login to merge, or discard this patch.
install/src/sqlParser.class.php 1 patch
Braces   +23 added lines, -10 removed lines patch added patch discarded remove patch
@@ -3,7 +3,8 @@  discard block
 block discarded – undo
3 3
 // MySQL Dump Parser
4 4
 // SNUFFKIN/ Alex 2004
5 5
 
6
-class SqlParser {
6
+class SqlParser
7
+{
7 8
 	public $host;
8 9
 	public $dbname;
9 10
 	public $prefix;
@@ -28,7 +29,8 @@  discard block
 block discarded – undo
28 29
     public $ignoreDuplicateErrors;
29 30
     public $autoTemplateLogic;
30 31
 
31
-	public function __construct($host, $user, $password, $db, $prefix='modx_', $adminname, $adminemail, $adminpass, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent') {
32
+	public function __construct($host, $user, $password, $db, $prefix='modx_', $adminname, $adminemail, $adminpass, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent')
33
+	{
32 34
 		$this->host = $host;
33 35
 		$this->dbname = $db;
34 36
 		$this->prefix = $prefix;
@@ -44,10 +46,13 @@  discard block
 block discarded – undo
44 46
         $this->autoTemplateLogic = $auto_template_logic;
45 47
 	}
46 48
 
47
-	public function connect() {
49
+	public function connect()
50
+	{
48 51
 		$this->conn = mysqli_connect($this->host, $this->user, $this->password);
49 52
 		mysqli_select_db($this->conn, $this->dbname);
50
-		if (function_exists('mysqli_set_charset')) mysqli_set_charset($this->conn, $this->connection_charset);
53
+		if (function_exists('mysqli_set_charset')) {
54
+		    mysqli_set_charset($this->conn, $this->connection_charset);
55
+		}
51 56
 
52 57
 		$this->dbVersion = 3.23; // assume version 3.23
53 58
 		if(function_exists("mysqli_get_server_info")) {
@@ -59,7 +64,8 @@  discard block
 block discarded – undo
59 64
         mysqli_query($this->conn,"{$this->connection_method} {$this->connection_charset}");
60 65
 	}
61 66
 
62
-    public function process($filename) {
67
+    public function process($filename)
68
+    {
63 69
 	    global $custom_placeholders;
64 70
 
65 71
 		// check to make sure file exists
@@ -114,7 +120,9 @@  discard block
 block discarded – undo
114 120
 		foreach($sql_array as $sql_entry) {
115 121
 			$sql_do = trim($sql_entry, "\r\n; ");
116 122
 
117
-			if (preg_match('/^\#/', $sql_do)) continue;
123
+			if (preg_match('/^\#/', $sql_do)) {
124
+			    continue;
125
+			}
118 126
 
119 127
 			// strip out comments and \n for mysql 3.x
120 128
 			if ($this->dbVersion <4.0) {
@@ -125,11 +133,15 @@  discard block
 block discarded – undo
125 133
 
126 134
 
127 135
 			$num = $num + 1;
128
-			if ($sql_do) mysqli_query($this->conn, $sql_do);
136
+			if ($sql_do) {
137
+			    mysqli_query($this->conn, $sql_do);
138
+			}
129 139
 			if(mysqli_error($this->conn)) {
130 140
 				// Ignore duplicate and drop errors - Raymond
131
-				if ($this->ignoreDuplicateErrors){
132
-					if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 ||mysqli_errno($this->conn) == 1091) continue;
141
+				if ($this->ignoreDuplicateErrors) {
142
+					if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 ||mysqli_errno($this->conn) == 1091) {
143
+					    continue;
144
+					}
133 145
 				}
134 146
 				// End Ignore duplicate
135 147
 				$this->mysqlErrors[] = array("error" => mysqli_error($this->conn), "sql" => $sql_do);
@@ -138,7 +150,8 @@  discard block
 block discarded – undo
138 150
 		}
139 151
 	}
140 152
 
141
-    public function close() {
153
+    public function close()
154
+    {
142 155
 		mysqli_close($this->conn);
143 156
 	}
144 157
 }
Please login to merge, or discard this patch.
manager/includes/error.class.inc.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,8 @@
 block discarded – undo
5 5
  * @deprecated EvolutionCMS\Legacy\ErrorHandler
6 6
  * @todo could be unnecessary
7 7
  */
8
-class errorHandler extends EvolutionCMS\Legacy\ErrorHandler {
8
+class errorHandler extends EvolutionCMS\Legacy\ErrorHandler
9
+{
9 10
     public function include_lang($context = 'common')
10 11
     {
11 12
         parent::includeLang($context);
Please login to merge, or discard this patch.
manager/includes/log.class.inc.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,4 +3,6 @@
 block discarded – undo
3 3
 /**
4 4
  * @deprecated use EvolutionCMS\Legacy\LogHandler
5 5
  */
6
-class logHandler extends EvolutionCMS\Legacy\LogHandler{}
6
+class logHandler extends EvolutionCMS\Legacy\LogHandler
7
+{
8
+}
Please login to merge, or discard this patch.
manager/includes/src/Legacy/LogHandler.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -105,7 +105,8 @@  discard block
 block discarded – undo
105 105
         }
106 106
     }
107 107
 
108
-    private function getUserIP() {
108
+    private function getUserIP()
109
+    {
109 110
         if( array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']) ) {
110 111
             if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')>0) {
111 112
                 $addr = explode(",",$_SERVER['HTTP_X_FORWARDED_FOR']);
@@ -113,8 +114,7 @@  discard block
 block discarded – undo
113 114
             } else {
114 115
                 return $_SERVER['HTTP_X_FORWARDED_FOR'];
115 116
             }
116
-        }
117
-        else {
117
+        } else {
118 118
             return $_SERVER['REMOTE_ADDR'];
119 119
         }
120 120
     }
Please login to merge, or discard this patch.
manager/includes/src/Legacy/TemplateParser.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,8 @@  discard block
 block discarded – undo
8 8
      * @param array $data
9 9
      * @return string
10 10
      */
11
-    public function output($config = array(), $data = array()) {
11
+    public function output($config = array(), $data = array())
12
+    {
12 13
         $modx = evolutionCMS();
13 14
 
14 15
         $output = '';
@@ -64,7 +65,8 @@  discard block
 block discarded – undo
64 65
      * @param array $data
65 66
      * @return string
66 67
      */
67
-    private function render($data) {
68
+    private function render($data)
69
+    {
68 70
         $modx = evolutionCMS(); global $_lang, $_country_lang;
69 71
 
70 72
         $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']);
Please login to merge, or discard this patch.
manager/includes/src/Cache.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,8 @@  discard block
 block discarded – undo
79 79
      * @return string
80 80
      */
81 81
     public function getParents($id, $path = '')
82
-    { // modx:returns child's parent
82
+    {
83
+// modx:returns child's parent
83 84
         $modx = evolutionCMS();
84 85
         if (empty($this->aliases)) {
85 86
             $f = "id, IF(alias='', id, alias) AS alias, parent, alias_visible";
@@ -456,7 +457,8 @@  discard block
 block discarded – undo
456 457
                         $_ = trim($_);
457 458
                     }
458 459
                     $lastChar = substr($_, -1);
459
-                    if (!in_array($lastChar, $chars)) {// ,320,327,288,284,289
460
+                    if (!in_array($lastChar, $chars)) {
461
+// ,320,327,288,284,289
460 462
                         if (!in_array($prev_token,
461 463
                             array(T_FOREACH, T_WHILE, T_FOR, T_BOOLEAN_AND, T_BOOLEAN_OR, T_DOUBLE_ARROW))) {
462 464
                             $_ .= ' ';
Please login to merge, or discard this patch.
manager/includes/src/Support/MakeTable.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -457,7 +457,8 @@
 block discarded – undo
457 457
             if ($this->formElementType) {
458 458
                 $table = "\n" . '<form id="' . $this->formName . '" name="' . $this->formName . '" action="' . $this->formAction . '" method="POST">' . $table;
459 459
             }
460
-            if (strlen($this->pageNav) > 1) {//changed to display the pagination if exists.
460
+            if (strlen($this->pageNav) > 1) {
461
+//changed to display the pagination if exists.
461 462
                 /* commented this part because of cookie
462 463
                 $table .= '<div id="max-display-records" ><select style="display:inline" onchange="javascript:updatePageSize(this[this.selectedIndex].value);">';
463 464
                 $pageSizes= array (10, 25, 50, 100, 250);
Please login to merge, or discard this patch.
manager/includes/src/Support/Captcha.php 1 patch
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -43,7 +43,8 @@  discard block
 block discarded – undo
43 43
     public $im_height  = 0;
44 44
     public $im;
45 45
 
46
-    public function __construct($w=200, $h=80) {
46
+    public function __construct($w=200, $h=80)
47
+    {
47 48
         /* create session to set word for verification */
48 49
         $this->setVeriword();
49 50
         $this->dir_font = MODX_BASE_PATH . 'assets/' . $this->dir_font;
@@ -51,21 +52,24 @@  discard block
 block discarded – undo
51 52
         $this->im_height        = $h;
52 53
     }
53 54
 
54
-    public function setVeriword() {
55
+    public function setVeriword()
56
+    {
55 57
         /* create session variable for verification,
56 58
            you may change the session variable name */
57 59
         $this->word             = $this->makeText();
58 60
         $_SESSION['veriword']   = $this->word;
59 61
     }
60 62
 
61
-    public function output() {
63
+    public function output()
64
+    {
62 65
         /* output the image as jpeg */
63 66
         $this->drawImage();
64 67
         header("Content-type: image/jpeg");
65 68
         imagejpeg($this->im);
66 69
     }
67 70
 
68
-    public function makeText() {
71
+    public function makeText()
72
+    {
69 73
         $modx = evolutionCMS();
70 74
         // set default words
71 75
         $words="MODX,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote";
@@ -76,7 +80,8 @@  discard block
 block discarded – undo
76 80
         return (string) $arr_words[array_rand($arr_words)].rand(10,999);
77 81
     }
78 82
 
79
-    public function drawText() {
83
+    public function drawText()
84
+    {
80 85
         $dir = dir($this->dir_font);
81 86
         $fontstmp = array();
82 87
         while (false !== ($file = $dir->read())) {
@@ -131,7 +136,8 @@  discard block
 block discarded – undo
131 136
     }
132 137
 
133 138
 
134
-    public function drawImage() {
139
+    public function drawImage()
140
+    {
135 141
 
136 142
         /* pick one background image randomly from image directory */
137 143
         $img_file       = MODX_BASE_PATH . 'assets/' . $this->dir_noise."noise".rand(1,4).".jpg";
@@ -162,7 +168,8 @@  discard block
 block discarded – undo
162 168
         return $this->im;
163 169
     }
164 170
 
165
-    public function destroy() {
171
+    public function destroy()
172
+    {
166 173
         imagedestroy($this->im);
167 174
     }
168 175
 }
Please login to merge, or discard this patch.