Completed
Push — develop ( 2417b5...0fb426 )
by Agel_Nash
09:49 queued 04:11
created
install/src/sqlParser.class.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  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
 	public $host;
8 8
 	public $dbname;
9 9
 	public $prefix;
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     public $ignoreDuplicateErrors;
29 29
     public $autoTemplateLogic;
30 30
 
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') {
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 32
 		$this->host = $host;
33 33
 		$this->dbname = $db;
34 34
 		$this->prefix = $prefix;
@@ -44,28 +44,28 @@  discard block
 block discarded – undo
44 44
         $this->autoTemplateLogic = $auto_template_logic;
45 45
 	}
46 46
 
47
-	public function connect() {
47
+	public function connect(){
48 48
 		$this->conn = mysqli_connect($this->host, $this->user, $this->password);
49 49
 		mysqli_select_db($this->conn, $this->dbname);
50 50
 		if (function_exists('mysqli_set_charset')) mysqli_set_charset($this->conn, $this->connection_charset);
51 51
 
52 52
 		$this->dbVersion = 3.23; // assume version 3.23
53
-		if(function_exists("mysqli_get_server_info")) {
53
+		if (function_exists("mysqli_get_server_info")) {
54 54
 			$ver = mysqli_get_server_info($this->conn);
55
-			$this->dbMODx 	 = version_compare($ver,"4.0.2");
55
+			$this->dbMODx 	 = version_compare($ver, "4.0.2");
56 56
 			$this->dbVersion = (float) $ver; // Typecasting (float) instead of floatval() [PHP < 4.2]
57 57
 		}
58 58
 
59
-        mysqli_query($this->conn,"{$this->connection_method} {$this->connection_charset}");
59
+        mysqli_query($this->conn, "{$this->connection_method} {$this->connection_charset}");
60 60
 	}
61 61
 
62
-    public function process($filename) {
62
+    public function process($filename){
63 63
 	    global $custom_placeholders;
64 64
 
65 65
 		// check to make sure file exists
66 66
 		if (!file_exists($filename)) {
67 67
 			$this->mysqlErrors[] = array("error" => "File '$filename' not found");
68
-			$this->installFailed = true ;
68
+			$this->installFailed = true;
69 69
 			return false;
70 70
 		}
71 71
 
@@ -82,10 +82,10 @@  discard block
 block discarded – undo
82 82
 		// check if in upgrade mode
83 83
 		if ($this->mode === 'upd') {
84 84
 			// remove non-upgradeable parts
85
-			$s = strpos($idata,'non-upgrade-able[[');
86
-			$e = strpos($idata,']]non-upgrade-able') + 17;
87
-			if($s && $e) {
88
-			    $idata = str_replace(substr($idata, $s,$e-$s),' Removed non upgradeable items', $idata);
85
+			$s = strpos($idata, 'non-upgrade-able[[');
86
+			$e = strpos($idata, ']]non-upgrade-able') + 17;
87
+			if ($s && $e) {
88
+			    $idata = str_replace(substr($idata, $s, $e - $s), ' Removed non upgradeable items', $idata);
89 89
             }
90 90
 		}
91 91
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		/*$idata = str_replace('{VERSION}', $modx_version, $idata);*/
103 103
 
104 104
 		// Replace custom placeholders
105
-		foreach($custom_placeholders as $key=>$val) {
105
+		foreach ($custom_placeholders as $key=>$val) {
106 106
 			if (strpos($idata, '{'.$key.'}') !== false) {
107 107
 				$idata = str_replace('{'.$key.'}', $val, $idata);
108 108
 			}
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
 		$sql_array = explode("\n\n", $idata);
112 112
 
113 113
 		$num = 0;
114
-		foreach($sql_array as $sql_entry) {
114
+		foreach ($sql_array as $sql_entry) {
115 115
 			$sql_do = trim($sql_entry, "\r\n; ");
116 116
 
117 117
 			if (preg_match('/^\#/', $sql_do)) continue;
118 118
 
119 119
 			// strip out comments and \n for mysql 3.x
120
-			if ($this->dbVersion <4.0) {
121
-				$sql_do = preg_replace("~COMMENT.*[^']?'.*[^']?'~","",$sql_do);
120
+			if ($this->dbVersion < 4.0) {
121
+				$sql_do = preg_replace("~COMMENT.*[^']?'.*[^']?'~", "", $sql_do);
122 122
 				$sql_do = str_replace('\r', "", $sql_do);
123 123
 				$sql_do = str_replace('\n', "", $sql_do);
124 124
 			}
@@ -126,10 +126,10 @@  discard block
 block discarded – undo
126 126
 
127 127
 			$num = $num + 1;
128 128
 			if ($sql_do) mysqli_query($this->conn, $sql_do);
129
-			if(mysqli_error($this->conn)) {
129
+			if (mysqli_error($this->conn)) {
130 130
 				// 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;
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;
133 133
 				}
134 134
 				// End Ignore duplicate
135 135
 				$this->mysqlErrors[] = array("error" => mysqli_error($this->conn), "sql" => $sql_do);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 		}
139 139
 	}
140 140
 
141
-    public function close() {
141
+    public function close(){
142 142
 		mysqli_close($this->conn);
143 143
 	}
144 144
 }
Please login to merge, or discard this patch.
install/src/lang.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     'sv' => 'svenska'
38 38
 );
39 39
 $_langISO6391 = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
40
-if (! empty($_langFiles[$_langISO6391])) {
40
+if (!empty($_langFiles[$_langISO6391])) {
41 41
     $install_language = $_langFiles[$_langISO6391];
42 42
 }
43 43
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 }
52 52
 # load language file
53 53
 require_once 'lang/english.inc.php'; // As fallback
54
-require_once 'lang/' . $install_language . '.inc.php';
54
+require_once 'lang/'.$install_language.'.inc.php';
55 55
 
56 56
 $manager_language = $install_language;
57 57
 
Please login to merge, or discard this patch.
install/src/lang/russian-UTF8.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
  *
16 16
  * Please commit your language changes on Transifex (https://www.transifex.com/projects/p/modx-evolution/) or on GitHub (https://github.com/modxcms/evolution).
17 17
  */
18
-setlocale (LC_ALL, 'ru_RU.UTF-8');
18
+setlocale(LC_ALL, 'ru_RU.UTF-8');
19 19
 $_lang["agree_to_terms"] = 'Согласиться с условиями лицензии и приступить к установке';
20 20
 $_lang["alert_database_test_connection"] = 'Вы должны создать базу данных или выбрать базу данных для проверки!';
21 21
 $_lang["alert_database_test_connection_failed"] = 'Неудачная проверка выбранной базы данных!';
Please login to merge, or discard this patch.
install/src/processor/result.php 1 patch
Spacing   +13 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 //:: EVO Installer Setup file
3 3
 //:::::::::::::::::::::::::::::::::::::::::
4
-if (is_file($base_path . 'assets/cache/siteManager.php')) {
5
-    include_once($base_path . 'assets/cache/siteManager.php');
4
+if (is_file($base_path.'assets/cache/siteManager.php')) {
5
+    include_once($base_path.'assets/cache/siteManager.php');
6 6
 }
7 7
 if (!defined('MGR_DIR')) {
8 8
     define('MGR_DIR', 'manager');
9 9
 }
10 10
 
11
-require_once(dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/version.inc.php');
11
+require_once(dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/version.inc.php');
12 12
 
13
-$chunkPath = $base_path . 'install/assets/chunks';
14
-$snippetPath = $base_path . 'install/assets/snippets';
15
-$pluginPath = $base_path . 'install/assets/plugins';
16
-$modulePath = $base_path . 'install/assets/modules';
17
-$templatePath = $base_path . 'install/assets/templates';
18
-$tvPath = $base_path . 'install/assets/tvs';
13
+$chunkPath = $base_path.'install/assets/chunks';
14
+$snippetPath = $base_path.'install/assets/snippets';
15
+$pluginPath = $base_path.'install/assets/plugins';
16
+$modulePath = $base_path.'install/assets/modules';
17
+$templatePath = $base_path.'install/assets/templates';
18
+$tvPath = $base_path.'install/assets/tvs';
19 19
 
20 20
 // setup Template template files - array : name, description, type - 0:file or 1:content, parameters, category
21 21
 $mt = &$moduleTemplates;
@@ -28,8 +28,7 @@  discard block
 block discarded – undo
28 28
         $params = parse_docblock($templatePath, $tplfile);
29 29
         if (is_array($params) && (count($params) > 0)) {
30 30
             $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}";
31
-            $mt[] = array
32
-            (
31
+            $mt[] = array(
33 32
                 $params['name'],
34 33
                 $description,
35 34
                 // Don't think this is gonna be used ... but adding it just in case 'type'
@@ -149,7 +148,7 @@  discard block
 block discarded – undo
149 148
                 $params['modx_category'],
150 149
                 $params['legacy_names'],
151 150
                 array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false,
152
-                (int)$params['disabled']
151
+                (int) $params['disabled']
153 152
             );
154 153
         }
155 154
     }
@@ -174,12 +173,12 @@  discard block
 block discarded – undo
174 173
                 "$modulePath/{$params['filename']}",
175 174
                 $params['properties'],
176 175
                 $params['guid'],
177
-                (int)$params['shareparams'],
176
+                (int) $params['shareparams'],
178 177
                 $params['modx_category'],
179 178
                 array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false
180 179
             );
181 180
         }
182
-        if ((int)$params['shareparams'] || !empty($params['dependencies'])) {
181
+        if ((int) $params['shareparams'] || !empty($params['dependencies'])) {
183 182
             $dependencies = explode(',', $params['dependencies']);
184 183
             foreach ($dependencies as $dependency) {
185 184
                 $dependency = explode(':', $dependency);
Please login to merge, or discard this patch.
manager/includes/error.class.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 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
     public function include_lang($context = 'common')
10 10
     {
11 11
         parent::includeLang($context);
Please login to merge, or discard this patch.
manager/includes/src/Legacy/ErrorHandler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -71,11 +71,11 @@
 block discarded – undo
71 71
         }
72 72
 
73 73
         if ($context === 'common') {
74
-            $lang_path = MODX_MANAGER_PATH . 'includes/lang/';
74
+            $lang_path = MODX_MANAGER_PATH.'includes/lang/';
75 75
         } else {
76
-            $lang_path = MODX_MANAGER_PATH . "includes/lang/{$context}/";
76
+            $lang_path = MODX_MANAGER_PATH."includes/lang/{$context}/";
77 77
         }
78
-        include_once($lang_path . 'english.inc.php');
78
+        include_once($lang_path.'english.inc.php');
79 79
         $manager_language = $modx->config['manager_language'];
80 80
         if (is_file("{$lang_path}{$manager_language}.inc.php")) {
81 81
             include_once("{$lang_path}{$manager_language}.inc.php");
Please login to merge, or discard this patch.
manager/includes/src/Legacy/Categories.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         $this->db_tbl['categories'] = $modx->getFullTableName('categories');
21 21
 
22 22
         foreach ($this->elements as $element) {
23
-            $this->db_tbl[$element] = $modx->getFullTableName('site_' . $element);
23
+            $this->db_tbl[$element] = $modx->getFullTableName('site_'.$element);
24 24
         }
25 25
     }
26 26
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             $this->db->select(
55 55
                 '*',
56 56
                 $this->db_tbl['categories'],
57
-                "`" . $where . "` = '" . $this->db->escape($search) . "'"
57
+                "`".$where."` = '".$this->db->escape($search)."'"
58 58
             )
59 59
         );
60 60
 
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
     {
72 72
         $_value = $this->db->getValue(
73 73
             $this->db->select(
74
-                '`' . $value . '`',
74
+                '`'.$value.'`',
75 75
                 $this->db_tbl['categories'],
76
-                "`" . $where . "` = '" . $this->db->escape($search) . "'"
76
+                "`".$where."` = '".$this->db->escape($search)."'"
77 77
             )
78 78
         );
79 79
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
                 $this->db->select(
93 93
                     '*',
94 94
                     $this->db_tbl[$element],
95
-                    "`category` = '" . (int)$category_id . "'"
95
+                    "`category` = '".(int) $category_id."'"
96 96
                 )
97 97
             );
98 98
 
@@ -135,13 +135,13 @@  discard block
 block discarded – undo
135 135
             $this->db->update(
136 136
                 $_update,
137 137
                 $this->db_tbl[$element],
138
-                "`category` = '" . (int)$category_id . "'"
138
+                "`category` = '".(int) $category_id."'"
139 139
             );
140 140
         }
141 141
 
142 142
         $this->db->delete(
143 143
             $this->db_tbl['categories'],
144
-            "`id` = '" . (int)$category_id . "'"
144
+            "`id` = '".(int) $category_id."'"
145 145
         );
146 146
 
147 147
         return $this->db->getAffectedRows() === 1;
@@ -160,13 +160,13 @@  discard block
 block discarded – undo
160 160
 
161 161
         $_update = array(
162 162
             'category' => $this->db->escape($data['category']),
163
-            'rank'     => (int)$data['rank']
163
+            'rank'     => (int) $data['rank']
164 164
         );
165 165
 
166 166
         $this->db->update(
167 167
             $_update,
168 168
             $this->db_tbl['categories'],
169
-            "`id` = '" . (int)$category_id . "'"
169
+            "`id` = '".(int) $category_id."'"
170 170
         );
171 171
 
172 172
         if ($this->db->getAffectedRows() === 1) {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
         $_insert = array(
191 191
             'category' => $this->db->escape($category_name),
192
-            'rank'     => (int)$category_rank
192
+            'rank'     => (int) $category_rank
193 193
         );
194 194
 
195 195
         $this->db->insert(
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
             $this->db->select(
217 217
                 '`id`',
218 218
                 $this->db_tbl['categories'],
219
-                "`category` = '" . $category . "'"
219
+                "`category` = '".$category."'"
220 220
             )
221 221
         );
222 222
 
Please login to merge, or discard this patch.
manager/includes/src/Support/Menu.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
                 $countChild++;
91 91
                 $id = $value[0];
92 92
                 $ph['id'] = $id;
93
-                $ph['li_class'] = $this->getItemClass($id) . $value[10];
93
+                $ph['li_class'] = $this->getItemClass($id).$value[10];
94 94
                 $ph['href'] = $value[3];
95 95
                 $ph['alt'] = $value[4];
96 96
                 $ph['target'] = $value[7];
97 97
                 $ph['onclick'] = $value[5];
98 98
                 $ph['a_class'] = $this->getLinkClass($id);
99 99
                 $ph['LinkAttr'] = $this->getLinkAttr($id);
100
-                $ph['itemName'] = $value[2] . $this->getItemName($id);
100
+                $ph['itemName'] = $value[2].$this->getItemName($id);
101 101
 
102 102
                 $ph['DrawSub'] = '';
103 103
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
     public function getLinkClass($id)
146 146
     {
147 147
         if (isset($this->menu[$id])) {
148
-            return ' class="' . $this->defaults['parentLinkClass'] . '"';
148
+            return ' class="'.$this->defaults['parentLinkClass'].'"';
149 149
         } else {
150 150
             return '';
151 151
         }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     public function getItemClass($id)
172 172
     {
173 173
         if (isset($this->menu[$id])) {
174
-            return $this->defaults['parentClass'] . ' ';
174
+            return $this->defaults['parentClass'].' ';
175 175
         } else {
176 176
             return '';
177 177
         }
Please login to merge, or discard this patch.
manager/includes/src/Support/Paginate.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
         $array_paging['total'] = $this->int_nbr_row;
102 102
 
103 103
         if ($this->int_cur_position != 0) {
104
-            $array_paging['first_link'] = "<a href=\"$PHP_SELF?int_cur_position=0" . $this->str_ext_argv . "\">";
105
-            $array_paging['previous_link'] = "<a href=\"$PHP_SELF?int_cur_position=" . ($this->int_cur_position - $this->int_num_result) . $this->str_ext_argv . "\">";
104
+            $array_paging['first_link'] = "<a href=\"$PHP_SELF?int_cur_position=0".$this->str_ext_argv."\">";
105
+            $array_paging['previous_link'] = "<a href=\"$PHP_SELF?int_cur_position=".($this->int_cur_position - $this->int_num_result).$this->str_ext_argv."\">";
106 106
         }
107 107
 
108 108
         if (($this->int_nbr_row - $this->int_cur_position) > $this->int_num_result) {
109 109
             $int_new_position = $this->int_cur_position + $this->int_num_result;
110
-            $array_paging['last_link'] = "<a href=\"$PHP_SELF?int_cur_position=" . $this->int_nbr_row . $this->str_ext_argv . "\">";
111
-            $array_paging['next_link'] = "<a href=\"$PHP_SELF?int_cur_position=$int_new_position" . $this->str_ext_argv . "\">";
110
+            $array_paging['last_link'] = "<a href=\"$PHP_SELF?int_cur_position=".$this->int_nbr_row.$this->str_ext_argv."\">";
111
+            $array_paging['next_link'] = "<a href=\"$PHP_SELF?int_cur_position=$int_new_position".$this->str_ext_argv."\">";
112 112
         }
113 113
 
114 114
         return $array_paging;
@@ -126,10 +126,10 @@  discard block
 block discarded – undo
126 126
         for ($i = 0; $i < $this->getNumberOfPage(); $i++) {
127 127
             // if current page, do not make a link
128 128
             if ($i == $this->getCurrentPage()) {
129
-                $array_all_page[$i] = "<b>" . ($i + 1) . "</b>&nbsp;";
129
+                $array_all_page[$i] = "<b>".($i + 1)."</b>&nbsp;";
130 130
             } else {
131 131
                 $int_new_position = ($i * $this->int_num_result);
132
-                $array_all_page[$i] = "<a href=\"" . $PHP_SELF . "?int_cur_position=$int_new_position$this->str_ext_argv\">" . ($i + 1) . "</a>&nbsp;";
132
+                $array_all_page[$i] = "<a href=\"".$PHP_SELF."?int_cur_position=$int_new_position$this->str_ext_argv\">".($i + 1)."</a>&nbsp;";
133 133
             }
134 134
         }
135 135
 
Please login to merge, or discard this patch.