@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | <?php endif; ?> |
| 66 | 66 | <?php endif; ?> |
| 67 | 67 | |
| 68 | -<?php if ($installLevel >= 2 && $moduleSQLBaseFile) : ?> |
|
| 68 | +<?php if ($installLevel >= 2 && $moduleSQLBaseFile) : ?> |
|
| 69 | 69 | <?php if ($sqlParser->installFailed === false) : ?> |
| 70 | 70 | <p> |
| 71 | 71 | <?=$_lang['setup_database_creating_tables']?> |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | <?php $sqlErrors = count($sqlParser->mysqlErrors); ?> |
| 77 | 77 | <?php for ($i = 0; $i < $sqlErrors; $i++) : ?> |
| 78 | 78 | <em><?=$sqlParser->mysqlErrors[$i]["error"]?></em> |
| 79 | - <?=$_lang['during_execution_of_sql'];?> |
|
| 79 | + <?=$_lang['during_execution_of_sql']; ?> |
|
| 80 | 80 | <span class="mono"><?=strip_tags($sqlParser->mysqlErrors[$i]["sql"])?></span> |
| 81 | 81 | <hr /> |
| 82 | 82 | <?php endfor; ?> |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | <?php $sqlErrors = count($sqlParser->mysqlErrors); ?> |
| 113 | 113 | <?php for ($i = 0; $i < $sqlErrors; $i++) : ?> |
| 114 | 114 | <em><?=$sqlParser->mysqlErrors[$i]["error"]?></em> <?=$_lang['during_execution_of_sql']?> |
| 115 | - <span class='mono'><?=strip_tags($sqlParser->mysqlErrors[$i]["sql"]);?></span> |
|
| 115 | + <span class='mono'><?=strip_tags($sqlParser->mysqlErrors[$i]["sql"]); ?></span> |
|
| 116 | 116 | <hr /> |
| 117 | 117 | <?php endfor; ?> |
| 118 | 118 | </p> |
@@ -130,9 +130,9 @@ discard block |
||
| 130 | 130 | <h3><?=$_lang['templates']?>:</h3> |
| 131 | 131 | <?php foreach ($installDataLevel['templates'] as $itemName => $itemData) : ?> |
| 132 | 132 | <?php if (empty($itemData['error'])) : ?> |
| 133 | - <?php if($itemData['type'] === 'create') : ?> |
|
| 133 | + <?php if ($itemData['type'] === 'create') : ?> |
|
| 134 | 134 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p> |
| 135 | - <?php elseif($itemData['type'] === 'update') : ?> |
|
| 135 | + <?php elseif ($itemData['type'] === 'update') : ?> |
|
| 136 | 136 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p> |
| 137 | 137 | <?php endif; ?> |
| 138 | 138 | <?php else : ?> |
@@ -154,11 +154,11 @@ discard block |
||
| 154 | 154 | <h3><?=$_lang['tvs']?>:</h3> |
| 155 | 155 | <?php foreach ($installDataLevel['tvs'] as $itemName => $itemData) : ?> |
| 156 | 156 | <?php if (empty($itemData['error'])) : ?> |
| 157 | - <?php if($itemData['type'] === 'create') : ?> |
|
| 157 | + <?php if ($itemData['type'] === 'create') : ?> |
|
| 158 | 158 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p> |
| 159 | - <?php elseif($itemData['type'] === 'update') : ?> |
|
| 159 | + <?php elseif ($itemData['type'] === 'update') : ?> |
|
| 160 | 160 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p> |
| 161 | - <?php elseif($itemData['type'] === 'skip') : ?> |
|
| 161 | + <?php elseif ($itemData['type'] === 'skip') : ?> |
|
| 162 | 162 | <!-- SKIP --> |
| 163 | 163 | <?php endif; ?> |
| 164 | 164 | <?php else : ?> |
@@ -173,13 +173,13 @@ discard block |
||
| 173 | 173 | <h3><?=$_lang['chunks']?>:</h3> |
| 174 | 174 | <?php foreach ($installDataLevel['chunks'] as $itemName => $itemData) : ?> |
| 175 | 175 | <?php if (empty($itemData['error'])) : ?> |
| 176 | - <?php if($itemData['type'] === 'create') : ?> |
|
| 176 | + <?php if ($itemData['type'] === 'create') : ?> |
|
| 177 | 177 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p> |
| 178 | - <?php elseif($itemData['type'] === 'overwrite') : ?> |
|
| 178 | + <?php elseif ($itemData['type'] === 'overwrite') : ?> |
|
| 179 | 179 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p> |
| 180 | - <?php elseif($itemData['type'] === 'update') : ?> |
|
| 180 | + <?php elseif ($itemData['type'] === 'update') : ?> |
|
| 181 | 181 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p> |
| 182 | - <?php elseif($itemData['type'] === 'skip') : ?> |
|
| 182 | + <?php elseif ($itemData['type'] === 'skip') : ?> |
|
| 183 | 183 | <!-- SKIP --> |
| 184 | 184 | <?php endif; ?> |
| 185 | 185 | <?php else : ?> |
@@ -201,11 +201,11 @@ discard block |
||
| 201 | 201 | <h3><?=$_lang['modules']?>:</h3> |
| 202 | 202 | <?php foreach ($installDataLevel['modules'] as $itemName => $itemData) : ?> |
| 203 | 203 | <?php if (empty($itemData['error'])) : ?> |
| 204 | - <?php if($itemData['type'] === 'create') : ?> |
|
| 204 | + <?php if ($itemData['type'] === 'create') : ?> |
|
| 205 | 205 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p> |
| 206 | - <?php elseif($itemData['type'] === 'update') : ?> |
|
| 206 | + <?php elseif ($itemData['type'] === 'update') : ?> |
|
| 207 | 207 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p> |
| 208 | - <?php elseif($itemData['type'] === 'skip') : ?> |
|
| 208 | + <?php elseif ($itemData['type'] === 'skip') : ?> |
|
| 209 | 209 | <!-- SKIP --> |
| 210 | 210 | <?php endif; ?> |
| 211 | 211 | <?php else : ?> |
@@ -227,11 +227,11 @@ discard block |
||
| 227 | 227 | <h3><?=$_lang['plugins']?>:</h3> |
| 228 | 228 | <?php foreach ($installDataLevel['plugins'] as $itemName => $itemData) : ?> |
| 229 | 229 | <?php if (empty($itemData['error'])) : ?> |
| 230 | - <?php if($itemData['type'] === 'create') : ?> |
|
| 230 | + <?php if ($itemData['type'] === 'create') : ?> |
|
| 231 | 231 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p> |
| 232 | - <?php elseif($itemData['type'] === 'update') : ?> |
|
| 232 | + <?php elseif ($itemData['type'] === 'update') : ?> |
|
| 233 | 233 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p> |
| 234 | - <?php elseif($itemData['type'] === 'skip') : ?> |
|
| 234 | + <?php elseif ($itemData['type'] === 'skip') : ?> |
|
| 235 | 235 | <!-- SKIP --> |
| 236 | 236 | <?php endif; ?> |
| 237 | 237 | <?php else : ?> |
@@ -253,13 +253,13 @@ discard block |
||
| 253 | 253 | <h3><?=$_lang['snippets']?>:</h3> |
| 254 | 254 | <?php foreach ($installDataLevel['snippets'] as $itemName => $itemData) : ?> |
| 255 | 255 | <?php if (empty($itemData['error'])) : ?> |
| 256 | - <?php if($itemData['type'] === 'create') : ?> |
|
| 256 | + <?php if ($itemData['type'] === 'create') : ?> |
|
| 257 | 257 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p> |
| 258 | - <?php elseif($itemData['type'] === 'overwrite') : ?> |
|
| 258 | + <?php elseif ($itemData['type'] === 'overwrite') : ?> |
|
| 259 | 259 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p> |
| 260 | - <?php elseif($itemData['type'] === 'update') : ?> |
|
| 260 | + <?php elseif ($itemData['type'] === 'update') : ?> |
|
| 261 | 261 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p> |
| 262 | - <?php elseif($itemData['type'] === 'skip') : ?> |
|
| 262 | + <?php elseif ($itemData['type'] === 'skip') : ?> |
|
| 263 | 263 | <!-- SKIP --> |
| 264 | 264 | <?php endif; ?> |
| 265 | 265 | <?php else : ?> |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | <p><?=$_lang['setup_couldnt_install']?></p> |
| 287 | 287 | <p><?=$_lang['installation_error_occured']?></p> |
| 288 | 288 | <br /><br /> |
| 289 | - <?php foreach($installDataLevel['demo']['error'] as $error): ?> |
|
| 289 | + <?php foreach ($installDataLevel['demo']['error'] as $error): ?> |
|
| 290 | 290 | <em><?=$error['content']?></em> |
| 291 | 291 | <?=$_lang['during_execution_of_sql']?> |
| 292 | 292 | <span class="mono"><?=htmlspecialchars($error['sql'])?></span> |
@@ -300,9 +300,9 @@ discard block |
||
| 300 | 300 | <?php if ($installLevel >= 6): ?> |
| 301 | 301 | <?php foreach ($installDependencyLevel as $itemName => $itemData) : ?> |
| 302 | 302 | <?php if (empty($itemData['error'])) : ?> |
| 303 | - <?php if($itemData['type'] === 'create') : ?> |
|
| 303 | + <?php if ($itemData['type'] === 'create') : ?> |
|
| 304 | 304 | <p> ✓ <?=$itemName?>Module: <span class="ok"><?=$_lang['depedency_create']?></span></p> |
| 305 | - <?php elseif($itemData['type'] === 'update') : ?> |
|
| 305 | + <?php elseif ($itemData['type'] === 'update') : ?> |
|
| 306 | 306 | <p> ✓ <?=$itemName?>Module: <span class="ok"><?=$_lang['depedency_update']?></span></p> |
| 307 | 307 | <?php endif; ?> |
| 308 | 308 | |
@@ -370,10 +370,10 @@ discard block |
||
| 370 | 370 | var chk = document.install.rminstaller; |
| 371 | 371 | if (chk && chk.checked) { |
| 372 | 372 | // remove install folder and files |
| 373 | - window.location.href = "../<?=MGR_DIR;?>/processors/remove_installer.processor.php?rminstall=1"; |
|
| 373 | + window.location.href = "../<?=MGR_DIR; ?>/processors/remove_installer.processor.php?rminstall=1"; |
|
| 374 | 374 | } |
| 375 | 375 | else { |
| 376 | - window.location.href = "../<?=MGR_DIR;?>/"; |
|
| 376 | + window.location.href = "../<?=MGR_DIR; ?>/"; |
|
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | 379 | /* ]]> */ |
@@ -16,7 +16,8 @@ discard block |
||
| 16 | 16 | <span class="notok"><?=$_lang['setup_database_create_connection_failed']?></span> |
| 17 | 17 | </p> |
| 18 | 18 | <p><?=$_lang['setup_database_create_connection_failed_note']?></p> |
| 19 | -<?php else : ?> |
|
| 19 | +<?php else { |
|
| 20 | + : ?> |
|
| 20 | 21 | <p><?=$_lang['setup_database_create_connection']?> <span class="ok"><?=$_lang['ok']?></span></p> |
| 21 | 22 | <?php if ($selectDatabase === false) : ?> |
| 22 | 23 | <p><?=rtrim($_lang['setup_database_selection'], '`')?> <strong><?=trim($dbase, '`')?></strong>: |
@@ -41,13 +42,18 @@ discard block |
||
| 41 | 42 | <?=rtrim($_lang['setup_database_creation'], '`')?> <strong><?=trim($dbase, '`')?></strong>: |
| 42 | 43 | <span class="ok"><?=$_lang['ok']?></span> |
| 43 | 44 | </p> |
| 44 | - <?php endif; ?> |
|
| 45 | - <?php else : ?> |
|
| 45 | + <?php endif; |
|
| 46 | +} |
|
| 47 | +?> |
|
| 48 | + <?php else { |
|
| 49 | + : ?> |
|
| 46 | 50 | <p> |
| 47 | 51 | <?=rtrim($_lang['setup_database_selection'], '`')?> <strong><?=trim($dbase, '`')?></strong>: |
| 48 | 52 | <span class="ok"><?=$_lang['ok']?></span> |
| 49 | 53 | </p> |
| 50 | - <?php endif; ?> |
|
| 54 | + <?php endif; |
|
| 55 | +} |
|
| 56 | +?> |
|
| 51 | 57 | <?php endif; ?> |
| 52 | 58 | |
| 53 | 59 | <?php if ($installLevel >= 1) : ?> |
@@ -57,12 +63,15 @@ discard block |
||
| 57 | 63 | <span class="notok"><?=$_lang['failed']?></span> <?=$_lang['table_prefix_already_inuse']?> |
| 58 | 64 | </p> |
| 59 | 65 | <p><?=$_lang['table_prefix_already_inuse_note']?></p> |
| 60 | - <?php else : ?> |
|
| 66 | + <?php else { |
|
| 67 | + : ?> |
|
| 61 | 68 | <p> |
| 62 | 69 | <?=rtrim($_lang['checking_table_prefix'], '`')?> <strong><?=trim($table_prefix, '`')?></strong>: |
| 63 | 70 | <span class="ok"><?=$_lang['ok']?></span> |
| 64 | 71 | </p> |
| 65 | - <?php endif; ?> |
|
| 72 | + <?php endif; |
|
| 73 | +} |
|
| 74 | +?> |
|
| 66 | 75 | <?php endif; ?> |
| 67 | 76 | |
| 68 | 77 | <?php if ($installLevel >= 2 && $moduleSQLBaseFile) : ?> |
@@ -81,9 +90,12 @@ discard block |
||
| 81 | 90 | <hr /> |
| 82 | 91 | <?php endfor; ?> |
| 83 | 92 | <p><?=$_lang['some_tables_not_updated']?></p> |
| 84 | - <?php else : ?> |
|
| 93 | + <?php else { |
|
| 94 | + : ?> |
|
| 85 | 95 | <p><?=$_lang['setup_database_creating_tables']?> <span class="ok"><?=$_lang['ok']?></span></p> |
| 86 | - <?php endif; ?> |
|
| 96 | + <?php endif; |
|
| 97 | +} |
|
| 98 | +?> |
|
| 87 | 99 | <?php endif; ?> |
| 88 | 100 | |
| 89 | 101 | <?php if ($installLevel >= 3) : ?> |
@@ -94,11 +106,14 @@ discard block |
||
| 94 | 106 | <p><?=$_lang['cant_write_config_file']?> <span class="mono"><?=MGR_DIR?>/includes/config.inc.php</span></p> |
| 95 | 107 | <textarea style="width:400px; height:160px;"><?=$configString?></textarea> |
| 96 | 108 | <p><?=$_lang['cant_write_config_file_note']?></p> |
| 97 | - <?php else : ?> |
|
| 109 | + <?php else { |
|
| 110 | + : ?> |
|
| 98 | 111 | <p> |
| 99 | 112 | <?=$_lang['writing_config_file']?> <span class="ok"><?=$_lang['ok']?></span> |
| 100 | 113 | </p> |
| 101 | - <?php endif; ?> |
|
| 114 | + <?php endif; |
|
| 115 | +} |
|
| 116 | +?> |
|
| 102 | 117 | <?php endif; ?> |
| 103 | 118 | |
| 104 | 119 | <?php if ($installLevel >= 4 && $installData && $moduleSQLDataFile && $moduleSQLResetFile) : ?> |
@@ -117,12 +132,15 @@ discard block |
||
| 117 | 132 | <?php endfor; ?> |
| 118 | 133 | </p> |
| 119 | 134 | <p><?=$_lang['some_tables_not_updated']?></p> |
| 120 | - <?php else : ?> |
|
| 135 | + <?php else { |
|
| 136 | + : ?> |
|
| 121 | 137 | <p> |
| 122 | 138 | <?=$_lang['resetting_database']?> |
| 123 | 139 | <span class="ok"><?=$_lang['ok']?></span> |
| 124 | 140 | </p> |
| 125 | - <?php endif; ?> |
|
| 141 | + <?php endif; |
|
| 142 | +} |
|
| 143 | +?> |
|
| 126 | 144 | <?php endif; ?> |
| 127 | 145 | |
| 128 | 146 | <?php if ($installLevel >= 5) : ?> |
@@ -135,7 +153,8 @@ discard block |
||
| 135 | 153 | <?php elseif($itemData['type'] === 'update') : ?> |
| 136 | 154 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p> |
| 137 | 155 | <?php endif; ?> |
| 138 | - <?php else : ?> |
|
| 156 | + <?php else { |
|
| 157 | + : ?> |
|
| 139 | 158 | <?php if ($itemData['error']['type'] === 'sql') : ?> |
| 140 | 159 | <p>❌ <?=$itemData['error']['content']?></p> |
| 141 | 160 | <?php elseif ($itemData['error']['type'] === 'file_not_found') : ?> |
@@ -145,7 +164,9 @@ discard block |
||
| 145 | 164 | <?=$_lang['not_found']?>. |
| 146 | 165 | </span> |
| 147 | 166 | </p> |
| 148 | - <?php endif; ?> |
|
| 167 | + <?php endif; |
|
| 168 | +} |
|
| 169 | +?> |
|
| 149 | 170 | <?php endif; ?> |
| 150 | 171 | <?php endforeach; ?> |
| 151 | 172 | <?php endif; ?> |
@@ -161,10 +182,13 @@ discard block |
||
| 161 | 182 | <?php elseif($itemData['type'] === 'skip') : ?> |
| 162 | 183 | <!-- SKIP --> |
| 163 | 184 | <?php endif; ?> |
| 164 | - <?php else : ?> |
|
| 185 | + <?php else { |
|
| 186 | + : ?> |
|
| 165 | 187 | <?php if ($itemData['error']['type'] === 'sql') : ?> |
| 166 | 188 | <p>❌ <?=$itemData['error']['content']?></p> |
| 167 | - <?php endif; ?> |
|
| 189 | + <?php endif; |
|
| 190 | +} |
|
| 191 | +?> |
|
| 168 | 192 | <?php endif; ?> |
| 169 | 193 | <?php endforeach; ?> |
| 170 | 194 | <?php endif; ?> |
@@ -182,7 +206,8 @@ discard block |
||
| 182 | 206 | <?php elseif($itemData['type'] === 'skip') : ?> |
| 183 | 207 | <!-- SKIP --> |
| 184 | 208 | <?php endif; ?> |
| 185 | - <?php else : ?> |
|
| 209 | + <?php else { |
|
| 210 | + : ?> |
|
| 186 | 211 | <?php if ($itemData['error']['type'] === 'sql') : ?> |
| 187 | 212 | <p>❌ <?=$itemData['error']['content']?></p> |
| 188 | 213 | <?php elseif ($itemData['error']['type'] === 'file_not_found') : ?> |
@@ -192,7 +217,9 @@ discard block |
||
| 192 | 217 | <?=$_lang['not_found']?>. |
| 193 | 218 | </span> |
| 194 | 219 | </p> |
| 195 | - <?php endif; ?> |
|
| 220 | + <?php endif; |
|
| 221 | +} |
|
| 222 | +?> |
|
| 196 | 223 | <?php endif; ?> |
| 197 | 224 | <?php endforeach; ?> |
| 198 | 225 | <?php endif; ?> |
@@ -208,7 +235,8 @@ discard block |
||
| 208 | 235 | <?php elseif($itemData['type'] === 'skip') : ?> |
| 209 | 236 | <!-- SKIP --> |
| 210 | 237 | <?php endif; ?> |
| 211 | - <?php else : ?> |
|
| 238 | + <?php else { |
|
| 239 | + : ?> |
|
| 212 | 240 | <?php if ($itemData['error']['type'] === 'sql') : ?> |
| 213 | 241 | <p>❌ <?=$itemData['error']['content']?></p> |
| 214 | 242 | <?php elseif ($itemData['error']['type'] === 'file_not_found') : ?> |
@@ -218,7 +246,9 @@ discard block |
||
| 218 | 246 | <?=$_lang['not_found']?>. |
| 219 | 247 | </span> |
| 220 | 248 | </p> |
| 221 | - <?php endif; ?> |
|
| 249 | + <?php endif; |
|
| 250 | +} |
|
| 251 | +?> |
|
| 222 | 252 | <?php endif; ?> |
| 223 | 253 | <?php endforeach; ?> |
| 224 | 254 | <?php endif; ?> |
@@ -234,7 +264,8 @@ discard block |
||
| 234 | 264 | <?php elseif($itemData['type'] === 'skip') : ?> |
| 235 | 265 | <!-- SKIP --> |
| 236 | 266 | <?php endif; ?> |
| 237 | - <?php else : ?> |
|
| 267 | + <?php else { |
|
| 268 | + : ?> |
|
| 238 | 269 | <?php if ($itemData['error']['type'] === 'sql') : ?> |
| 239 | 270 | <p>❌ <?=$itemData['error']['content']?></p> |
| 240 | 271 | <?php elseif ($itemData['error']['type'] === 'file_not_found') : ?> |
@@ -244,7 +275,9 @@ discard block |
||
| 244 | 275 | <?=$_lang['not_found']?>. |
| 245 | 276 | </span> |
| 246 | 277 | </p> |
| 247 | - <?php endif; ?> |
|
| 278 | + <?php endif; |
|
| 279 | +} |
|
| 280 | +?> |
|
| 248 | 281 | <?php endif; ?> |
| 249 | 282 | <?php endforeach; ?> |
| 250 | 283 | <?php endif; ?> |
@@ -262,7 +295,8 @@ discard block |
||
| 262 | 295 | <?php elseif($itemData['type'] === 'skip') : ?> |
| 263 | 296 | <!-- SKIP --> |
| 264 | 297 | <?php endif; ?> |
| 265 | - <?php else : ?> |
|
| 298 | + <?php else { |
|
| 299 | + : ?> |
|
| 266 | 300 | <?php if ($itemData['error']['type'] === 'sql') : ?> |
| 267 | 301 | <p>❌ <?=$itemData['error']['content']?></p> |
| 268 | 302 | <?php elseif ($itemData['error']['type'] === 'file_not_found') : ?> |
@@ -272,7 +306,9 @@ discard block |
||
| 272 | 306 | <?=$_lang['not_found']?>. |
| 273 | 307 | </span> |
| 274 | 308 | </p> |
| 275 | - <?php endif; ?> |
|
| 309 | + <?php endif; |
|
| 310 | +} |
|
| 311 | +?> |
|
| 276 | 312 | <?php endif; ?> |
| 277 | 313 | <?php endforeach; ?> |
| 278 | 314 | <?php endif; ?> |
@@ -281,7 +317,8 @@ discard block |
||
| 281 | 317 | <h3><?=$_lang['installing_demo_site']?></h3> |
| 282 | 318 | <?php if (empty($installDataLevel['demo']['error'])) : ?> |
| 283 | 319 | <p> ✓  <span class="ok"><?=$_lang['ok']?></span></p> |
| 284 | - <?php else : ?> |
|
| 320 | + <?php else { |
|
| 321 | + : ?> |
|
| 285 | 322 | <p><span class="notok"><b><?=$_lang['database_alerts']?></span></p> |
| 286 | 323 | <p><?=$_lang['setup_couldnt_install']?></p> |
| 287 | 324 | <p><?=$_lang['installation_error_occured']?></p> |
@@ -291,7 +328,9 @@ discard block |
||
| 291 | 328 | <?=$_lang['during_execution_of_sql']?> |
| 292 | 329 | <span class="mono"><?=htmlspecialchars($error['sql'])?></span> |
| 293 | 330 | <hr /> |
| 294 | - <?php endforeach; ?> |
|
| 331 | + <?php endforeach; |
|
| 332 | +} |
|
| 333 | +?> |
|
| 295 | 334 | <p><?=$_lang['some_tables_not_updated']?></p> |
| 296 | 335 | <?php endif; ?> |
| 297 | 336 | <?php endif; ?> |
@@ -316,10 +355,13 @@ discard block |
||
| 316 | 355 | <span class="ok"><?=$_lang['guid_set']?></span> |
| 317 | 356 | </p> |
| 318 | 357 | <?php endif; ?> |
| 319 | - <?php else : ?> |
|
| 358 | + <?php else { |
|
| 359 | + : ?> |
|
| 320 | 360 | <?php if ($itemData['error']['type'] === 'sql') : ?> |
| 321 | 361 | <p>❌ <?=$itemData['error']['content']?></p> |
| 322 | - <?php endif; ?> |
|
| 362 | + <?php endif; |
|
| 363 | +} |
|
| 364 | +?> |
|
| 323 | 365 | <?php endif; ?> |
| 324 | 366 | <?php endforeach; ?> |
| 325 | 367 | <?php endif; ?> |
@@ -332,12 +374,15 @@ discard block |
||
| 332 | 374 | <img src="img/ico_info.png" width="40" height="42" align="left" style="margin-right:10px;" /> |
| 333 | 375 | <?=$_lang['installation_note']?> |
| 334 | 376 | </p> |
| 335 | - <?php else : ?> |
|
| 377 | + <?php else { |
|
| 378 | + : ?> |
|
| 336 | 379 | <p> |
| 337 | 380 | <img src="img/ico_info.png" width="40" height="42" align="left" style="margin-right:10px;" /> |
| 338 | 381 | <?=$_lang['upgrade_note']?> |
| 339 | 382 | </p> |
| 340 | - <?php endif; ?> |
|
| 383 | + <?php endif; |
|
| 384 | +} |
|
| 385 | +?> |
|
| 341 | 386 | |
| 342 | 387 | <form name="install" id="install_form" action="index.php?action=options" method="post"> |
| 343 | 388 | <?php if ($errors === 0) : ?> |
@@ -350,11 +395,14 @@ discard block |
||
| 350 | 395 | /> |
| 351 | 396 | <?=$_lang['remove_install_folder_auto'] ?> |
| 352 | 397 | </span> |
| 353 | - <?php else : ?> |
|
| 398 | + <?php else { |
|
| 399 | + : ?> |
|
| 354 | 400 | <span id="removeinstall" style="float:left;color:#505050;line-height:18px;"> |
| 355 | 401 | <?=$_lang['remove_install_folder_manual'] ?> |
| 356 | 402 | </span> |
| 357 | - <?php endif; ?> |
|
| 403 | + <?php endif; |
|
| 404 | +} |
|
| 405 | +?> |
|
| 358 | 406 | <?php endif; ?> |
| 359 | 407 | <p class="buttonlinks"> |
| 360 | 408 | <a href="javascript:closepage();" title="<?=$_lang['btnclose_value'] ?>"> |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (file_exists(dirname(dirname(dirname(__DIR__))) . "/assets/cache/siteManager.php")) { |
|
| 3 | - include_once(dirname(dirname(dirname(__DIR__))) . "/assets/cache/siteManager.php"); |
|
| 2 | +if (file_exists(dirname(dirname(dirname(__DIR__)))."/assets/cache/siteManager.php")) { |
|
| 3 | + include_once(dirname(dirname(dirname(__DIR__)))."/assets/cache/siteManager.php"); |
|
| 4 | 4 | } else { |
| 5 | 5 | define('MGR_DIR', 'manager'); |
| 6 | 6 | } |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | // set timout limit |
| 26 | 26 | @ set_time_limit(120); // used @ to prevent warning when using safe mode? |
| 27 | 27 | |
| 28 | -$installMode = (int)$_POST['installmode']; |
|
| 29 | -$installData = (int)empty($_POST['installdata']); |
|
| 28 | +$installMode = (int) $_POST['installmode']; |
|
| 29 | +$installData = (int) empty($_POST['installdata']); |
|
| 30 | 30 | |
| 31 | 31 | // get db info from post |
| 32 | 32 | $database_server = $_POST['databasehost']; |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_')); |
| 37 | 37 | $database_connection_charset = $_POST['database_connection_charset']; |
| 38 | 38 | $database_connection_method = $_POST['database_connection_method']; |
| 39 | -$dbase = "`" . $_POST['database_name'] . "`"; |
|
| 39 | +$dbase = "`".$_POST['database_name']."`"; |
|
| 40 | 40 | $table_prefix = $_POST['tableprefix']; |
| 41 | 41 | $adminname = $_POST['cmsadmin']; |
| 42 | 42 | $adminemail = $_POST['cmsadminemail']; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | // set session name variable |
| 48 | 48 | if (!isset ($site_sessionname)) { |
| 49 | - $site_sessionname = 'SN' . uniqid(''); |
|
| 49 | + $site_sessionname = 'SN'.uniqid(''); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | // get base path and url |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | $pth = implode('install', $a); |
| 64 | 64 | unset ($a); |
| 65 | -$base_url = $url . (substr($url, -1) != '/' ? '/' : ''); |
|
| 66 | -$base_path = $pth . (substr($pth, -1) != '/' ? '/' : ''); |
|
| 65 | +$base_url = $url.(substr($url, -1) != '/' ? '/' : ''); |
|
| 66 | +$base_path = $pth.(substr($pth, -1) != '/' ? '/' : ''); |
|
| 67 | 67 | |
| 68 | 68 | // connect to the database |
| 69 | 69 | $conn = @mysqli_connect($database_server, $database_user, $database_password); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | if ($installLevel === 1) { |
| 93 | 93 | // check table prefix |
| 94 | 94 | if ($installMode === 0) { |
| 95 | - $query = "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`"; |
|
| 95 | + $query = "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`"; |
|
| 96 | 96 | @$checkPrefix = mysqli_query($conn, $query); |
| 97 | 97 | |
| 98 | 98 | if ($checkPrefix === false) { |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | // check status of Inherit Parent Template plugin |
| 110 | 110 | $auto_template_logic = 'parent'; |
| 111 | 111 | if ($installMode !== 0) { |
| 112 | - $query = "SELECT properties, disabled FROM " . $dbase . ".`" . $table_prefix . "site_plugins` WHERE name='Inherit Parent Template'"; |
|
| 112 | + $query = "SELECT properties, disabled FROM ".$dbase.".`".$table_prefix."site_plugins` WHERE name='Inherit Parent Template'"; |
|
| 113 | 113 | $rs = mysqli_query($conn, $query); |
| 114 | 114 | $row = mysqli_fetch_row($rs); |
| 115 | 115 | if (!$row) { |
@@ -132,8 +132,8 @@ discard block |
||
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | // open db connection |
| 135 | - include dirname(__DIR__) . '/processor/result.php'; |
|
| 136 | - include_once dirname(__DIR__) . '/sqlParser.class.php'; |
|
| 135 | + include dirname(__DIR__).'/processor/result.php'; |
|
| 136 | + include_once dirname(__DIR__).'/sqlParser.class.php'; |
|
| 137 | 137 | $sqlParser = new SqlParser( |
| 138 | 138 | $database_server, |
| 139 | 139 | $database_user, |
@@ -179,10 +179,10 @@ discard block |
||
| 179 | 179 | $confph['lastInstallTime'] = time(); |
| 180 | 180 | $confph['site_sessionname'] = $site_sessionname; |
| 181 | 181 | |
| 182 | - $configString = file_get_contents(dirname(dirname(__DIR__)) . '/stubs/config.tpl'); |
|
| 182 | + $configString = file_get_contents(dirname(dirname(__DIR__)).'/stubs/config.tpl'); |
|
| 183 | 183 | $configString = parse($configString, $confph); |
| 184 | 184 | |
| 185 | - $filename = dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/config.inc.php'; |
|
| 185 | + $filename = dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/config.inc.php'; |
|
| 186 | 186 | $configFileFailed = false; |
| 187 | 187 | if (@ !$handle = fopen($filename, 'w')) { |
| 188 | 188 | $configFileFailed = true; |
@@ -210,13 +210,13 @@ discard block |
||
| 210 | 210 | $siteid = uniqid(''); |
| 211 | 211 | mysqli_query( |
| 212 | 212 | $sqlParser->conn, |
| 213 | - "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid'),('manager_theme','default')" |
|
| 213 | + "REPLACE INTO $dbase.`".$table_prefix."system_settings` (setting_name,setting_value) VALUES('site_id','$siteid'),('manager_theme','default')" |
|
| 214 | 214 | ); |
| 215 | 215 | } else { |
| 216 | 216 | // update site_id if missing |
| 217 | 217 | $ds = mysqli_query( |
| 218 | 218 | $sqlParser->conn, |
| 219 | - "SELECT setting_name,setting_value FROM $dbase.`" . $table_prefix . "system_settings` WHERE setting_name='site_id'" |
|
| 219 | + "SELECT setting_name,setting_value FROM $dbase.`".$table_prefix."system_settings` WHERE setting_name='site_id'" |
|
| 220 | 220 | ); |
| 221 | 221 | if ($ds) { |
| 222 | 222 | $r = mysqli_fetch_assoc($ds); |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | $siteid = uniqid(''); |
| 226 | 226 | mysqli_query( |
| 227 | 227 | $sqlParser->conn, |
| 228 | - "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid')" |
|
| 228 | + "REPLACE INTO $dbase.`".$table_prefix."system_settings` (setting_name,setting_value) VALUES('site_id','$siteid')" |
|
| 229 | 229 | ); |
| 230 | 230 | } |
| 231 | 231 | } |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | if ($installLevel === 5 && (isset ($_POST['template']) || $installData)) { |
| 252 | 252 | $selTemplates = $_POST['template']; |
| 253 | 253 | foreach ($moduleTemplates as $k => $moduleTemplate) { |
| 254 | - if (! is_array($moduleTemplate)) { |
|
| 254 | + if (!is_array($moduleTemplate)) { |
|
| 255 | 255 | continue; |
| 256 | 256 | } |
| 257 | 257 | $installDataLevel['templates'][$moduleTemplate[0]] = array( |
@@ -289,12 +289,12 @@ discard block |
||
| 289 | 289 | $template = mysqli_real_escape_string($conn, $template); |
| 290 | 290 | |
| 291 | 291 | // See if the template already exists |
| 292 | - $query = "SELECT * FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$name'"; |
|
| 292 | + $query = "SELECT * FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$name'"; |
|
| 293 | 293 | $rs = mysqli_query($sqlParser->conn, $query); |
| 294 | 294 | |
| 295 | 295 | if (mysqli_num_rows($rs)) { |
| 296 | 296 | $installDataLevel['templates'][$moduleTemplate[0]]['type'] = 'update'; |
| 297 | - $query = "UPDATE $dbase.`" . $table_prefix . "site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked' WHERE templatename='$name' LIMIT 1;"; |
|
| 297 | + $query = "UPDATE $dbase.`".$table_prefix."site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked' WHERE templatename='$name' LIMIT 1;"; |
|
| 298 | 298 | if (!mysqli_query($sqlParser->conn, $query)) { |
| 299 | 299 | $errors += 1; |
| 300 | 300 | $installDataLevel['templates'][$moduleTemplate[0]]['error'] = array( |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | if (!is_null($save_sql_id_as)) { |
| 308 | 308 | $sql_id = @mysqli_insert_id($sqlParser->conn); |
| 309 | 309 | if (!$sql_id) { |
| 310 | - $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$name' LIMIT 1;"; |
|
| 310 | + $query = "SELECT id FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$name' LIMIT 1;"; |
|
| 311 | 311 | $idQuery = mysqli_fetch_assoc(mysqli_query($sqlParser->conn, $query)); |
| 312 | 312 | $sql_id = $idQuery['id']; |
| 313 | 313 | } |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | } |
| 316 | 316 | } else { |
| 317 | 317 | $installDataLevel['templates'][$moduleTemplate[0]]['type'] = 'create'; |
| 318 | - $query = "INSERT INTO $dbase.`" . $table_prefix . "site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template',$category_id,'$locked');"; |
|
| 318 | + $query = "INSERT INTO $dbase.`".$table_prefix."site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template',$category_id,'$locked');"; |
|
| 319 | 319 | if (!@mysqli_query($sqlParser->conn, $query)) { |
| 320 | 320 | $errors += 1; |
| 321 | 321 | $installDataLevel['templates'][$moduleTemplate[0]]['error'] = array( |
@@ -380,12 +380,12 @@ discard block |
||
| 380 | 380 | // Create the category if it does not already exist |
| 381 | 381 | $category = getCreateDbCategory($category, $sqlParser); |
| 382 | 382 | |
| 383 | - $query = "SELECT * FROM $dbase.`" . $table_prefix . "site_tmplvars` WHERE name='$name'"; |
|
| 384 | - $rs = mysqli_query($sqlParser->conn,$query); |
|
| 383 | + $query = "SELECT * FROM $dbase.`".$table_prefix."site_tmplvars` WHERE name='$name'"; |
|
| 384 | + $rs = mysqli_query($sqlParser->conn, $query); |
|
| 385 | 385 | if (mysqli_num_rows($rs)) { |
| 386 | 386 | $installDataLevel['tvs'][$moduleTV[0]]['type'] = 'update'; |
| 387 | 387 | while ($row = mysqli_fetch_assoc($rs)) { |
| 388 | - $query = "UPDATE $dbase.`" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};"; |
|
| 388 | + $query = "UPDATE $dbase.`".$table_prefix."site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};"; |
|
| 389 | 389 | if (!mysqli_query($sqlParser->conn, $query)) { |
| 390 | 390 | $installDataLevel['tvs'][$moduleTV[0]]['error'] = array( |
| 391 | 391 | 'type' => 'sql', |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | } |
| 399 | 399 | } else { |
| 400 | 400 | $installDataLevel['tvs'][$moduleTV[0]]['type'] = 'create'; |
| 401 | - $q = "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',$category,$locked,'$input_options','$output_widget','$output_widget_params','$input_default');"; |
|
| 401 | + $q = "INSERT INTO $dbase.`".$table_prefix."site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',$category,$locked,'$input_options','$output_widget','$output_widget_params','$input_default');"; |
|
| 402 | 402 | if (!mysqli_query($sqlParser->conn, $q)) { |
| 403 | 403 | $installDataLevel['tvs'][$moduleTV[0]]['error'] = array( |
| 404 | 404 | 'type' => 'sql', |
@@ -415,23 +415,23 @@ discard block |
||
| 415 | 415 | if (count($assignments) > 0) { |
| 416 | 416 | |
| 417 | 417 | // remove existing tv -> template assignments |
| 418 | - $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_tmplvars` WHERE name='$name' AND description='$desc';"; |
|
| 418 | + $query = "SELECT id FROM $dbase.`".$table_prefix."site_tmplvars` WHERE name='$name' AND description='$desc';"; |
|
| 419 | 419 | $ds = mysqli_query($sqlParser->conn, $query); |
| 420 | 420 | $row = mysqli_fetch_assoc($ds); |
| 421 | 421 | $id = $row["id"]; |
| 422 | - $query = 'DELETE FROM ' . $dbase . '.`' . $table_prefix . 'site_tmplvar_templates` WHERE tmplvarid = \'' . $id . '\''; |
|
| 422 | + $query = 'DELETE FROM '.$dbase.'.`'.$table_prefix.'site_tmplvar_templates` WHERE tmplvarid = \''.$id.'\''; |
|
| 423 | 423 | mysqli_query($sqlParser->conn, $query); |
| 424 | 424 | |
| 425 | 425 | // add tv -> template assignments |
| 426 | 426 | foreach ($assignments as $assignment) { |
| 427 | 427 | $template = mysqli_real_escape_string($conn, $assignment); |
| 428 | - $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$template';"; |
|
| 428 | + $query = "SELECT id FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$template';"; |
|
| 429 | 429 | $ts = mysqli_query($sqlParser->conn, $query); |
| 430 | 430 | if ($ds && $ts) { |
| 431 | 431 | $tRow = mysqli_fetch_assoc($ts); |
| 432 | 432 | $templateId = $tRow['id']; |
| 433 | - $query = "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)"; |
|
| 434 | - mysqli_query($sqlParser->conn,$query); |
|
| 433 | + $query = "INSERT INTO $dbase.`".$table_prefix."site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)"; |
|
| 434 | + mysqli_query($sqlParser->conn, $query); |
|
| 435 | 435 | } |
| 436 | 436 | } |
| 437 | 437 | } |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | if ($installLevel === 5 && $errorData === false && (isset ($_POST['chunk']) || $installData)) { |
| 444 | 444 | $selChunks = $_POST['chunk']; |
| 445 | 445 | foreach ($moduleChunks as $k => $moduleChunk) { |
| 446 | - if (! is_array($moduleChunk)) { |
|
| 446 | + if (!is_array($moduleChunk)) { |
|
| 447 | 447 | continue; |
| 448 | 448 | } |
| 449 | 449 | $installDataLevel['chunks'][$moduleChunk[0]] = array( |
@@ -481,14 +481,14 @@ discard block |
||
| 481 | 481 | $chunk = mysqli_real_escape_string($conn, $chunk); |
| 482 | 482 | $rs = mysqli_query( |
| 483 | 483 | $sqlParser->conn, |
| 484 | - "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$name'" |
|
| 484 | + "SELECT * FROM $dbase.`".$table_prefix."site_htmlsnippets` WHERE name='$name'" |
|
| 485 | 485 | ); |
| 486 | 486 | $count_original_name = mysqli_num_rows($rs); |
| 487 | 487 | if ($overwrite == 'false') { |
| 488 | - $newname = $name . '-' . str_replace('.', '_', $modx_version); |
|
| 488 | + $newname = $name.'-'.str_replace('.', '_', $modx_version); |
|
| 489 | 489 | $rs = mysqli_query( |
| 490 | 490 | $sqlParser->conn, |
| 491 | - "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'" |
|
| 491 | + "SELECT * FROM $dbase.`".$table_prefix."site_htmlsnippets` WHERE name='$newname'" |
|
| 492 | 492 | ); |
| 493 | 493 | $count_new_name = mysqli_num_rows($rs); |
| 494 | 494 | } |
@@ -496,7 +496,7 @@ discard block |
||
| 496 | 496 | if ($update) { |
| 497 | 497 | $installDataLevel['chunks'][$moduleChunk[0]]['type'] = 'update'; |
| 498 | 498 | if (!mysqli_query($sqlParser->conn, |
| 499 | - "UPDATE $dbase.`" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) { |
|
| 499 | + "UPDATE $dbase.`".$table_prefix."site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) { |
|
| 500 | 500 | $errors += 1; |
| 501 | 501 | $installDataLevel['chunks'][$moduleChunk[0]]['error'] = array( |
| 502 | 502 | 'type' => 'sql', |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | } else { |
| 514 | 514 | $installDataLevel['chunks'][$moduleChunk[0]]['type'] = 'create'; |
| 515 | 515 | } |
| 516 | - $query = "INSERT INTO $dbase.`" . $table_prefix . "site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk',$category_id);"; |
|
| 516 | + $query = "INSERT INTO $dbase.`".$table_prefix."site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk',$category_id);"; |
|
| 517 | 517 | if (!mysqli_query($sqlParser->conn, $query)) { |
| 518 | 518 | $errors += 1; |
| 519 | 519 | $installDataLevel['chunks'][$moduleChunk[0]]['error'] = array( |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | if ($installLevel === 5 && $errorData === false && (isset ($_POST['module']) || $installData)) { |
| 537 | 537 | $selModules = $_POST['module']; |
| 538 | 538 | foreach ($moduleModules as $k => $moduleModule) { |
| 539 | - if (! is_array($moduleModule)) { |
|
| 539 | + if (!is_array($moduleModule)) { |
|
| 540 | 540 | continue; |
| 541 | 541 | } |
| 542 | 542 | $installDataLevel['modules'][$moduleModule[0]] = array( |
@@ -575,13 +575,13 @@ discard block |
||
| 575 | 575 | // $module = removeDocblock($module, 'module'); // Modules have no fileBinding, keep docblock for info-tab |
| 576 | 576 | $module = mysqli_real_escape_string($conn, $module); |
| 577 | 577 | $rs = mysqli_query($sqlParser->conn, |
| 578 | - "SELECT * FROM $dbase.`" . $table_prefix . "site_modules` WHERE name='$name'"); |
|
| 578 | + "SELECT * FROM $dbase.`".$table_prefix."site_modules` WHERE name='$name'"); |
|
| 579 | 579 | if (mysqli_num_rows($rs)) { |
| 580 | 580 | $installDataLevel['modules'][$moduleModule[0]]['type'] = 'update'; |
| 581 | 581 | $row = mysqli_fetch_assoc($rs); |
| 582 | 582 | $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties'])); |
| 583 | 583 | if (!mysqli_query($sqlParser->conn, |
| 584 | - "UPDATE $dbase.`" . $table_prefix . "site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) { |
|
| 584 | + "UPDATE $dbase.`".$table_prefix."site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) { |
|
| 585 | 585 | $installDataLevel['modules'][$moduleModule[0]]['error'] = array( |
| 586 | 586 | 'type' => 'sql', |
| 587 | 587 | 'content' => mysqli_error($sqlParser->conn) |
@@ -593,7 +593,7 @@ discard block |
||
| 593 | 593 | $installDataLevel['modules'][$moduleModule[0]]['type'] = 'create'; |
| 594 | 594 | $properties = mysqli_real_escape_string($conn, parseProperties($properties, true)); |
| 595 | 595 | if (!mysqli_query($sqlParser->conn, |
| 596 | - "INSERT INTO $dbase.`" . $table_prefix . "site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', $category);")) { |
|
| 596 | + "INSERT INTO $dbase.`".$table_prefix."site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', $category);")) { |
|
| 597 | 597 | $installDataLevel['modules'][$moduleModule[0]]['error'] = array( |
| 598 | 598 | 'type' => 'sql', |
| 599 | 599 | 'content' => mysqli_error($sqlParser->conn) |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | if ($installLevel === 5 && $errorData === false && (isset ($_POST['plugin']) || $installData)) { |
| 614 | 614 | $selPlugs = $_POST['plugin']; |
| 615 | 615 | foreach ($modulePlugins as $k => $modulePlugin) { |
| 616 | - if (! is_array($modulePlugin)) { |
|
| 616 | + if (!is_array($modulePlugin)) { |
|
| 617 | 617 | continue; |
| 618 | 618 | } |
| 619 | 619 | $installDataLevel['plugins'][$modulePlugin[0]] = array( |
@@ -647,12 +647,12 @@ discard block |
||
| 647 | 647 | $disabled = $modulePlugin[9]; |
| 648 | 648 | if (array_key_exists(7, $modulePlugin)) { |
| 649 | 649 | // parse comma-separated legacy names and prepare them for sql IN clause |
| 650 | - $leg_names = "'" . implode( |
|
| 650 | + $leg_names = "'".implode( |
|
| 651 | 651 | "','", |
| 652 | 652 | preg_split('/\s*,\s*/', mysqli_real_escape_string($conn, $modulePlugin[7])) |
| 653 | - ) . "'"; |
|
| 653 | + )."'"; |
|
| 654 | 654 | } |
| 655 | - if (! file_exists($filecontent)) { |
|
| 655 | + if (!file_exists($filecontent)) { |
|
| 656 | 656 | $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array( |
| 657 | 657 | 'type' => 'file_not_found' |
| 658 | 658 | ); |
@@ -660,7 +660,7 @@ discard block |
||
| 660 | 660 | |
| 661 | 661 | // disable legacy versions based on legacy_names provided |
| 662 | 662 | if (!empty($leg_names)) { |
| 663 | - $update_query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE name IN ($leg_names);"; |
|
| 663 | + $update_query = "UPDATE $dbase.`".$table_prefix."site_plugins` SET disabled='1' WHERE name IN ($leg_names);"; |
|
| 664 | 664 | $rs = mysqli_query($sqlParser->conn, $update_query); |
| 665 | 665 | } |
| 666 | 666 | |
@@ -670,7 +670,7 @@ discard block |
||
| 670 | 670 | $plugin = end(preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2)); |
| 671 | 671 | $plugin = removeDocblock($plugin, 'plugin'); |
| 672 | 672 | $plugin = mysqli_real_escape_string($conn, $plugin); |
| 673 | - $query = "SELECT * FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='$name'"; |
|
| 673 | + $query = "SELECT * FROM $dbase.`".$table_prefix."site_plugins` WHERE name='$name'"; |
|
| 674 | 674 | $rs = mysqli_query($sqlParser->conn, $query); |
| 675 | 675 | if (mysqli_num_rows($rs)) { |
| 676 | 676 | $installDataLevel['plugins'][$modulePlugin[0]]['type'] = 'update'; |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | while ($row = mysqli_fetch_assoc($rs)) { |
| 679 | 679 | $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties'])); |
| 680 | 680 | if ($row['description'] == $desc) { |
| 681 | - $query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};"; |
|
| 681 | + $query = "UPDATE $dbase.`".$table_prefix."site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};"; |
|
| 682 | 682 | if (!mysqli_query($sqlParser->conn, $query)) { |
| 683 | 683 | $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array( |
| 684 | 684 | 'type' => 'sql', |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | } |
| 690 | 690 | $insert = false; |
| 691 | 691 | } else { |
| 692 | - $query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE id={$row['id']};"; |
|
| 692 | + $query = "UPDATE $dbase.`".$table_prefix."site_plugins` SET disabled='1' WHERE id={$row['id']};"; |
|
| 693 | 693 | if (!mysqli_query($sqlParser->conn, $query)) { |
| 694 | 694 | $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array( |
| 695 | 695 | 'type' => 'sql', |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | } |
| 703 | 703 | if ($insert === true) { |
| 704 | 704 | $properties = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties'])); |
| 705 | - $query = "INSERT INTO $dbase.`" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','0',$category);"; |
|
| 705 | + $query = "INSERT INTO $dbase.`".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','0',$category);"; |
|
| 706 | 706 | if (!mysqli_query($sqlParser->conn, $query)) { |
| 707 | 707 | $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array( |
| 708 | 708 | 'type' => 'sql', |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | } else { |
| 716 | 716 | $installDataLevel['plugins'][$modulePlugin[0]]['type'] = 'create'; |
| 717 | 717 | $properties = mysqli_real_escape_string($conn, parseProperties($properties, true)); |
| 718 | - $query = "INSERT INTO $dbase.`" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,category,disabled) VALUES('$name','$desc','$plugin','$properties','$guid',$category,$disabled);"; |
|
| 718 | + $query = "INSERT INTO $dbase.`".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,category,disabled) VALUES('$name','$desc','$plugin','$properties','$guid',$category,$disabled);"; |
|
| 719 | 719 | if (!mysqli_query($sqlParser->conn, $query)) { |
| 720 | 720 | $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array( |
| 721 | 721 | 'type' => 'sql', |
@@ -727,17 +727,17 @@ discard block |
||
| 727 | 727 | } |
| 728 | 728 | // add system events |
| 729 | 729 | if (count($events) > 0) { |
| 730 | - $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='$name' AND description='$desc';"; |
|
| 730 | + $query = "SELECT id FROM $dbase.`".$table_prefix."site_plugins` WHERE name='$name' AND description='$desc';"; |
|
| 731 | 731 | $ds = mysqli_query($sqlParser->conn, $query); |
| 732 | 732 | if ($ds) { |
| 733 | 733 | $row = mysqli_fetch_assoc($ds); |
| 734 | 734 | $id = $row["id"]; |
| 735 | 735 | // remove existing events |
| 736 | - $query = 'DELETE FROM ' . $dbase . '.`' . $table_prefix . 'site_plugin_events` WHERE pluginid = \'' . $id . '\''; |
|
| 736 | + $query = 'DELETE FROM '.$dbase.'.`'.$table_prefix.'site_plugin_events` WHERE pluginid = \''.$id.'\''; |
|
| 737 | 737 | mysqli_query($sqlParser->conn, $query); |
| 738 | 738 | // add new events |
| 739 | - $query = "INSERT INTO $dbase.`" . $table_prefix . "site_plugin_events` (pluginid, evtid) SELECT '$id' as 'pluginid',se.id as 'evtid' FROM $dbase.`" . $table_prefix . "system_eventnames` se WHERE name IN ('" . implode("','", $events) . "')"; |
|
| 740 | - mysqli_query($sqlParser->conn,$query); |
|
| 739 | + $query = "INSERT INTO $dbase.`".$table_prefix."site_plugin_events` (pluginid, evtid) SELECT '$id' as 'pluginid',se.id as 'evtid' FROM $dbase.`".$table_prefix."system_eventnames` se WHERE name IN ('".implode("','", $events)."')"; |
|
| 740 | + mysqli_query($sqlParser->conn, $query); |
|
| 741 | 741 | } |
| 742 | 742 | } |
| 743 | 743 | } |
@@ -751,7 +751,7 @@ discard block |
||
| 751 | 751 | if ($installLevel === 5 && $errorData === false && (isset ($_POST['snippet']) || $installData)) { |
| 752 | 752 | $selSnips = $_POST['snippet']; |
| 753 | 753 | foreach ($moduleSnippets as $k => $moduleSnippet) { |
| 754 | - if (! is_array($moduleSnippet)) { |
|
| 754 | + if (!is_array($moduleSnippet)) { |
|
| 755 | 755 | continue; |
| 756 | 756 | } |
| 757 | 757 | $installDataLevel['snippets'][$moduleSnippet[0]] = array( |
@@ -786,13 +786,13 @@ discard block |
||
| 786 | 786 | $snippet = removeDocblock($snippet, 'snippet'); |
| 787 | 787 | $snippet = mysqli_real_escape_string($conn, $snippet); |
| 788 | 788 | $rs = mysqli_query($sqlParser->conn, |
| 789 | - "SELECT * FROM $dbase.`" . $table_prefix . "site_snippets` WHERE name='$name'"); |
|
| 789 | + "SELECT * FROM $dbase.`".$table_prefix."site_snippets` WHERE name='$name'"); |
|
| 790 | 790 | if (mysqli_num_rows($rs)) { |
| 791 | 791 | $installDataLevel['snippets'][$moduleSnippet[0]]['type'] = 'update'; |
| 792 | 792 | $row = mysqli_fetch_assoc($rs); |
| 793 | 793 | $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties'])); |
| 794 | 794 | if (!mysqli_query($sqlParser->conn, |
| 795 | - "UPDATE $dbase.`" . $table_prefix . "site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) { |
|
| 795 | + "UPDATE $dbase.`".$table_prefix."site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) { |
|
| 796 | 796 | $installDataLevel['snippets'][$moduleSnippet[0]]['error'] = array( |
| 797 | 797 | 'type' => 'sql', |
| 798 | 798 | 'content' => mysqli_error($sqlParser->conn) |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | $installDataLevel['snippets'][$moduleSnippet[0]]['type'] = 'create'; |
| 805 | 805 | $properties = mysqli_real_escape_string($conn, parseProperties($properties, true)); |
| 806 | 806 | if (!mysqli_query($sqlParser->conn, |
| 807 | - "INSERT INTO $dbase.`" . $table_prefix . "site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties',$category);")) { |
|
| 807 | + "INSERT INTO $dbase.`".$table_prefix."site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties',$category);")) { |
|
| 808 | 808 | $installDataLevel['snippets'][$moduleSnippet[0]]['error'] = array( |
| 809 | 809 | 'type' => 'sql', |
| 810 | 810 | 'content' => mysqli_error($sqlParser->conn) |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | 'content' => '' //dependency name or error message |
| 872 | 872 | )*/ |
| 873 | 873 | ); |
| 874 | - $query = 'SELECT id, guid FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_modules` WHERE name="' . $dependency['module'] . '"'; |
|
| 874 | + $query = 'SELECT id, guid FROM '.$dbase.'`'.$sqlParser->prefix.'site_modules` WHERE name="'.$dependency['module'].'"'; |
|
| 875 | 875 | $ds = mysqli_query($sqlParser->conn, $query); |
| 876 | 876 | if (!$ds) { |
| 877 | 877 | $installDependencyLevel[$dependency['module']]['error'] = array( |
@@ -886,7 +886,7 @@ discard block |
||
| 886 | 886 | $moduleGuid = $row["guid"]; |
| 887 | 887 | } |
| 888 | 888 | // get extra id |
| 889 | - $query = 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE ' . $dependency['column'] . '="' . $dependency['name'] . '"'; |
|
| 889 | + $query = 'SELECT id FROM '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` WHERE '.$dependency['column'].'="'.$dependency['name'].'"'; |
|
| 890 | 890 | $ds = mysqli_query($sqlParser->conn, $query); |
| 891 | 891 | if (!$ds) { |
| 892 | 892 | $installDependencyLevel[$dependency['module']]['error'] = array( |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | $extraId = $row["id"]; |
| 901 | 901 | } |
| 902 | 902 | // setup extra as module dependency |
| 903 | - $query = 'SELECT module FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type'] . ' LIMIT 1'; |
|
| 903 | + $query = 'SELECT module FROM '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` WHERE module='.$moduleId.' AND resource='.$extraId.' AND type='.$dependency['type'].' LIMIT 1'; |
|
| 904 | 904 | $ds = mysqli_query($sqlParser->conn, $query); |
| 905 | 905 | if (!$ds) { |
| 906 | 906 | $installDependencyLevel[$dependency['module']]['error'] = array( |
@@ -911,17 +911,17 @@ discard block |
||
| 911 | 911 | break; |
| 912 | 912 | } else { |
| 913 | 913 | if (mysqli_num_rows($ds) === 0) { |
| 914 | - $query = 'INSERT INTO ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` (module, resource, type) VALUES(' . $moduleId . ',' . $extraId . ',' . $dependency['type'] . ')'; |
|
| 914 | + $query = 'INSERT INTO '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` (module, resource, type) VALUES('.$moduleId.','.$extraId.','.$dependency['type'].')'; |
|
| 915 | 915 | mysqli_query($sqlParser->conn, $query); |
| 916 | 916 | $installDependencyLevel[$dependency['module']]['type'] = 'create'; |
| 917 | 917 | } else { |
| 918 | - $query = 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` SET module = ' . $moduleId . ', resource = ' . $extraId . ', type = ' . $dependency['type'] . ' WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type']; |
|
| 918 | + $query = 'UPDATE '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` SET module = '.$moduleId.', resource = '.$extraId.', type = '.$dependency['type'].' WHERE module='.$moduleId.' AND resource='.$extraId.' AND type='.$dependency['type']; |
|
| 919 | 919 | mysqli_query($sqlParser->conn, $query); |
| 920 | 920 | $installDependencyLevel[$dependency['module']]['type'] = 'update'; |
| 921 | 921 | } |
| 922 | 922 | if ($dependency['type'] == 30 || $dependency['type'] == 40) { |
| 923 | 923 | // set extra guid for plugins and snippets |
| 924 | - $query = 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE id=' . $extraId . ' LIMIT 1'; |
|
| 924 | + $query = 'SELECT id FROM '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` WHERE id='.$extraId.' LIMIT 1'; |
|
| 925 | 925 | $ds = mysqli_query($sqlParser->conn, $query); |
| 926 | 926 | if (!$ds) { |
| 927 | 927 | $installDependencyLevel[$dependency['module']]['extra'] = array( |
@@ -932,8 +932,8 @@ discard block |
||
| 932 | 932 | break; |
| 933 | 933 | } else { |
| 934 | 934 | if (mysqli_num_rows($ds) != 0) { |
| 935 | - $query = 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` SET moduleguid = ' . $moduleGuid . ' WHERE id=' . $extraId; |
|
| 936 | - $ds= mysqli_query($sqlParser->conn, $query); |
|
| 935 | + $query = 'UPDATE '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` SET moduleguid = '.$moduleGuid.' WHERE id='.$extraId; |
|
| 936 | + $ds = mysqli_query($sqlParser->conn, $query); |
|
| 937 | 937 | $installDependencyLevel[$dependency['module']]['extra'] = array( |
| 938 | 938 | 'type' => 'done', |
| 939 | 939 | 'content' => $dependency['name'] |
@@ -955,48 +955,48 @@ discard block |
||
| 955 | 955 | } |
| 956 | 956 | |
| 957 | 957 | // Setup the MODX API -- needed for the cache processor |
| 958 | - if (file_exists(dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/config_mutator.php')) { |
|
| 959 | - require_once dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/config_mutator.php'; |
|
| 958 | + if (file_exists(dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/config_mutator.php')) { |
|
| 959 | + require_once dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/config_mutator.php'; |
|
| 960 | 960 | } |
| 961 | 961 | define('MODX_API_MODE', true); |
| 962 | 962 | if (!defined('MODX_BASE_PATH')) { |
| 963 | 963 | define('MODX_BASE_PATH', $base_path); |
| 964 | 964 | } |
| 965 | 965 | if (!defined('MODX_MANAGER_PATH')) { |
| 966 | - define('MODX_MANAGER_PATH', $base_path . MGR_DIR . '/'); |
|
| 966 | + define('MODX_MANAGER_PATH', $base_path.MGR_DIR.'/'); |
|
| 967 | 967 | } |
| 968 | 968 | $database_type = 'mysqli'; |
| 969 | 969 | // initiate a new document parser |
| 970 | 970 | if (!defined('EVO_BOOTSTRAP_FILE')) { |
| 971 | 971 | define('EVO_BOOTSTRAP_FILE', |
| 972 | - dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/bootstrap.php'); |
|
| 973 | - require_once dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/bootstrap.php'; |
|
| 972 | + dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/bootstrap.php'); |
|
| 973 | + require_once dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/bootstrap.php'; |
|
| 974 | 974 | } |
| 975 | 975 | |
| 976 | - include_once(dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/document.parser.class.inc.php'); |
|
| 976 | + include_once(dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/document.parser.class.inc.php'); |
|
| 977 | 977 | $modx = new DocumentParser; |
| 978 | 978 | $modx->db->connect(); |
| 979 | 979 | // always empty cache after install |
| 980 | 980 | $sync = new EvolutionCMS\Cache(); |
| 981 | - $sync->setCachepath(dirname(dirname(dirname(__DIR__))) . '/assets/cache/'); |
|
| 981 | + $sync->setCachepath(dirname(dirname(dirname(__DIR__))).'/assets/cache/'); |
|
| 982 | 982 | $sync->setReport(false); |
| 983 | 983 | $sync->emptyCache(); // first empty the cache |
| 984 | 984 | |
| 985 | 985 | // try to chmod the cache go-rwx (for suexeced php) |
| 986 | - @chmod(dirname(dirname(dirname(__DIR__))) . '/assets/cache/siteCache.idx.php', 0600); |
|
| 987 | - @chmod(dirname(dirname(dirname(__DIR__))) . '/assets/cache/sitePublishing.idx.php', 0600); |
|
| 986 | + @chmod(dirname(dirname(dirname(__DIR__))).'/assets/cache/siteCache.idx.php', 0600); |
|
| 987 | + @chmod(dirname(dirname(dirname(__DIR__))).'/assets/cache/sitePublishing.idx.php', 0600); |
|
| 988 | 988 | |
| 989 | 989 | // remove any locks on the manager functions so initial manager login is not blocked |
| 990 | - mysqli_query($conn, "TRUNCATE TABLE `" . $table_prefix . "active_users`"); |
|
| 990 | + mysqli_query($conn, "TRUNCATE TABLE `".$table_prefix."active_users`"); |
|
| 991 | 991 | |
| 992 | 992 | // close db connection |
| 993 | 993 | $sqlParser->close(); |
| 994 | 994 | |
| 995 | 995 | // andrazk 20070416 - release manager access |
| 996 | - if (file_exists(dirname(dirname(dirname(__DIR__))) . '/assets/cache/installProc.inc.php')) { |
|
| 997 | - @chmod(dirname(dirname(dirname(__DIR__))) . '/assets/cache/installProc.inc.php', 0755); |
|
| 998 | - unlink(dirname(dirname(dirname(__DIR__))) . '/assets/cache/installProc.inc.php'); |
|
| 996 | + if (file_exists(dirname(dirname(dirname(__DIR__))).'/assets/cache/installProc.inc.php')) { |
|
| 997 | + @chmod(dirname(dirname(dirname(__DIR__))).'/assets/cache/installProc.inc.php', 0755); |
|
| 998 | + unlink(dirname(dirname(dirname(__DIR__))).'/assets/cache/installProc.inc.php'); |
|
| 999 | 999 | } |
| 1000 | 1000 | } |
| 1001 | 1001 | } |
| 1002 | -include_once dirname(__DIR__) . '/template/actions/install.php'; |
|
| 1002 | +include_once dirname(__DIR__).'/template/actions/install.php'; |
|
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | |
| 295 | 295 | if (mysqli_num_rows($rs)) { |
| 296 | 296 | $installDataLevel['templates'][$moduleTemplate[0]]['type'] = 'update'; |
| 297 | - $query = "UPDATE $dbase.`" . $table_prefix . "site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked' WHERE templatename='$name' LIMIT 1;"; |
|
| 297 | + $query = "update $dbase.`" . $table_prefix . "site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked' WHERE templatename='$name' LIMIT 1;"; |
|
| 298 | 298 | if (!mysqli_query($sqlParser->conn, $query)) { |
| 299 | 299 | $errors += 1; |
| 300 | 300 | $installDataLevel['templates'][$moduleTemplate[0]]['error'] = array( |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | if (mysqli_num_rows($rs)) { |
| 386 | 386 | $installDataLevel['tvs'][$moduleTV[0]]['type'] = 'update'; |
| 387 | 387 | while ($row = mysqli_fetch_assoc($rs)) { |
| 388 | - $query = "UPDATE $dbase.`" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};"; |
|
| 388 | + $query = "update $dbase.`" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};"; |
|
| 389 | 389 | if (!mysqli_query($sqlParser->conn, $query)) { |
| 390 | 390 | $installDataLevel['tvs'][$moduleTV[0]]['error'] = array( |
| 391 | 391 | 'type' => 'sql', |
@@ -496,7 +496,7 @@ discard block |
||
| 496 | 496 | if ($update) { |
| 497 | 497 | $installDataLevel['chunks'][$moduleChunk[0]]['type'] = 'update'; |
| 498 | 498 | if (!mysqli_query($sqlParser->conn, |
| 499 | - "UPDATE $dbase.`" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) { |
|
| 499 | + "update $dbase.`" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) { |
|
| 500 | 500 | $errors += 1; |
| 501 | 501 | $installDataLevel['chunks'][$moduleChunk[0]]['error'] = array( |
| 502 | 502 | 'type' => 'sql', |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | $row = mysqli_fetch_assoc($rs); |
| 582 | 582 | $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties'])); |
| 583 | 583 | if (!mysqli_query($sqlParser->conn, |
| 584 | - "UPDATE $dbase.`" . $table_prefix . "site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) { |
|
| 584 | + "update $dbase.`" . $table_prefix . "site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) { |
|
| 585 | 585 | $installDataLevel['modules'][$moduleModule[0]]['error'] = array( |
| 586 | 586 | 'type' => 'sql', |
| 587 | 587 | 'content' => mysqli_error($sqlParser->conn) |
@@ -660,7 +660,7 @@ discard block |
||
| 660 | 660 | |
| 661 | 661 | // disable legacy versions based on legacy_names provided |
| 662 | 662 | if (!empty($leg_names)) { |
| 663 | - $update_query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE name IN ($leg_names);"; |
|
| 663 | + $update_query = "update $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE name IN ($leg_names);"; |
|
| 664 | 664 | $rs = mysqli_query($sqlParser->conn, $update_query); |
| 665 | 665 | } |
| 666 | 666 | |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | while ($row = mysqli_fetch_assoc($rs)) { |
| 679 | 679 | $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties'])); |
| 680 | 680 | if ($row['description'] == $desc) { |
| 681 | - $query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};"; |
|
| 681 | + $query = "update $dbase.`" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};"; |
|
| 682 | 682 | if (!mysqli_query($sqlParser->conn, $query)) { |
| 683 | 683 | $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array( |
| 684 | 684 | 'type' => 'sql', |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | } |
| 690 | 690 | $insert = false; |
| 691 | 691 | } else { |
| 692 | - $query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE id={$row['id']};"; |
|
| 692 | + $query = "update $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE id={$row['id']};"; |
|
| 693 | 693 | if (!mysqli_query($sqlParser->conn, $query)) { |
| 694 | 694 | $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array( |
| 695 | 695 | 'type' => 'sql', |
@@ -792,7 +792,7 @@ discard block |
||
| 792 | 792 | $row = mysqli_fetch_assoc($rs); |
| 793 | 793 | $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties'])); |
| 794 | 794 | if (!mysqli_query($sqlParser->conn, |
| 795 | - "UPDATE $dbase.`" . $table_prefix . "site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) { |
|
| 795 | + "update $dbase.`" . $table_prefix . "site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) { |
|
| 796 | 796 | $installDataLevel['snippets'][$moduleSnippet[0]]['error'] = array( |
| 797 | 797 | 'type' => 'sql', |
| 798 | 798 | 'content' => mysqli_error($sqlParser->conn) |
@@ -3,13 +3,13 @@ discard block |
||
| 3 | 3 | * EVO Installer |
| 4 | 4 | */ |
| 5 | 5 | error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); |
| 6 | -$base_path = dirname(__DIR__) . '/'; |
|
| 6 | +$base_path = dirname(__DIR__).'/'; |
|
| 7 | 7 | |
| 8 | -if (is_file($base_path . 'assets/cache/siteManager.php')) { |
|
| 9 | - include_once $base_path . 'assets/cache/siteManager.php'; |
|
| 8 | +if (is_file($base_path.'assets/cache/siteManager.php')) { |
|
| 9 | + include_once $base_path.'assets/cache/siteManager.php'; |
|
| 10 | 10 | } |
| 11 | -if (! defined('MGR_DIR')) { |
|
| 12 | - if (is_dir($base_path . 'manager')) { |
|
| 11 | +if (!defined('MGR_DIR')) { |
|
| 12 | + if (is_dir($base_path.'manager')) { |
|
| 13 | 13 | define('MGR_DIR', 'manager'); |
| 14 | 14 | } else { |
| 15 | 15 | die('MGR_DIR is not defined'); |
@@ -19,12 +19,12 @@ discard block |
||
| 19 | 19 | require_once 'src/functions.php'; |
| 20 | 20 | |
| 21 | 21 | if (empty($_GET['self'])) { |
| 22 | - $autoloader = realpath(__DIR__ . '/../vendor/autoload.php'); |
|
| 22 | + $autoloader = realpath(__DIR__.'/../vendor/autoload.php'); |
|
| 23 | 23 | if (file_exists($autoloader) && is_readable($autoloader)) { |
| 24 | 24 | include_once $autoloader; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - require_once '../' . MGR_DIR . '/includes/version.inc.php'; |
|
| 27 | + require_once '../'.MGR_DIR.'/includes/version.inc.php'; |
|
| 28 | 28 | |
| 29 | 29 | // start session |
| 30 | 30 | session_start(); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | install_sessionCheck(); |
| 33 | 33 | |
| 34 | 34 | $moduleName = 'EVO'; |
| 35 | - $moduleVersion = $modx_branch . ' ' . $modx_version; |
|
| 35 | + $moduleVersion = $modx_branch.' '.$modx_version; |
|
| 36 | 36 | $moduleRelease = $modx_release_date; |
| 37 | 37 | $moduleSQLBaseFile = 'stubs/sql/setup.sql'; |
| 38 | 38 | $moduleSQLDataFile = 'stubs/sql/setup.data.sql'; |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | $action = isset($_GET['action']) ? trim(strip_tags($_GET['action'])) : 'language'; |
| 74 | 74 | str_replace('.', '', $action); |
| 75 | 75 | |
| 76 | - $controller = 'src/controllers/' . $action . '.php'; |
|
| 77 | - if (! file_exists($controller)) { |
|
| 76 | + $controller = 'src/controllers/'.$action.'.php'; |
|
| 77 | + if (!file_exists($controller)) { |
|
| 78 | 78 | die("Invalid install action attempted. [action={$action}]"); |
| 79 | 79 | } |
| 80 | 80 | require $controller; |
@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | } else { |
| 87 | 87 | $action = isset($_GET['action']) && is_scalar($_GET['action']) ? trim($_GET['action']) : 'language'; |
| 88 | 88 | str_replace('.', '', $action); |
| 89 | - $controller = 'src/controllers/' . $action . '.php'; |
|
| 90 | - if (! file_exists($controller)) { |
|
| 89 | + $controller = 'src/controllers/'.$action.'.php'; |
|
| 90 | + if (!file_exists($controller)) { |
|
| 91 | 91 | die("Invalid install action attempted. [action={$action}]"); |
| 92 | 92 | } |
| 93 | 93 | require $controller; |
@@ -7,8 +7,8 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | $self = 'install/cli-install.php'; |
| 10 | -$path = __DIR__ . '/'; |
|
| 11 | -$base_path = dirname(__DIR__) . '/'; |
|
| 10 | +$path = __DIR__.'/'; |
|
| 11 | +$base_path = dirname(__DIR__).'/'; |
|
| 12 | 12 | define('MODX_API_MODE', true); |
| 13 | 13 | define('MODX_BASE_PATH', $base_path); |
| 14 | 14 | define('MODX_SITE_URL', '/'); |
@@ -18,22 +18,22 @@ discard block |
||
| 18 | 18 | // set error reporting |
| 19 | 19 | error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); |
| 20 | 20 | |
| 21 | -if (is_file($base_path . "assets/cache/siteManager.php")) { |
|
| 22 | - include_once($base_path . "assets/cache/siteManager.php"); |
|
| 21 | +if (is_file($base_path."assets/cache/siteManager.php")) { |
|
| 22 | + include_once($base_path."assets/cache/siteManager.php"); |
|
| 23 | 23 | } |
| 24 | -if (!defined('MGR_DIR') && is_dir($base_path . "manager")) { |
|
| 24 | +if (!defined('MGR_DIR') && is_dir($base_path."manager")) { |
|
| 25 | 25 | define('MGR_DIR', 'manager'); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | require_once 'src/lang.php'; |
| 29 | -require_once($base_path . MGR_DIR . '/includes/version.inc.php'); |
|
| 29 | +require_once($base_path.MGR_DIR.'/includes/version.inc.php'); |
|
| 30 | 30 | |
| 31 | 31 | $moduleName = "EVO"; |
| 32 | -$moduleVersion = $modx_branch . ' ' . $modx_version; |
|
| 32 | +$moduleVersion = $modx_branch.' '.$modx_version; |
|
| 33 | 33 | $moduleRelease = $modx_release_date; |
| 34 | -$moduleSQLBaseFile = $path . 'stubs/sql/setup.sql'; |
|
| 35 | -$moduleSQLDataFile = $path . 'stubs/sql/setup.data.sql'; |
|
| 36 | -$moduleSQLResetFile = $path . 'stubs/sql/setup.data.reset.sql'; |
|
| 34 | +$moduleSQLBaseFile = $path.'stubs/sql/setup.sql'; |
|
| 35 | +$moduleSQLDataFile = $path.'stubs/sql/setup.data.sql'; |
|
| 36 | +$moduleSQLResetFile = $path.'stubs/sql/setup.data.reset.sql'; |
|
| 37 | 37 | |
| 38 | 38 | $moduleChunks = array(); // chunks - array : name, description, type - 0:file or 1:content, file or content |
| 39 | 39 | $moduleTemplates = array(); // templates - array : name, description, type - 0:file or 1:content, file or content |
@@ -48,29 +48,29 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | $installMode = 0; |
| 50 | 50 | $installData = 0; |
| 51 | -$tableprefixauto = base_convert(rand(10, 20), 10, 36) . substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyz'), |
|
| 52 | - rand(0, 33), 3) . '_'; |
|
| 51 | +$tableprefixauto = base_convert(rand(10, 20), 10, 36).substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyz'), |
|
| 52 | + rand(0, 33), 3).'_'; |
|
| 53 | 53 | |
| 54 | 54 | $args = array_slice($argv, 1); |
| 55 | 55 | |
| 56 | 56 | if (empty($args)) { |
| 57 | - echo 'Install Evolution CMS' . PHP_EOL; |
|
| 57 | + echo 'Install Evolution CMS'.PHP_EOL; |
|
| 58 | 58 | //$installYes = readline("Type 'y' to continue: "); |
| 59 | 59 | //if ($installYes != 'y') return; |
| 60 | 60 | |
| 61 | 61 | //set param manual |
| 62 | - $databasehost = readline($_lang['connection_screen_database_host'] . ' [localhost] '); |
|
| 63 | - $databaseloginname = readline($_lang['connection_screen_database_login'] . ' '); |
|
| 64 | - $databaseloginpassword = readline($_lang['connection_screen_database_pass'] . ' '); |
|
| 65 | - $database_name = readline($_lang['connection_screen_database_name'] . ' '); |
|
| 66 | - $tableprefix = readline($_lang['connection_screen_table_prefix'] . ' [' . $tableprefixauto . '] '); |
|
| 67 | - $database_connection_method = readline($_lang['connection_screen_connection_method'] . ' [SET CHARACTER SET] '); |
|
| 68 | - $database_collation = readline($_lang['connection_screen_collation'] . ' [utf8_general_ci] '); |
|
| 69 | - $cmsadmin = readline($_lang['connection_screen_default_admin_login'] . ' [admin] '); |
|
| 70 | - $cmsadminemail = readline($_lang['connection_screen_default_admin_email'] . ' '); |
|
| 71 | - $cmspassword = readline($_lang['connection_screen_default_admin_password'] . ' '); |
|
| 72 | - $managerlanguage = readline('Мanager language:' . ' [en] '); |
|
| 73 | - $installData = readline('Instal demo-site (y/n):' . ' [n] '); |
|
| 62 | + $databasehost = readline($_lang['connection_screen_database_host'].' [localhost] '); |
|
| 63 | + $databaseloginname = readline($_lang['connection_screen_database_login'].' '); |
|
| 64 | + $databaseloginpassword = readline($_lang['connection_screen_database_pass'].' '); |
|
| 65 | + $database_name = readline($_lang['connection_screen_database_name'].' '); |
|
| 66 | + $tableprefix = readline($_lang['connection_screen_table_prefix'].' ['.$tableprefixauto.'] '); |
|
| 67 | + $database_connection_method = readline($_lang['connection_screen_connection_method'].' [SET CHARACTER SET] '); |
|
| 68 | + $database_collation = readline($_lang['connection_screen_collation'].' [utf8_general_ci] '); |
|
| 69 | + $cmsadmin = readline($_lang['connection_screen_default_admin_login'].' [admin] '); |
|
| 70 | + $cmsadminemail = readline($_lang['connection_screen_default_admin_email'].' '); |
|
| 71 | + $cmspassword = readline($_lang['connection_screen_default_admin_password'].' '); |
|
| 72 | + $managerlanguage = readline('Мanager language:'.' [en] '); |
|
| 73 | + $installData = readline('Instal demo-site (y/n):'.' [n] '); |
|
| 74 | 74 | |
| 75 | 75 | } else { |
| 76 | 76 | |
@@ -169,114 +169,114 @@ discard block |
||
| 169 | 169 | // check PHP version |
| 170 | 170 | define('PHP_MIN_VERSION', '5.4.0'); |
| 171 | 171 | $phpMinVersion = PHP_MIN_VERSION; // Maybe not necessary. For backward compatibility |
| 172 | -echo PHP_EOL . $_lang['checking_php_version']; |
|
| 172 | +echo PHP_EOL.$_lang['checking_php_version']; |
|
| 173 | 173 | // -1 if left is less, 0 if equal, +1 if left is higher |
| 174 | 174 | if (version_compare(phpversion(), PHP_MIN_VERSION) < 0) { |
| 175 | 175 | $errors++; |
| 176 | - $tmp = $_lang['you_running_php'] . phpversion() . str_replace('[+min_version+]', PHP_MIN_VERSION, |
|
| 176 | + $tmp = $_lang['you_running_php'].phpversion().str_replace('[+min_version+]', PHP_MIN_VERSION, |
|
| 177 | 177 | $_lang["modx_requires_php"]); |
| 178 | - echo $_lang['failed'] . ' ' . $tmp . PHP_EOL; |
|
| 178 | + echo $_lang['failed'].' '.$tmp.PHP_EOL; |
|
| 179 | 179 | } else { |
| 180 | - echo $_lang['ok'] . PHP_EOL; |
|
| 180 | + echo $_lang['ok'].PHP_EOL; |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | // check directories |
| 184 | 184 | // cache exists? |
| 185 | 185 | echo strip_tags($_lang['checking_if_cache_exist']); |
| 186 | -if (!file_exists($path . "../assets/cache") || !file_exists($path . "../assets/cache/rss")) { |
|
| 187 | - echo $_lang['failed'] . PHP_EOL; |
|
| 186 | +if (!file_exists($path."../assets/cache") || !file_exists($path."../assets/cache/rss")) { |
|
| 187 | + echo $_lang['failed'].PHP_EOL; |
|
| 188 | 188 | $errors++; |
| 189 | 189 | } else { |
| 190 | - echo $_lang['ok'] . PHP_EOL; |
|
| 190 | + echo $_lang['ok'].PHP_EOL; |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | |
| 194 | 194 | // cache writable? |
| 195 | 195 | echo strip_tags($_lang['checking_if_cache_writable']); |
| 196 | -if (!is_writable($path . "../assets/cache")) { |
|
| 196 | +if (!is_writable($path."../assets/cache")) { |
|
| 197 | 197 | $errors++; |
| 198 | - echo $_lang['failed'] . PHP_EOL; |
|
| 198 | + echo $_lang['failed'].PHP_EOL; |
|
| 199 | 199 | } else { |
| 200 | - echo $_lang['ok'] . PHP_EOL; |
|
| 200 | + echo $_lang['ok'].PHP_EOL; |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | |
| 204 | 204 | // cache files writable? |
| 205 | 205 | echo strip_tags($_lang['checking_if_cache_file_writable']); |
| 206 | -$tmp = $path . "../assets/cache/siteCache.idx.php"; |
|
| 206 | +$tmp = $path."../assets/cache/siteCache.idx.php"; |
|
| 207 | 207 | if (!file_exists($tmp)) { |
| 208 | 208 | f_owc($tmp, "<?php //EVO site cache file ?>"); |
| 209 | 209 | } |
| 210 | 210 | if (!is_writable($tmp)) { |
| 211 | 211 | $errors++; |
| 212 | - echo $_lang['failed'] . PHP_EOL; |
|
| 212 | + echo $_lang['failed'].PHP_EOL; |
|
| 213 | 213 | } else { |
| 214 | - echo $_lang['ok'] . PHP_EOL; |
|
| 214 | + echo $_lang['ok'].PHP_EOL; |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | |
| 218 | 218 | echo strip_tags($_lang['checking_if_cache_file2_writable']); |
| 219 | -if (!is_writable($path . "../assets/cache/sitePublishing.idx.php")) { |
|
| 219 | +if (!is_writable($path."../assets/cache/sitePublishing.idx.php")) { |
|
| 220 | 220 | $errors++; |
| 221 | - echo $_lang['failed'] . PHP_EOL; |
|
| 221 | + echo $_lang['failed'].PHP_EOL; |
|
| 222 | 222 | } else { |
| 223 | - echo $_lang['ok'] . PHP_EOL; |
|
| 223 | + echo $_lang['ok'].PHP_EOL; |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | |
| 227 | 227 | // File Browser directories exists? |
| 228 | 228 | echo strip_tags($_lang['checking_if_images_exist']); |
| 229 | 229 | switch (true) { |
| 230 | - case !file_exists($path . "../assets/images"): |
|
| 231 | - case !file_exists($path . "../assets/files"): |
|
| 232 | - case !file_exists($path . "../assets/backup"): |
|
| 230 | + case !file_exists($path."../assets/images"): |
|
| 231 | + case !file_exists($path."../assets/files"): |
|
| 232 | + case !file_exists($path."../assets/backup"): |
|
| 233 | 233 | //case !file_exists("../assets/.thumbs"): |
| 234 | 234 | $errors++; |
| 235 | - echo $_lang['failed'] . PHP_EOL; |
|
| 235 | + echo $_lang['failed'].PHP_EOL; |
|
| 236 | 236 | break; |
| 237 | 237 | default: |
| 238 | - echo $_lang['ok'] . PHP_EOL; |
|
| 238 | + echo $_lang['ok'].PHP_EOL; |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | |
| 242 | 242 | // File Browser directories writable? |
| 243 | 243 | echo strip_tags($_lang['checking_if_images_writable']); |
| 244 | 244 | switch (true) { |
| 245 | - case !is_writable($path . "../assets/images"): |
|
| 246 | - case !is_writable($path . "../assets/files"): |
|
| 247 | - case !is_writable($path . "../assets/backup"): |
|
| 245 | + case !is_writable($path."../assets/images"): |
|
| 246 | + case !is_writable($path."../assets/files"): |
|
| 247 | + case !is_writable($path."../assets/backup"): |
|
| 248 | 248 | //case !is_writable("../assets/.thumbs"): |
| 249 | 249 | $errors++; |
| 250 | - echo $_lang['failed'] . PHP_EOL; |
|
| 250 | + echo $_lang['failed'].PHP_EOL; |
|
| 251 | 251 | break; |
| 252 | 252 | default: |
| 253 | - echo $_lang['ok'] . PHP_EOL; |
|
| 253 | + echo $_lang['ok'].PHP_EOL; |
|
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | |
| 257 | 257 | // export exists? |
| 258 | 258 | echo strip_tags($_lang['checking_if_export_exists']); |
| 259 | -if (!file_exists($path . "../assets/export")) { |
|
| 260 | - echo $_lang['failed'] . PHP_EOL; |
|
| 259 | +if (!file_exists($path."../assets/export")) { |
|
| 260 | + echo $_lang['failed'].PHP_EOL; |
|
| 261 | 261 | $errors++; |
| 262 | 262 | } else { |
| 263 | - echo $_lang['ok'] . PHP_EOL; |
|
| 263 | + echo $_lang['ok'].PHP_EOL; |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | |
| 267 | 267 | // export writable? |
| 268 | 268 | echo strip_tags($_lang['checking_if_export_writable']); |
| 269 | -if (!is_writable($path . "../assets/export")) { |
|
| 270 | - echo $_lang['failed'] . PHP_EOL; |
|
| 269 | +if (!is_writable($path."../assets/export")) { |
|
| 270 | + echo $_lang['failed'].PHP_EOL; |
|
| 271 | 271 | $errors++; |
| 272 | 272 | } else { |
| 273 | - echo $_lang['ok'] . PHP_EOL; |
|
| 273 | + echo $_lang['ok'].PHP_EOL; |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | |
| 277 | 277 | // config.inc.php writable? |
| 278 | 278 | echo strip_tags($_lang['checking_if_config_exist_and_writable']); |
| 279 | -$tmp = $path . "../" . MGR_DIR . "/includes/config.inc.php"; |
|
| 279 | +$tmp = $path."../".MGR_DIR."/includes/config.inc.php"; |
|
| 280 | 280 | if (!is_file($tmp)) { |
| 281 | 281 | f_owc($tmp, "<?php //EVO configuration file ?>", 0666); |
| 282 | 282 | } else { |
@@ -285,15 +285,15 @@ discard block |
||
| 285 | 285 | $isWriteable = is_writable($tmp); |
| 286 | 286 | if (!$isWriteable) { |
| 287 | 287 | $errors++; |
| 288 | - echo $_lang['failed'] . PHP_EOL; |
|
| 288 | + echo $_lang['failed'].PHP_EOL; |
|
| 289 | 289 | } else { |
| 290 | - echo $_lang['ok'] . PHP_EOL; |
|
| 290 | + echo $_lang['ok'].PHP_EOL; |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | |
| 294 | 294 | // connect to the database |
| 295 | 295 | if ($installMode == 1) { |
| 296 | - include $path . "../" . MGR_DIR . "/includes/config.inc.php"; |
|
| 296 | + include $path."../".MGR_DIR."/includes/config.inc.php"; |
|
| 297 | 297 | } else { |
| 298 | 298 | // get db info from post |
| 299 | 299 | $database_server = $databasehost; |
@@ -303,22 +303,22 @@ discard block |
||
| 303 | 303 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_') - 1); |
| 304 | 304 | $database_connection_charset = $database_collation; |
| 305 | 305 | $database_connection_method = $database_connection_method; |
| 306 | - $dbase = '`' . $database_name . '`'; |
|
| 306 | + $dbase = '`'.$database_name.'`'; |
|
| 307 | 307 | $table_prefix = $tableprefix; |
| 308 | 308 | } |
| 309 | 309 | echo $_lang['creating_database_connection']; |
| 310 | 310 | if (!$conn = mysqli_connect($database_server, $database_user, $database_password)) { |
| 311 | 311 | $errors++; |
| 312 | - echo $_lang['database_connection_failed'] . PHP_EOL; |
|
| 312 | + echo $_lang['database_connection_failed'].PHP_EOL; |
|
| 313 | 313 | } else { |
| 314 | - echo $_lang['ok'] . PHP_EOL; |
|
| 314 | + echo $_lang['ok'].PHP_EOL; |
|
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | |
| 318 | 318 | // make sure we can use the database |
| 319 | 319 | if ($installMode > 0 && !mysqli_query($conn, "USE {$dbase}")) { |
| 320 | 320 | $errors++; |
| 321 | - echo $_lang['database_use_failed'] . PHP_EOL; |
|
| 321 | + echo $_lang['database_use_failed'].PHP_EOL; |
|
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | // check the database collation if not specified in the configuration |
@@ -343,22 +343,22 @@ discard block |
||
| 343 | 343 | |
| 344 | 344 | // check table prefix |
| 345 | 345 | if ($conn && $installMode == 0) { |
| 346 | - echo $_lang['checking_table_prefix'] . $table_prefix . '`: '; |
|
| 347 | - if ($rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`")) { |
|
| 348 | - echo $_lang['failed'] . ' ' . $_lang['table_prefix_already_inuse_note'] . PHP_EOL; |
|
| 346 | + echo $_lang['checking_table_prefix'].$table_prefix.'`: '; |
|
| 347 | + if ($rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`")) { |
|
| 348 | + echo $_lang['failed'].' '.$_lang['table_prefix_already_inuse_note'].PHP_EOL; |
|
| 349 | 349 | $errors++; |
| 350 | 350 | |
| 351 | 351 | } else { |
| 352 | - echo $_lang['ok'] . PHP_EOL; |
|
| 352 | + echo $_lang['ok'].PHP_EOL; |
|
| 353 | 353 | } |
| 354 | 354 | } elseif ($conn && $installMode == 2) { |
| 355 | - echo $_lang['checking_table_prefix'] . $table_prefix . '`: '; |
|
| 356 | - if (!$rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`")) { |
|
| 357 | - echo $_lang['failed'] . ' ' . $_lang['table_prefix_not_exist'] . PHP_EOL; |
|
| 355 | + echo $_lang['checking_table_prefix'].$table_prefix.'`: '; |
|
| 356 | + if (!$rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`")) { |
|
| 357 | + echo $_lang['failed'].' '.$_lang['table_prefix_not_exist'].PHP_EOL; |
|
| 358 | 358 | $errors++; |
| 359 | 359 | |
| 360 | 360 | } else { |
| 361 | - echo $_lang['ok'] . PHP_EOL; |
|
| 361 | + echo $_lang['ok'].PHP_EOL; |
|
| 362 | 362 | } |
| 363 | 363 | } |
| 364 | 364 | |
@@ -366,10 +366,10 @@ discard block |
||
| 366 | 366 | if ($conn) { |
| 367 | 367 | echo $_lang['checking_mysql_version']; |
| 368 | 368 | if (version_compare(mysqli_get_server_info($conn), '5.0.51', '=')) { |
| 369 | - echo $_lang['warning'] . ' ' . $_lang['mysql_5051'] . PHP_EOL; |
|
| 370 | - echo $_lang['mysql_5051_warning'] . PHP_EOL; |
|
| 369 | + echo $_lang['warning'].' '.$_lang['mysql_5051'].PHP_EOL; |
|
| 370 | + echo $_lang['mysql_5051_warning'].PHP_EOL; |
|
| 371 | 371 | } else { |
| 372 | - echo $_lang['ok'] . ' ' . $_lang['mysql_version_is'] . mysqli_get_server_info($conn) . PHP_EOL; |
|
| 372 | + echo $_lang['ok'].' '.$_lang['mysql_version_is'].mysqli_get_server_info($conn).PHP_EOL; |
|
| 373 | 373 | } |
| 374 | 374 | } |
| 375 | 375 | |
@@ -383,40 +383,40 @@ discard block |
||
| 383 | 383 | // print_r($modes); |
| 384 | 384 | foreach ($modes as $mode) { |
| 385 | 385 | if (stristr($mode, "STRICT_TRANS_TABLES") !== false || stristr($mode, "STRICT_ALL_TABLES") !== false) { |
| 386 | - echo $_lang['warning'] . ' ' . $_lang['strict_mode'] . PHP_EOL; |
|
| 387 | - echo $_lang['strict_mode_error'] . PHP_EOL; |
|
| 386 | + echo $_lang['warning'].' '.$_lang['strict_mode'].PHP_EOL; |
|
| 387 | + echo $_lang['strict_mode_error'].PHP_EOL; |
|
| 388 | 388 | } else { |
| 389 | - echo $_lang['ok'] . PHP_EOL; |
|
| 389 | + echo $_lang['ok'].PHP_EOL; |
|
| 390 | 390 | } |
| 391 | 391 | } |
| 392 | 392 | } else { |
| 393 | - echo $_lang['ok'] . PHP_EOL; |
|
| 393 | + echo $_lang['ok'].PHP_EOL; |
|
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 | // Version and strict mode check end |
| 397 | 397 | |
| 398 | 398 | // andrazk 20070416 - add install flag and disable manager login |
| 399 | 399 | // assets/cache writable? |
| 400 | -if (is_writable($path . "../assets/cache")) { |
|
| 401 | - if (file_exists($path . '../assets/cache/installProc.inc.php')) { |
|
| 402 | - @chmod($path . '../assets/cache/installProc.inc.php', 0755); |
|
| 403 | - unlink($path . '../assets/cache/installProc.inc.php'); |
|
| 400 | +if (is_writable($path."../assets/cache")) { |
|
| 401 | + if (file_exists($path.'../assets/cache/installProc.inc.php')) { |
|
| 402 | + @chmod($path.'../assets/cache/installProc.inc.php', 0755); |
|
| 403 | + unlink($path.'../assets/cache/installProc.inc.php'); |
|
| 404 | 404 | } |
| 405 | 405 | |
| 406 | - f_owc($path . "../assets/cache/installProc.inc.php", '<?php $installStartTime = ' . time() . '; ?>'); |
|
| 406 | + f_owc($path."../assets/cache/installProc.inc.php", '<?php $installStartTime = '.time().'; ?>'); |
|
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | if ($installMode > 0 && $_POST['installdata'] == "1") { |
| 410 | - echo $_lang['sample_web_site'] . ': ' . $_lang['sample_web_site_note'] . PHP_EOL; |
|
| 410 | + echo $_lang['sample_web_site'].': '.$_lang['sample_web_site_note'].PHP_EOL; |
|
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | if ($errors > 0) { |
| 414 | - echo $_lang['setup_cannot_continue'] . ' '; |
|
| 414 | + echo $_lang['setup_cannot_continue'].' '; |
|
| 415 | 415 | |
| 416 | 416 | if ($errors > 1) { |
| 417 | - echo $errors . " " . $_lang['errors'] . $_lang['please_correct_errors'] . $_lang['and_try_again_plural']; |
|
| 417 | + echo $errors." ".$_lang['errors'].$_lang['please_correct_errors'].$_lang['and_try_again_plural']; |
|
| 418 | 418 | } else { |
| 419 | - echo $_lang['error'] . $_lang['please_correct_error'] . $_lang['and_try_again'] . PHP_EOL; |
|
| 419 | + echo $_lang['error'].$_lang['please_correct_error'].$_lang['and_try_again'].PHP_EOL; |
|
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | die(); |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | |
| 434 | 434 | |
| 435 | 435 | if ($installMode == 1) { |
| 436 | - include $path . "../" . MGR_DIR . "/includes/config.inc.php"; |
|
| 436 | + include $path."../".MGR_DIR."/includes/config.inc.php"; |
|
| 437 | 437 | } else { |
| 438 | 438 | // get db info from post |
| 439 | 439 | $database_server = $databasehost; |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_')); |
| 444 | 444 | $database_connection_charset = $database_charset; |
| 445 | 445 | $database_connection_method = $database_connection_method; |
| 446 | - $dbase = "`" . $database_name . "`"; |
|
| 446 | + $dbase = "`".$database_name."`"; |
|
| 447 | 447 | $table_prefix = $tableprefix; |
| 448 | 448 | $adminname = $cmsadmin; |
| 449 | 449 | $adminemail = $cmsadminemail; |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | |
| 455 | 455 | // set session name variable |
| 456 | 456 | if (!isset ($site_sessionname)) { |
| 457 | - $site_sessionname = 'SN' . uniqid(''); |
|
| 457 | + $site_sessionname = 'SN'.uniqid(''); |
|
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | // get base path and url |
@@ -470,64 +470,64 @@ discard block |
||
| 470 | 470 | } |
| 471 | 471 | $pth = implode("install", $a); |
| 472 | 472 | unset ($a); |
| 473 | -$base_url = $url . (substr($url, -1) != "/" ? "/" : ""); |
|
| 474 | -$base_path = $pth . (substr($pth, -1) != "/" ? "/" : ""); |
|
| 473 | +$base_url = $url.(substr($url, -1) != "/" ? "/" : ""); |
|
| 474 | +$base_path = $pth.(substr($pth, -1) != "/" ? "/" : ""); |
|
| 475 | 475 | |
| 476 | 476 | // connect to the database |
| 477 | -echo $_lang['setup_database_create_connection'] . ': '; |
|
| 477 | +echo $_lang['setup_database_create_connection'].': '; |
|
| 478 | 478 | if (!$conn = mysqli_connect($database_server, $database_user, $database_password)) { |
| 479 | - echo $_lang["setup_database_create_connection_failed"] . " " . $_lang['setup_database_create_connection_failed_note'] . PHP_EOL; |
|
| 479 | + echo $_lang["setup_database_create_connection_failed"]." ".$_lang['setup_database_create_connection_failed_note'].PHP_EOL; |
|
| 480 | 480 | |
| 481 | 481 | return; |
| 482 | 482 | } else { |
| 483 | - echo $_lang['ok'] . PHP_EOL; |
|
| 483 | + echo $_lang['ok'].PHP_EOL; |
|
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | // select database |
| 487 | -echo $_lang['setup_database_selection'] . str_replace("`", "", $dbase) . "`: "; |
|
| 487 | +echo $_lang['setup_database_selection'].str_replace("`", "", $dbase)."`: "; |
|
| 488 | 488 | if (!mysqli_select_db($conn, str_replace("`", "", $dbase))) { |
| 489 | - echo $_lang['setup_database_selection_failed'] . " " . $_lang['setup_database_selection_failed_note'] . PHP_EOL; |
|
| 489 | + echo $_lang['setup_database_selection_failed']." ".$_lang['setup_database_selection_failed_note'].PHP_EOL; |
|
| 490 | 490 | $create = true; |
| 491 | 491 | } else { |
| 492 | 492 | if (function_exists('mysqli_set_charset')) { |
| 493 | 493 | mysqli_set_charset($conn, $database_charset); |
| 494 | 494 | } |
| 495 | 495 | mysqli_query($conn, "{$database_connection_method} {$database_connection_charset}"); |
| 496 | - echo $_lang['ok'] . PHP_EOL; |
|
| 496 | + echo $_lang['ok'].PHP_EOL; |
|
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | // try to create the database |
| 500 | 500 | if ($create) { |
| 501 | - echo $_lang['setup_database_creation'] . str_replace("`", "", $dbase) . "`: "; |
|
| 501 | + echo $_lang['setup_database_creation'].str_replace("`", "", $dbase)."`: "; |
|
| 502 | 502 | // if(!@mysqli_create_db(str_replace("`","",$dbase), $conn)) { |
| 503 | 503 | if (!mysqli_query($conn, |
| 504 | 504 | "CREATE DATABASE $dbase DEFAULT CHARACTER SET $database_charset COLLATE $database_collation")) { |
| 505 | - echo $_lang['setup_database_creation_failed'] . " " . $_lang['setup_database_creation_failed_note'] . PHP_EOL; |
|
| 505 | + echo $_lang['setup_database_creation_failed']." ".$_lang['setup_database_creation_failed_note'].PHP_EOL; |
|
| 506 | 506 | $errors += 1; |
| 507 | 507 | |
| 508 | - echo 'database charset: ' . $database_charset . PHP_EOL; |
|
| 509 | - echo 'database collation: ' . $database_collation . PHP_EOL; |
|
| 508 | + echo 'database charset: '.$database_charset.PHP_EOL; |
|
| 509 | + echo 'database collation: '.$database_collation.PHP_EOL; |
|
| 510 | 510 | |
| 511 | - echo $_lang['setup_database_creation_failed_note2'] . PHP_EOL; |
|
| 511 | + echo $_lang['setup_database_creation_failed_note2'].PHP_EOL; |
|
| 512 | 512 | |
| 513 | 513 | die(); |
| 514 | 514 | |
| 515 | 515 | } else { |
| 516 | - echo $_lang['ok'] . PHP_EOL; |
|
| 516 | + echo $_lang['ok'].PHP_EOL; |
|
| 517 | 517 | } |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | // check table prefix |
| 521 | 521 | if ($installMode == 0) { |
| 522 | - echo $_lang['checking_table_prefix'] . $table_prefix . "`: "; |
|
| 523 | - if (@ $rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`")) { |
|
| 524 | - echo $_lang['failed'] . " " . $_lang['table_prefix_already_inuse'] . PHP_EOL; |
|
| 522 | + echo $_lang['checking_table_prefix'].$table_prefix."`: "; |
|
| 523 | + if (@ $rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`")) { |
|
| 524 | + echo $_lang['failed']." ".$_lang['table_prefix_already_inuse'].PHP_EOL; |
|
| 525 | 525 | $errors += 1; |
| 526 | - echo $_lang['table_prefix_already_inuse_note'] . PHP_EOL; |
|
| 526 | + echo $_lang['table_prefix_already_inuse_note'].PHP_EOL; |
|
| 527 | 527 | |
| 528 | 528 | return; |
| 529 | 529 | } else { |
| 530 | - echo $_lang['ok'] . PHP_EOL; |
|
| 530 | + echo $_lang['ok'].PHP_EOL; |
|
| 531 | 531 | } |
| 532 | 532 | } |
| 533 | 533 | |
@@ -569,7 +569,7 @@ discard block |
||
| 569 | 569 | $auto_template_logic = 'parent'; |
| 570 | 570 | if ($installMode != 0) { |
| 571 | 571 | $rs = mysqli_query($conn, |
| 572 | - "SELECT properties, disabled FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='Inherit Parent Template'"); |
|
| 572 | + "SELECT properties, disabled FROM $dbase.`".$table_prefix."site_plugins` WHERE name='Inherit Parent Template'"); |
|
| 573 | 573 | $row = mysqli_fetch_row($rs); |
| 574 | 574 | if (!$row) { |
| 575 | 575 | // not installed |
@@ -593,12 +593,12 @@ discard block |
||
| 593 | 593 | |
| 594 | 594 | // open db connection |
| 595 | 595 | $setupPath = realpath(__DIR__); |
| 596 | -$chunkPath = $path . 'assets/chunks'; |
|
| 597 | -$snippetPath = $path . 'assets/snippets'; |
|
| 598 | -$pluginPath = $path . 'assets/plugins'; |
|
| 599 | -$modulePath = $path . 'assets/modules'; |
|
| 600 | -$templatePath = $path . 'assets/templates'; |
|
| 601 | -$tvPath = $path . 'assets/tvs'; |
|
| 596 | +$chunkPath = $path.'assets/chunks'; |
|
| 597 | +$snippetPath = $path.'assets/snippets'; |
|
| 598 | +$pluginPath = $path.'assets/plugins'; |
|
| 599 | +$modulePath = $path.'assets/modules'; |
|
| 600 | +$templatePath = $path.'assets/templates'; |
|
| 601 | +$tvPath = $path.'assets/tvs'; |
|
| 602 | 602 | |
| 603 | 603 | // setup Template template files - array : name, description, type - 0:file or 1:content, parameters, category |
| 604 | 604 | $mt = &$moduleTemplates; |
@@ -611,8 +611,7 @@ discard block |
||
| 611 | 611 | $params = parse_docblock($templatePath, $tplfile); |
| 612 | 612 | if (is_array($params) && (count($params) > 0)) { |
| 613 | 613 | $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}"; |
| 614 | - $mt[] = array |
|
| 615 | - ( |
|
| 614 | + $mt[] = array( |
|
| 616 | 615 | $params['name'], |
| 617 | 616 | $description, |
| 618 | 617 | // Don't think this is gonna be used ... but adding it just in case 'type' |
@@ -732,7 +731,7 @@ discard block |
||
| 732 | 731 | $params['modx_category'], |
| 733 | 732 | $params['legacy_names'], |
| 734 | 733 | array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false, |
| 735 | - (int)$params['disabled'] |
|
| 734 | + (int) $params['disabled'] |
|
| 736 | 735 | ); |
| 737 | 736 | } |
| 738 | 737 | } |
@@ -757,12 +756,12 @@ discard block |
||
| 757 | 756 | "$modulePath/{$params['filename']}", |
| 758 | 757 | $params['properties'], |
| 759 | 758 | $params['guid'], |
| 760 | - (int)$params['shareparams'], |
|
| 759 | + (int) $params['shareparams'], |
|
| 761 | 760 | $params['modx_category'], |
| 762 | 761 | array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false |
| 763 | 762 | ); |
| 764 | 763 | } |
| 765 | - if ((int)$params['shareparams'] || !empty($params['dependencies'])) { |
|
| 764 | + if ((int) $params['shareparams'] || !empty($params['dependencies'])) { |
|
| 766 | 765 | $dependencies = explode(',', $params['dependencies']); |
| 767 | 766 | foreach ($dependencies as $dependency) { |
| 768 | 767 | $dependency = explode(':', $dependency); |
@@ -833,7 +832,7 @@ discard block |
||
| 833 | 832 | // setup callback function |
| 834 | 833 | $callBackFnc = "clean_up"; |
| 835 | 834 | |
| 836 | -include $path . "src/sqlParser.class.php"; |
|
| 835 | +include $path."src/sqlParser.class.php"; |
|
| 837 | 836 | $sqlParser = new SqlParser($database_server, $database_user, $database_password, str_replace("`", "", $dbase), |
| 838 | 837 | $table_prefix, $adminname, $adminemail, $adminpass, $database_connection_charset, $managerlanguage, |
| 839 | 838 | $database_connection_method, $auto_template_logic); |
@@ -854,21 +853,21 @@ discard block |
||
| 854 | 853 | // display database results |
| 855 | 854 | if ($sqlParser->installFailed == true) { |
| 856 | 855 | $errors += 1; |
| 857 | - echo $_lang['database_alerts'] . PHP_EOL; |
|
| 858 | - echo $_lang['setup_couldnt_install'] . PHP_EOL; |
|
| 859 | - echo $_lang['installation_error_occured'] . PHP_EOL; |
|
| 856 | + echo $_lang['database_alerts'].PHP_EOL; |
|
| 857 | + echo $_lang['setup_couldnt_install'].PHP_EOL; |
|
| 858 | + echo $_lang['installation_error_occured'].PHP_EOL; |
|
| 860 | 859 | for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) { |
| 861 | - echo $sqlParser->mysqlErrors[$i]["error"] . " " . $_lang['during_execution_of_sql'] . " " . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . PHP_EOL; |
|
| 860 | + echo $sqlParser->mysqlErrors[$i]["error"]." ".$_lang['during_execution_of_sql']." ".strip_tags($sqlParser->mysqlErrors[$i]["sql"]).PHP_EOL; |
|
| 862 | 861 | } |
| 863 | - echo $_lang['some_tables_not_updated'] . PHP_EOL; |
|
| 862 | + echo $_lang['some_tables_not_updated'].PHP_EOL; |
|
| 864 | 863 | die(); |
| 865 | 864 | } else { |
| 866 | - echo $_lang['ok'] . PHP_EOL; |
|
| 865 | + echo $_lang['ok'].PHP_EOL; |
|
| 867 | 866 | } |
| 868 | 867 | } |
| 869 | 868 | |
| 870 | 869 | // custom or not |
| 871 | -if (file_exists($path . "../assets/cache/siteManager.php")) { |
|
| 870 | +if (file_exists($path."../assets/cache/siteManager.php")) { |
|
| 872 | 871 | $mgrdir = 'include_once(__DIR__."/../../assets/cache/siteManager.php");'; |
| 873 | 872 | } else { |
| 874 | 873 | $mgrdir = 'define(\'MGR_DIR\', \'manager\');'; |
@@ -888,10 +887,10 @@ discard block |
||
| 888 | 887 | $confph['lastInstallTime'] = time(); |
| 889 | 888 | $confph['site_sessionname'] = $site_sessionname; |
| 890 | 889 | |
| 891 | -$configString = file_get_contents($path . 'stubs/config.tpl'); |
|
| 890 | +$configString = file_get_contents($path.'stubs/config.tpl'); |
|
| 892 | 891 | $configString = parse($configString, $confph); |
| 893 | 892 | |
| 894 | -$filename = $base_path . MGR_DIR . '/includes/config.inc.php'; |
|
| 893 | +$filename = $base_path.MGR_DIR.'/includes/config.inc.php'; |
|
| 895 | 894 | $configFileFailed = false; |
| 896 | 895 | if (@ !$handle = fopen($filename, 'w')) { |
| 897 | 896 | $configFileFailed = true; |
@@ -907,38 +906,38 @@ discard block |
||
| 907 | 906 | $chmodSuccess = @chmod($filename, 0404); |
| 908 | 907 | |
| 909 | 908 | if ($configFileFailed == true) { |
| 910 | - echo $_lang['failed'] . PHP_EOL; |
|
| 909 | + echo $_lang['failed'].PHP_EOL; |
|
| 911 | 910 | $errors += 1; |
| 912 | 911 | |
| 913 | - echo $_lang['cant_write_config_file'] . ' ' . MGR_DIR . '/includes/config.inc.php' . PHP_EOL; |
|
| 914 | - echo ' ' . PHP_EOL; |
|
| 915 | - echo ' ' . PHP_EOL; |
|
| 912 | + echo $_lang['cant_write_config_file'].' '.MGR_DIR.'/includes/config.inc.php'.PHP_EOL; |
|
| 913 | + echo ' '.PHP_EOL; |
|
| 914 | + echo ' '.PHP_EOL; |
|
| 916 | 915 | echo $configString; |
| 917 | - echo ' ' . PHP_EOL; |
|
| 918 | - echo ' ' . PHP_EOL; |
|
| 919 | - echo $_lang['cant_write_config_file_note'] . PHP_EOL; |
|
| 916 | + echo ' '.PHP_EOL; |
|
| 917 | + echo ' '.PHP_EOL; |
|
| 918 | + echo $_lang['cant_write_config_file_note'].PHP_EOL; |
|
| 920 | 919 | die(); |
| 921 | 920 | |
| 922 | 921 | } else { |
| 923 | - echo $_lang['ok'] . PHP_EOL; |
|
| 922 | + echo $_lang['ok'].PHP_EOL; |
|
| 924 | 923 | } |
| 925 | 924 | |
| 926 | 925 | // generate new site_id and set manager theme to default |
| 927 | 926 | if ($installMode == 0) { |
| 928 | 927 | $siteid = uniqid(''); |
| 929 | 928 | mysqli_query($sqlParser->conn, |
| 930 | - "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid'),('manager_theme','default')"); |
|
| 929 | + "REPLACE INTO $dbase.`".$table_prefix."system_settings` (setting_name,setting_value) VALUES('site_id','$siteid'),('manager_theme','default')"); |
|
| 931 | 930 | } else { |
| 932 | 931 | // update site_id if missing |
| 933 | 932 | $ds = mysqli_query($sqlParser->conn, |
| 934 | - "SELECT setting_name,setting_value FROM $dbase.`" . $table_prefix . "system_settings` WHERE setting_name='site_id'"); |
|
| 933 | + "SELECT setting_name,setting_value FROM $dbase.`".$table_prefix."system_settings` WHERE setting_name='site_id'"); |
|
| 935 | 934 | if ($ds) { |
| 936 | 935 | $r = mysqli_fetch_assoc($ds); |
| 937 | 936 | $siteid = $r['setting_value']; |
| 938 | 937 | if ($siteid == '' || $siteid = 'MzGeQ2faT4Dw06+U49x3') { |
| 939 | 938 | $siteid = uniqid(''); |
| 940 | 939 | mysqli_query($sqlParser->conn, |
| 941 | - "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid')"); |
|
| 940 | + "REPLACE INTO $dbase.`".$table_prefix."system_settings` (setting_name,setting_value) VALUES('site_id','$siteid')"); |
|
| 942 | 941 | } |
| 943 | 942 | } |
| 944 | 943 | } |
@@ -950,25 +949,25 @@ discard block |
||
| 950 | 949 | // display database results |
| 951 | 950 | if ($sqlParser->installFailed == true) { |
| 952 | 951 | $errors += 1; |
| 953 | - echo $_lang['database_alerts'] . PHP_EOL; |
|
| 954 | - echo $_lang['setup_couldnt_install'] . PHP_EOL; |
|
| 955 | - echo $_lang['installation_error_occured'] . PHP_EOL . PHP_EOL; |
|
| 952 | + echo $_lang['database_alerts'].PHP_EOL; |
|
| 953 | + echo $_lang['setup_couldnt_install'].PHP_EOL; |
|
| 954 | + echo $_lang['installation_error_occured'].PHP_EOL.PHP_EOL; |
|
| 956 | 955 | /* |
| 957 | 956 | for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) { |
| 958 | 957 | echo "<em>" . $sqlParser->mysqlErrors[$i]["error"] . "</em>" . $_lang['during_execution_of_sql'] . "<span class='mono'>" . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . "</span>.<hr />"; |
| 959 | 958 | } |
| 960 | 959 | echo "</p>";*/ |
| 961 | - echo $_lang['some_tables_not_updated'] . PHP_EOL; |
|
| 960 | + echo $_lang['some_tables_not_updated'].PHP_EOL; |
|
| 962 | 961 | die(); |
| 963 | 962 | } else { |
| 964 | - echo $_lang['ok'] . PHP_EOL; |
|
| 963 | + echo $_lang['ok'].PHP_EOL; |
|
| 965 | 964 | } |
| 966 | 965 | } |
| 967 | 966 | |
| 968 | 967 | // Install Templates |
| 969 | 968 | $moduleTemplate = $mt; |
| 970 | 969 | if (!empty($moduleTemplate) || $installData) { |
| 971 | - echo PHP_EOL . $_lang['templates'] . ":" . PHP_EOL; |
|
| 970 | + echo PHP_EOL.$_lang['templates'].":".PHP_EOL; |
|
| 972 | 971 | //$selTemplates = $_POST['template']; |
| 973 | 972 | foreach ($moduleTemplates as $k => $moduleTemplate) { |
| 974 | 973 | $installSample = in_array('sample', $moduleTemplate[6]) && $installData == 1; |
@@ -980,7 +979,7 @@ discard block |
||
| 980 | 979 | $filecontent = $moduleTemplate[3]; |
| 981 | 980 | $save_sql_id_as = $moduleTemplate[7]; // Nessecary for demo-site |
| 982 | 981 | if (!file_exists($filecontent)) { |
| 983 | - echo " $name: " . $_lang['unable_install_template'] . " '$filecontent' " . $_lang['not_found'] . PHP_EOL; |
|
| 982 | + echo " $name: ".$_lang['unable_install_template']." '$filecontent' ".$_lang['not_found'].PHP_EOL; |
|
| 984 | 983 | } else { |
| 985 | 984 | // Create the category if it does not already exist |
| 986 | 985 | $category_id = getCreateDbCategory($category, $sqlParser); |
@@ -991,13 +990,13 @@ discard block |
||
| 991 | 990 | |
| 992 | 991 | // See if the template already exists |
| 993 | 992 | $rs = mysqli_query($sqlParser->conn, |
| 994 | - "SELECT * FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$name'"); |
|
| 993 | + "SELECT * FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$name'"); |
|
| 995 | 994 | |
| 996 | 995 | if (mysqli_num_rows($rs)) { |
| 997 | 996 | if (!mysqli_query($sqlParser->conn, |
| 998 | - "UPDATE $dbase.`" . $table_prefix . "site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked' WHERE templatename='$name' LIMIT 1;")) { |
|
| 997 | + "UPDATE $dbase.`".$table_prefix."site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked' WHERE templatename='$name' LIMIT 1;")) { |
|
| 999 | 998 | $errors += 1; |
| 1000 | - echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 999 | + echo mysqli_error($sqlParser->conn).PHP_EOL; |
|
| 1001 | 1000 | |
| 1002 | 1001 | return; |
| 1003 | 1002 | } |
@@ -1005,23 +1004,23 @@ discard block |
||
| 1005 | 1004 | $sql_id = @mysqli_insert_id($sqlParser->conn); |
| 1006 | 1005 | if (!$sql_id) { |
| 1007 | 1006 | $idQuery = mysqli_fetch_assoc(mysqli_query($sqlParser->conn, |
| 1008 | - "SELECT id FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$name' LIMIT 1;")); |
|
| 1007 | + "SELECT id FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$name' LIMIT 1;")); |
|
| 1009 | 1008 | $sql_id = $idQuery['id']; |
| 1010 | 1009 | } |
| 1011 | 1010 | $custom_placeholders[$save_sql_id_as] = $sql_id; |
| 1012 | 1011 | } |
| 1013 | - echo " $name: " . $_lang['upgraded'] . PHP_EOL; |
|
| 1012 | + echo " $name: ".$_lang['upgraded'].PHP_EOL; |
|
| 1014 | 1013 | } else { |
| 1015 | 1014 | if (!@ mysqli_query($sqlParser->conn, |
| 1016 | - "INSERT INTO $dbase.`" . $table_prefix . "site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template',$category_id,'$locked');")) { |
|
| 1015 | + "INSERT INTO $dbase.`".$table_prefix."site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template',$category_id,'$locked');")) { |
|
| 1017 | 1016 | $errors += 1; |
| 1018 | - echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 1017 | + echo mysqli_error($sqlParser->conn).PHP_EOL; |
|
| 1019 | 1018 | die(); |
| 1020 | 1019 | } |
| 1021 | 1020 | if (!is_null($save_sql_id_as)) { |
| 1022 | 1021 | $custom_placeholders[$save_sql_id_as] = @mysqli_insert_id($sqlParser->conn); |
| 1023 | 1022 | } |
| 1024 | - echo " $name: " . $_lang['installed'] . PHP_EOL; |
|
| 1023 | + echo " $name: ".$_lang['installed'].PHP_EOL; |
|
| 1025 | 1024 | } |
| 1026 | 1025 | } |
| 1027 | 1026 | } |
@@ -1031,7 +1030,7 @@ discard block |
||
| 1031 | 1030 | // Install Template Variables |
| 1032 | 1031 | $moduleTVs = $mtv; |
| 1033 | 1032 | if (is_array($moduleTVs) || $installData) { |
| 1034 | - echo PHP_EOL . $_lang['tvs'] . ': ' . PHP_EOL; |
|
| 1033 | + echo PHP_EOL.$_lang['tvs'].': '.PHP_EOL; |
|
| 1035 | 1034 | //$selTVs = $_POST['tv']; |
| 1036 | 1035 | foreach ($moduleTVs as $k => $moduleTV) { |
| 1037 | 1036 | $installSample = in_array('sample', $moduleTV[12]) && $installData == 1; |
@@ -1054,27 +1053,27 @@ discard block |
||
| 1054 | 1053 | $category = getCreateDbCategory($category, $sqlParser); |
| 1055 | 1054 | |
| 1056 | 1055 | $rs = mysqli_query($sqlParser->conn, |
| 1057 | - "SELECT * FROM $dbase.`" . $table_prefix . "site_tmplvars` WHERE name='$name'"); |
|
| 1056 | + "SELECT * FROM $dbase.`".$table_prefix."site_tmplvars` WHERE name='$name'"); |
|
| 1058 | 1057 | if (mysqli_num_rows($rs)) { |
| 1059 | 1058 | $insert = true; |
| 1060 | 1059 | while ($row = mysqli_fetch_assoc($rs)) { |
| 1061 | 1060 | if (!mysqli_query($sqlParser->conn, |
| 1062 | - "UPDATE $dbase.`" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};")) { |
|
| 1063 | - echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 1061 | + "UPDATE $dbase.`".$table_prefix."site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};")) { |
|
| 1062 | + echo mysqli_error($sqlParser->conn).PHP_EOL; |
|
| 1064 | 1063 | |
| 1065 | 1064 | return; |
| 1066 | 1065 | } |
| 1067 | 1066 | $insert = false; |
| 1068 | 1067 | } |
| 1069 | - echo " $name: " . $_lang['upgraded'] . PHP_EOL; |
|
| 1068 | + echo " $name: ".$_lang['upgraded'].PHP_EOL; |
|
| 1070 | 1069 | } else { |
| 1071 | - $q = "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',$category,$locked,'$input_options','$output_widget','$output_widget_params','$input_default');"; |
|
| 1070 | + $q = "INSERT INTO $dbase.`".$table_prefix."site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',$category,$locked,'$input_options','$output_widget','$output_widget_params','$input_default');"; |
|
| 1072 | 1071 | if (!mysqli_query($sqlParser->conn, $q)) { |
| 1073 | - echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 1072 | + echo mysqli_error($sqlParser->conn).PHP_EOL; |
|
| 1074 | 1073 | |
| 1075 | 1074 | return; |
| 1076 | 1075 | } |
| 1077 | - echo " $name: " . $_lang['installed'] . PHP_EOL; |
|
| 1076 | + echo " $name: ".$_lang['installed'].PHP_EOL; |
|
| 1078 | 1077 | } |
| 1079 | 1078 | |
| 1080 | 1079 | // add template assignments |
@@ -1084,22 +1083,22 @@ discard block |
||
| 1084 | 1083 | |
| 1085 | 1084 | // remove existing tv -> template assignments |
| 1086 | 1085 | $ds = mysqli_query($sqlParser->conn, |
| 1087 | - "SELECT id FROM $dbase.`" . $table_prefix . "site_tmplvars` WHERE name='$name' AND description='$desc';"); |
|
| 1086 | + "SELECT id FROM $dbase.`".$table_prefix."site_tmplvars` WHERE name='$name' AND description='$desc';"); |
|
| 1088 | 1087 | $row = mysqli_fetch_assoc($ds); |
| 1089 | 1088 | $id = $row["id"]; |
| 1090 | 1089 | mysqli_query($sqlParser->conn, |
| 1091 | - 'DELETE FROM ' . $dbase . '.`' . $table_prefix . 'site_tmplvar_templates` WHERE tmplvarid = \'' . $id . '\''); |
|
| 1090 | + 'DELETE FROM '.$dbase.'.`'.$table_prefix.'site_tmplvar_templates` WHERE tmplvarid = \''.$id.'\''); |
|
| 1092 | 1091 | |
| 1093 | 1092 | // add tv -> template assignments |
| 1094 | 1093 | foreach ($assignments as $assignment) { |
| 1095 | 1094 | $template = mysqli_real_escape_string($conn, $assignment); |
| 1096 | 1095 | $ts = mysqli_query($sqlParser->conn, |
| 1097 | - "SELECT id FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$template';"); |
|
| 1096 | + "SELECT id FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$template';"); |
|
| 1098 | 1097 | if ($ds && $ts) { |
| 1099 | 1098 | $tRow = mysqli_fetch_assoc($ts); |
| 1100 | 1099 | $templateId = $tRow['id']; |
| 1101 | 1100 | mysqli_query($sqlParser->conn, |
| 1102 | - "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)"); |
|
| 1101 | + "INSERT INTO $dbase.`".$table_prefix."site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)"); |
|
| 1103 | 1102 | } |
| 1104 | 1103 | } |
| 1105 | 1104 | } |
@@ -1111,7 +1110,7 @@ discard block |
||
| 1111 | 1110 | $moduleChunks = $mc; |
| 1112 | 1111 | // Install Chunks |
| 1113 | 1112 | if (is_array($moduleChunks) || $installData) { |
| 1114 | - echo PHP_EOL . $_lang['chunks'] . ": " . PHP_EOL; |
|
| 1113 | + echo PHP_EOL.$_lang['chunks'].": ".PHP_EOL; |
|
| 1115 | 1114 | foreach ($moduleChunks as $k => $moduleChunk) { |
| 1116 | 1115 | $installSample = in_array('sample', $moduleChunk[5]) && $installData == 1; |
| 1117 | 1116 | $count_new_name = 0; |
@@ -1124,7 +1123,7 @@ discard block |
||
| 1124 | 1123 | $filecontent = $moduleChunk[2]; |
| 1125 | 1124 | |
| 1126 | 1125 | if (!file_exists($filecontent)) { |
| 1127 | - echo " $name: " . $_lang['unable_install_chunk'] . " '$filecontent' " . $_lang['not_found'] . PHP_EOL; |
|
| 1126 | + echo " $name: ".$_lang['unable_install_chunk']." '$filecontent' ".$_lang['not_found'].PHP_EOL; |
|
| 1128 | 1127 | } else { |
| 1129 | 1128 | |
| 1130 | 1129 | // Create the category if it does not already exist |
@@ -1133,36 +1132,36 @@ discard block |
||
| 1133 | 1132 | $chunk = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', file_get_contents($filecontent), 1); |
| 1134 | 1133 | $chunk = mysqli_real_escape_string($conn, $chunk); |
| 1135 | 1134 | $rs = mysqli_query($sqlParser->conn, |
| 1136 | - "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$name'"); |
|
| 1135 | + "SELECT * FROM $dbase.`".$table_prefix."site_htmlsnippets` WHERE name='$name'"); |
|
| 1137 | 1136 | $count_original_name = mysqli_num_rows($rs); |
| 1138 | 1137 | if ($overwrite == 'false') { |
| 1139 | - $newname = $name . '-' . str_replace('.', '_', $modx_version); |
|
| 1138 | + $newname = $name.'-'.str_replace('.', '_', $modx_version); |
|
| 1140 | 1139 | $rs = mysqli_query($sqlParser->conn, |
| 1141 | - "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'"); |
|
| 1140 | + "SELECT * FROM $dbase.`".$table_prefix."site_htmlsnippets` WHERE name='$newname'"); |
|
| 1142 | 1141 | $count_new_name = mysqli_num_rows($rs); |
| 1143 | 1142 | } |
| 1144 | 1143 | $update = $count_original_name > 0 && $overwrite == 'true'; |
| 1145 | 1144 | if ($update) { |
| 1146 | 1145 | if (!mysqli_query($sqlParser->conn, |
| 1147 | - "UPDATE $dbase.`" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) { |
|
| 1146 | + "UPDATE $dbase.`".$table_prefix."site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) { |
|
| 1148 | 1147 | $errors += 1; |
| 1149 | - echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 1148 | + echo mysqli_error($sqlParser->conn).PHP_EOL; |
|
| 1150 | 1149 | |
| 1151 | 1150 | return; |
| 1152 | 1151 | } |
| 1153 | - echo " $name: " . $_lang['upgraded'] . PHP_EOL; |
|
| 1152 | + echo " $name: ".$_lang['upgraded'].PHP_EOL; |
|
| 1154 | 1153 | } elseif ($count_new_name == 0) { |
| 1155 | 1154 | if ($count_original_name > 0 && $overwrite == 'false') { |
| 1156 | 1155 | $name = $newname; |
| 1157 | 1156 | } |
| 1158 | 1157 | if (!mysqli_query($sqlParser->conn, |
| 1159 | - "INSERT INTO $dbase.`" . $table_prefix . "site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk',$category_id);")) { |
|
| 1158 | + "INSERT INTO $dbase.`".$table_prefix."site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk',$category_id);")) { |
|
| 1160 | 1159 | $errors += 1; |
| 1161 | - echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 1160 | + echo mysqli_error($sqlParser->conn).PHP_EOL; |
|
| 1162 | 1161 | |
| 1163 | 1162 | return; |
| 1164 | 1163 | } |
| 1165 | - echo " $name: " . $_lang['installed'] . PHP_EOL; |
|
| 1164 | + echo " $name: ".$_lang['installed'].PHP_EOL; |
|
| 1166 | 1165 | } |
| 1167 | 1166 | } |
| 1168 | 1167 | } |
@@ -1172,7 +1171,7 @@ discard block |
||
| 1172 | 1171 | // Install Modules |
| 1173 | 1172 | $moduleModules = $mm; |
| 1174 | 1173 | if (is_array($moduleModules) || $installData) { |
| 1175 | - echo PHP_EOL . $_lang['modules'] . ":" . PHP_EOL; |
|
| 1174 | + echo PHP_EOL.$_lang['modules'].":".PHP_EOL; |
|
| 1176 | 1175 | //$selModules = $_POST['module']; |
| 1177 | 1176 | foreach ($moduleModules as $k => $moduleModule) { |
| 1178 | 1177 | $installSample = in_array('sample', $moduleModule[7]) && $installData == 1; |
@@ -1185,7 +1184,7 @@ discard block |
||
| 1185 | 1184 | $shared = mysqli_real_escape_string($conn, $moduleModule[5]); |
| 1186 | 1185 | $category = mysqli_real_escape_string($conn, $moduleModule[6]); |
| 1187 | 1186 | if (!file_exists($filecontent)) { |
| 1188 | - echo " $name: " . $_lang['unable_install_module'] . " '$filecontent' " . $_lang['not_found'] . PHP_EOL; |
|
| 1187 | + echo " $name: ".$_lang['unable_install_module']." '$filecontent' ".$_lang['not_found'].PHP_EOL; |
|
| 1189 | 1188 | } else { |
| 1190 | 1189 | |
| 1191 | 1190 | // Create the category if it does not already exist |
@@ -1195,28 +1194,28 @@ discard block |
||
| 1195 | 1194 | // $module = removeDocblock($module, 'module'); // Modules have no fileBinding, keep docblock for info-tab |
| 1196 | 1195 | $module = mysqli_real_escape_string($conn, $module); |
| 1197 | 1196 | $rs = mysqli_query($sqlParser->conn, |
| 1198 | - "SELECT * FROM $dbase.`" . $table_prefix . "site_modules` WHERE name='$name'"); |
|
| 1197 | + "SELECT * FROM $dbase.`".$table_prefix."site_modules` WHERE name='$name'"); |
|
| 1199 | 1198 | if (mysqli_num_rows($rs)) { |
| 1200 | 1199 | $row = mysqli_fetch_assoc($rs); |
| 1201 | 1200 | $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties'])); |
| 1202 | 1201 | if (!mysqli_query($sqlParser->conn, |
| 1203 | - "UPDATE $dbase.`" . $table_prefix . "site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) { |
|
| 1204 | - echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 1202 | + "UPDATE $dbase.`".$table_prefix."site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) { |
|
| 1203 | + echo mysqli_error($sqlParser->conn).PHP_EOL; |
|
| 1205 | 1204 | |
| 1206 | 1205 | return; |
| 1207 | 1206 | } |
| 1208 | - echo " $name: " . $_lang['upgraded'] . PHP_EOL; |
|
| 1207 | + echo " $name: ".$_lang['upgraded'].PHP_EOL; |
|
| 1209 | 1208 | } else { |
| 1210 | 1209 | if ($properties != null) { |
| 1211 | 1210 | $properties = mysqli_real_escape_string($conn, parseProperties($properties, true)); |
| 1212 | 1211 | } |
| 1213 | 1212 | if (!mysqli_query($sqlParser->conn, |
| 1214 | - "INSERT INTO $dbase.`" . $table_prefix . "site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', $category);")) { |
|
| 1215 | - echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
| 1213 | + "INSERT INTO $dbase.`".$table_prefix."site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', $category);")) { |
|
| 1214 | + echo "<p>".mysqli_error($sqlParser->conn)."</p>"; |
|
| 1216 | 1215 | |
| 1217 | 1216 | return; |
| 1218 | 1217 | } |
| 1219 | - echo " $name: " . $_lang['installed'] . PHP_EOL; |
|
| 1218 | + echo " $name: ".$_lang['installed'].PHP_EOL; |
|
| 1220 | 1219 | } |
| 1221 | 1220 | } |
| 1222 | 1221 | } |
@@ -1226,7 +1225,7 @@ discard block |
||
| 1226 | 1225 | // Install Plugins |
| 1227 | 1226 | $modulePlugins = $mp; |
| 1228 | 1227 | if (is_array($modulePlugins) || $installData) { |
| 1229 | - echo PHP_EOL . $_lang['plugins'] . ":" . PHP_EOL; |
|
| 1228 | + echo PHP_EOL.$_lang['plugins'].":".PHP_EOL; |
|
| 1230 | 1229 | $selPlugs = $_POST['plugin']; |
| 1231 | 1230 | foreach ($modulePlugins as $k => $modulePlugin) { |
| 1232 | 1231 | //$installSample = in_array('sample', $modulePlugin[8]) && $installData == 1; |
@@ -1242,16 +1241,16 @@ discard block |
||
| 1242 | 1241 | $disabled = $modulePlugin[9]; |
| 1243 | 1242 | if (array_key_exists(7, $modulePlugin)) { |
| 1244 | 1243 | // parse comma-separated legacy names and prepare them for sql IN clause |
| 1245 | - $leg_names = "'" . implode("','", |
|
| 1246 | - preg_split('/\s*,\s*/', mysqli_real_escape_string($conn, $modulePlugin[7]))) . "'"; |
|
| 1244 | + $leg_names = "'".implode("','", |
|
| 1245 | + preg_split('/\s*,\s*/', mysqli_real_escape_string($conn, $modulePlugin[7])))."'"; |
|
| 1247 | 1246 | } |
| 1248 | 1247 | if (!file_exists($filecontent)) { |
| 1249 | - echo " $name: " . $_lang['unable_install_plugin'] . " '$filecontent' " . $_lang['not_found'] . PHP_EOL; |
|
| 1248 | + echo " $name: ".$_lang['unable_install_plugin']." '$filecontent' ".$_lang['not_found'].PHP_EOL; |
|
| 1250 | 1249 | } else { |
| 1251 | 1250 | |
| 1252 | 1251 | // disable legacy versions based on legacy_names provided |
| 1253 | 1252 | if (!empty($leg_names)) { |
| 1254 | - $update_query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE name IN ($leg_names);"; |
|
| 1253 | + $update_query = "UPDATE $dbase.`".$table_prefix."site_plugins` SET disabled='1' WHERE name IN ($leg_names);"; |
|
| 1255 | 1254 | $rs = mysqli_query($sqlParser->conn, $update_query); |
| 1256 | 1255 | } |
| 1257 | 1256 | |
@@ -1262,23 +1261,23 @@ discard block |
||
| 1262 | 1261 | $plugin = removeDocblock($plugin, 'plugin'); |
| 1263 | 1262 | $plugin = mysqli_real_escape_string($conn, $plugin); |
| 1264 | 1263 | $rs = mysqli_query($sqlParser->conn, |
| 1265 | - "SELECT * FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='$name'"); |
|
| 1264 | + "SELECT * FROM $dbase.`".$table_prefix."site_plugins` WHERE name='$name'"); |
|
| 1266 | 1265 | if (mysqli_num_rows($rs)) { |
| 1267 | 1266 | $insert = true; |
| 1268 | 1267 | while ($row = mysqli_fetch_assoc($rs)) { |
| 1269 | 1268 | $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties'])); |
| 1270 | 1269 | if ($row['description'] == $desc) { |
| 1271 | 1270 | if (!mysqli_query($sqlParser->conn, |
| 1272 | - "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};")) { |
|
| 1273 | - echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 1271 | + "UPDATE $dbase.`".$table_prefix."site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};")) { |
|
| 1272 | + echo mysqli_error($sqlParser->conn).PHP_EOL; |
|
| 1274 | 1273 | |
| 1275 | 1274 | return; |
| 1276 | 1275 | } |
| 1277 | 1276 | $insert = false; |
| 1278 | 1277 | } else { |
| 1279 | 1278 | if (!mysqli_query($sqlParser->conn, |
| 1280 | - "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE id={$row['id']};")) { |
|
| 1281 | - echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 1279 | + "UPDATE $dbase.`".$table_prefix."site_plugins` SET disabled='1' WHERE id={$row['id']};")) { |
|
| 1280 | + echo mysqli_error($sqlParser->conn).PHP_EOL; |
|
| 1282 | 1281 | |
| 1283 | 1282 | return; |
| 1284 | 1283 | } |
@@ -1287,39 +1286,39 @@ discard block |
||
| 1287 | 1286 | if ($insert === true) { |
| 1288 | 1287 | $properties = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties'])); |
| 1289 | 1288 | if (!mysqli_query($sqlParser->conn, |
| 1290 | - "INSERT INTO $dbase.`" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','0',$category);")) { |
|
| 1291 | - echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 1289 | + "INSERT INTO $dbase.`".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','0',$category);")) { |
|
| 1290 | + echo mysqli_error($sqlParser->conn).PHP_EOL; |
|
| 1292 | 1291 | |
| 1293 | 1292 | return; |
| 1294 | 1293 | } |
| 1295 | 1294 | } |
| 1296 | - echo " $name: " . $_lang['upgraded'] . PHP_EOL; |
|
| 1295 | + echo " $name: ".$_lang['upgraded'].PHP_EOL; |
|
| 1297 | 1296 | } else { |
| 1298 | 1297 | if ($properties != null) { |
| 1299 | 1298 | $properties = mysqli_real_escape_string($conn, parseProperties($properties, true)); |
| 1300 | 1299 | } |
| 1301 | 1300 | if (!mysqli_query($sqlParser->conn, |
| 1302 | - "INSERT INTO $dbase.`" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,category,disabled) VALUES('$name','$desc','$plugin','$properties','$guid',$category,$disabled);")) { |
|
| 1303 | - echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 1301 | + "INSERT INTO $dbase.`".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,category,disabled) VALUES('$name','$desc','$plugin','$properties','$guid',$category,$disabled);")) { |
|
| 1302 | + echo mysqli_error($sqlParser->conn).PHP_EOL; |
|
| 1304 | 1303 | |
| 1305 | 1304 | return; |
| 1306 | 1305 | } |
| 1307 | - echo " $name: " . $_lang['installed'] . PHP_EOL; |
|
| 1306 | + echo " $name: ".$_lang['installed'].PHP_EOL; |
|
| 1308 | 1307 | } |
| 1309 | 1308 | // add system events |
| 1310 | 1309 | if (count($events) > 0) { |
| 1311 | 1310 | $ds = mysqli_query($sqlParser->conn, |
| 1312 | - "SELECT id FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='$name' AND description='$desc';"); |
|
| 1311 | + "SELECT id FROM $dbase.`".$table_prefix."site_plugins` WHERE name='$name' AND description='$desc';"); |
|
| 1313 | 1312 | if ($ds) { |
| 1314 | 1313 | $row = mysqli_fetch_assoc($ds); |
| 1315 | 1314 | $id = $row["id"]; |
| 1316 | 1315 | // remove existing events |
| 1317 | 1316 | mysqli_query($sqlParser->conn, |
| 1318 | - 'DELETE FROM ' . $dbase . '.`' . $table_prefix . 'site_plugin_events` WHERE pluginid = \'' . $id . '\''); |
|
| 1317 | + 'DELETE FROM '.$dbase.'.`'.$table_prefix.'site_plugin_events` WHERE pluginid = \''.$id.'\''); |
|
| 1319 | 1318 | // add new events |
| 1320 | 1319 | mysqli_query($sqlParser->conn, |
| 1321 | - "INSERT INTO $dbase.`" . $table_prefix . "site_plugin_events` (pluginid, evtid) SELECT '$id' as 'pluginid',se.id as 'evtid' FROM $dbase.`" . $table_prefix . "system_eventnames` se WHERE name IN ('" . implode("','", |
|
| 1322 | - $events) . "')"); |
|
| 1320 | + "INSERT INTO $dbase.`".$table_prefix."site_plugin_events` (pluginid, evtid) SELECT '$id' as 'pluginid',se.id as 'evtid' FROM $dbase.`".$table_prefix."system_eventnames` se WHERE name IN ('".implode("','", |
|
| 1321 | + $events)."')"); |
|
| 1323 | 1322 | } |
| 1324 | 1323 | } |
| 1325 | 1324 | } |
@@ -1330,7 +1329,7 @@ discard block |
||
| 1330 | 1329 | // Install Snippets |
| 1331 | 1330 | $moduleSnippet = $ms; |
| 1332 | 1331 | if (is_array($moduleSnippet) || $installData) { |
| 1333 | - echo PHP_EOL . $_lang['snippets'] . ":" . PHP_EOL; |
|
| 1332 | + echo PHP_EOL.$_lang['snippets'].":".PHP_EOL; |
|
| 1334 | 1333 | //$selSnips = $_POST['snippet']; |
| 1335 | 1334 | foreach ($moduleSnippets as $k => $moduleSnippet) { |
| 1336 | 1335 | $installSample = in_array('sample', $moduleSnippet[5]) && $installData == 1; |
@@ -1341,7 +1340,7 @@ discard block |
||
| 1341 | 1340 | $properties = $moduleSnippet[3]; |
| 1342 | 1341 | $category = mysqli_real_escape_string($conn, $moduleSnippet[4]); |
| 1343 | 1342 | if (!file_exists($filecontent)) { |
| 1344 | - echo " $name: " . $_lang['unable_install_snippet'] . " '$filecontent' " . $_lang['not_found'] . PHP_EOL; |
|
| 1343 | + echo " $name: ".$_lang['unable_install_snippet']." '$filecontent' ".$_lang['not_found'].PHP_EOL; |
|
| 1345 | 1344 | } else { |
| 1346 | 1345 | |
| 1347 | 1346 | // Create the category if it does not already exist |
@@ -1351,28 +1350,28 @@ discard block |
||
| 1351 | 1350 | $snippet = removeDocblock($snippet, 'snippet'); |
| 1352 | 1351 | $snippet = mysqli_real_escape_string($conn, $snippet); |
| 1353 | 1352 | $rs = mysqli_query($sqlParser->conn, |
| 1354 | - "SELECT * FROM $dbase.`" . $table_prefix . "site_snippets` WHERE name='$name'"); |
|
| 1353 | + "SELECT * FROM $dbase.`".$table_prefix."site_snippets` WHERE name='$name'"); |
|
| 1355 | 1354 | if (mysqli_num_rows($rs)) { |
| 1356 | 1355 | $row = mysqli_fetch_assoc($rs); |
| 1357 | 1356 | $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties'])); |
| 1358 | 1357 | if (!mysqli_query($sqlParser->conn, |
| 1359 | - "UPDATE $dbase.`" . $table_prefix . "site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) { |
|
| 1360 | - echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 1358 | + "UPDATE $dbase.`".$table_prefix."site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) { |
|
| 1359 | + echo mysqli_error($sqlParser->conn).PHP_EOL; |
|
| 1361 | 1360 | |
| 1362 | 1361 | return; |
| 1363 | 1362 | } |
| 1364 | - echo " $name: " . $_lang['upgraded'] . PHP_EOL; |
|
| 1363 | + echo " $name: ".$_lang['upgraded'].PHP_EOL; |
|
| 1365 | 1364 | } else { |
| 1366 | 1365 | if ($properties != null) { |
| 1367 | 1366 | $properties = mysqli_real_escape_string($conn, parseProperties($properties, true)); |
| 1368 | 1367 | } |
| 1369 | 1368 | if (!mysqli_query($sqlParser->conn, |
| 1370 | - "INSERT INTO $dbase.`" . $table_prefix . "site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties',$category);")) { |
|
| 1371 | - echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 1369 | + "INSERT INTO $dbase.`".$table_prefix."site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties',$category);")) { |
|
| 1370 | + echo mysqli_error($sqlParser->conn).PHP_EOL; |
|
| 1372 | 1371 | |
| 1373 | 1372 | return; |
| 1374 | 1373 | } |
| 1375 | - echo " $name: " . $_lang['installed'] . PHP_EOL; |
|
| 1374 | + echo " $name: ".$_lang['installed'].PHP_EOL; |
|
| 1376 | 1375 | } |
| 1377 | 1376 | } |
| 1378 | 1377 | } |
@@ -1381,19 +1380,19 @@ discard block |
||
| 1381 | 1380 | |
| 1382 | 1381 | // Install demo-site |
| 1383 | 1382 | if ($installData && $moduleSQLDataFile) { |
| 1384 | - echo PHP_EOL . $_lang['installing_demo_site']; |
|
| 1383 | + echo PHP_EOL.$_lang['installing_demo_site']; |
|
| 1385 | 1384 | $sqlParser->process($moduleSQLDataFile); |
| 1386 | 1385 | // display database results |
| 1387 | 1386 | if ($sqlParser->installFailed == true) { |
| 1388 | 1387 | $errors += 1; |
| 1389 | - echo $_lang['database_alerts'] . PHP_EOL; |
|
| 1390 | - echo $_lang['setup_couldnt_install'] . PHP_EOL; |
|
| 1391 | - echo $_lang['installation_error_occured'] . PHP_EOL . PHP_EOL; |
|
| 1388 | + echo $_lang['database_alerts'].PHP_EOL; |
|
| 1389 | + echo $_lang['setup_couldnt_install'].PHP_EOL; |
|
| 1390 | + echo $_lang['installation_error_occured'].PHP_EOL.PHP_EOL; |
|
| 1392 | 1391 | for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) { |
| 1393 | - echo $sqlParser->mysqlErrors[$i]["error"] . " " . $_lang['during_execution_of_sql'] . " " . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . PHP_EOL; |
|
| 1392 | + echo $sqlParser->mysqlErrors[$i]["error"]." ".$_lang['during_execution_of_sql']." ".strip_tags($sqlParser->mysqlErrors[$i]["sql"]).PHP_EOL; |
|
| 1394 | 1393 | } |
| 1395 | 1394 | |
| 1396 | - echo $_lang['some_tables_not_updated'] . PHP_EOL; |
|
| 1395 | + echo $_lang['some_tables_not_updated'].PHP_EOL; |
|
| 1397 | 1396 | |
| 1398 | 1397 | return; |
| 1399 | 1398 | } else { |
@@ -1405,7 +1404,7 @@ discard block |
||
| 1405 | 1404 | $sql = sprintf('UPDATE `%ssite_content` SET template=%s WHERE template=4', $sqlParser->prefix, $row['id']); |
| 1406 | 1405 | mysqli_query($sqlParser->conn, $sql); |
| 1407 | 1406 | } |
| 1408 | - echo $_lang['ok'] . PHP_EOL; |
|
| 1407 | + echo $_lang['ok'].PHP_EOL; |
|
| 1409 | 1408 | } |
| 1410 | 1409 | } |
| 1411 | 1410 | |
@@ -1413,9 +1412,9 @@ discard block |
||
| 1413 | 1412 | $moduleDependencies = $mdp; |
| 1414 | 1413 | foreach ($moduleDependencies as $dependency) { |
| 1415 | 1414 | $ds = mysqli_query($sqlParser->conn, |
| 1416 | - 'SELECT id, guid FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_modules` WHERE name="' . $dependency['module'] . '"'); |
|
| 1415 | + 'SELECT id, guid FROM '.$dbase.'`'.$sqlParser->prefix.'site_modules` WHERE name="'.$dependency['module'].'"'); |
|
| 1417 | 1416 | if (!$ds) { |
| 1418 | - echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 1417 | + echo mysqli_error($sqlParser->conn).PHP_EOL; |
|
| 1419 | 1418 | |
| 1420 | 1419 | return; |
| 1421 | 1420 | } else { |
@@ -1425,9 +1424,9 @@ discard block |
||
| 1425 | 1424 | } |
| 1426 | 1425 | // get extra id |
| 1427 | 1426 | $ds = mysqli_query($sqlParser->conn, |
| 1428 | - 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE ' . $dependency['column'] . '="' . $dependency['name'] . '"'); |
|
| 1427 | + 'SELECT id FROM '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` WHERE '.$dependency['column'].'="'.$dependency['name'].'"'); |
|
| 1429 | 1428 | if (!$ds) { |
| 1430 | - echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 1429 | + echo mysqli_error($sqlParser->conn).PHP_EOL; |
|
| 1431 | 1430 | |
| 1432 | 1431 | return; |
| 1433 | 1432 | } else { |
@@ -1436,34 +1435,34 @@ discard block |
||
| 1436 | 1435 | } |
| 1437 | 1436 | // setup extra as module dependency |
| 1438 | 1437 | $ds = mysqli_query($sqlParser->conn, |
| 1439 | - 'SELECT module FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type'] . ' LIMIT 1'); |
|
| 1438 | + 'SELECT module FROM '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` WHERE module='.$moduleId.' AND resource='.$extraId.' AND type='.$dependency['type'].' LIMIT 1'); |
|
| 1440 | 1439 | if (!$ds) { |
| 1441 | - echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 1440 | + echo mysqli_error($sqlParser->conn).PHP_EOL; |
|
| 1442 | 1441 | |
| 1443 | 1442 | return; |
| 1444 | 1443 | } else { |
| 1445 | 1444 | if (mysqli_num_rows($ds) === 0) { |
| 1446 | 1445 | mysqli_query($sqlParser->conn, |
| 1447 | - 'INSERT INTO ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` (module, resource, type) VALUES(' . $moduleId . ',' . $extraId . ',' . $dependency['type'] . ')'); |
|
| 1448 | - echo $dependency['module'] . ' Module: ' . $_lang['depedency_create'] . PHP_EOL; |
|
| 1446 | + 'INSERT INTO '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` (module, resource, type) VALUES('.$moduleId.','.$extraId.','.$dependency['type'].')'); |
|
| 1447 | + echo $dependency['module'].' Module: '.$_lang['depedency_create'].PHP_EOL; |
|
| 1449 | 1448 | } else { |
| 1450 | 1449 | mysqli_query($sqlParser->conn, |
| 1451 | - 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` SET module = ' . $moduleId . ', resource = ' . $extraId . ', type = ' . $dependency['type'] . ' WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type']); |
|
| 1452 | - echo $dependency['module'] . ' Module: ' . $_lang['depedency_update'] . PHP_EOL; |
|
| 1450 | + 'UPDATE '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` SET module = '.$moduleId.', resource = '.$extraId.', type = '.$dependency['type'].' WHERE module='.$moduleId.' AND resource='.$extraId.' AND type='.$dependency['type']); |
|
| 1451 | + echo $dependency['module'].' Module: '.$_lang['depedency_update'].PHP_EOL; |
|
| 1453 | 1452 | } |
| 1454 | 1453 | if ($dependency['type'] == 30 || $dependency['type'] == 40) { |
| 1455 | 1454 | // set extra guid for plugins and snippets |
| 1456 | 1455 | $ds = mysqli_query($sqlParser->conn, |
| 1457 | - 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE id=' . $extraId . ' LIMIT 1'); |
|
| 1456 | + 'SELECT id FROM '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` WHERE id='.$extraId.' LIMIT 1'); |
|
| 1458 | 1457 | if (!$ds) { |
| 1459 | - echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 1458 | + echo mysqli_error($sqlParser->conn).PHP_EOL; |
|
| 1460 | 1459 | |
| 1461 | 1460 | return; |
| 1462 | 1461 | } else { |
| 1463 | 1462 | if (mysqli_num_rows($ds) != 0) { |
| 1464 | 1463 | mysqli_query($sqlParser->conn, |
| 1465 | - 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` SET moduleguid = ' . $moduleGuid . ' WHERE id=' . $extraId); |
|
| 1466 | - echo $dependency['name'] . ': ' . $_lang['guid_set'] . PHP_EOL; |
|
| 1464 | + 'UPDATE '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` SET moduleguid = '.$moduleGuid.' WHERE id='.$extraId); |
|
| 1465 | + echo $dependency['name'].': '.$_lang['guid_set'].PHP_EOL; |
|
| 1467 | 1466 | } |
| 1468 | 1467 | } |
| 1469 | 1468 | } |
@@ -1472,58 +1471,58 @@ discard block |
||
| 1472 | 1471 | |
| 1473 | 1472 | // call back function |
| 1474 | 1473 | if ($callBackFnc != "") { |
| 1475 | - $callBackFnc ($sqlParser); |
|
| 1474 | + $callBackFnc($sqlParser); |
|
| 1476 | 1475 | } |
| 1477 | 1476 | |
| 1478 | 1477 | // Setup the MODX API -- needed for the cache processor |
| 1479 | 1478 | if (!defined('MODX_MANAGER_PATH')) { |
| 1480 | - define('MODX_MANAGER_PATH', $base_path . MGR_DIR . '/'); |
|
| 1479 | + define('MODX_MANAGER_PATH', $base_path.MGR_DIR.'/'); |
|
| 1481 | 1480 | } |
| 1482 | 1481 | $database_type = 'mysqli'; |
| 1483 | 1482 | // initiate a new document parser |
| 1484 | -include_once($path . '../' . MGR_DIR . '/includes/document.parser.class.inc.php'); |
|
| 1483 | +include_once($path.'../'.MGR_DIR.'/includes/document.parser.class.inc.php'); |
|
| 1485 | 1484 | $modx = new DocumentParser; |
| 1486 | 1485 | $modx->db->connect(); |
| 1487 | 1486 | // always empty cache after install |
| 1488 | 1487 | $sync = new EvolutionCMS\Cache(); |
| 1489 | -$sync->setCachepath($path . "../assets/cache/"); |
|
| 1488 | +$sync->setCachepath($path."../assets/cache/"); |
|
| 1490 | 1489 | $sync->setReport(false); |
| 1491 | 1490 | $sync->emptyCache(); // first empty the cache |
| 1492 | 1491 | |
| 1493 | 1492 | // try to chmod the cache go-rwx (for suexeced php) |
| 1494 | -$chmodSuccess = @chmod($path . '../assets/cache/siteCache.idx.php', 0600); |
|
| 1495 | -$chmodSuccess = @chmod($path . '../assets/cache/sitePublishing.idx.php', 0600); |
|
| 1493 | +$chmodSuccess = @chmod($path.'../assets/cache/siteCache.idx.php', 0600); |
|
| 1494 | +$chmodSuccess = @chmod($path.'../assets/cache/sitePublishing.idx.php', 0600); |
|
| 1496 | 1495 | |
| 1497 | 1496 | // remove any locks on the manager functions so initial manager login is not blocked |
| 1498 | -mysqli_query($conn, "TRUNCATE TABLE `" . $table_prefix . "active_users`"); |
|
| 1497 | +mysqli_query($conn, "TRUNCATE TABLE `".$table_prefix."active_users`"); |
|
| 1499 | 1498 | |
| 1500 | 1499 | // close db connection |
| 1501 | 1500 | $sqlParser->close(); |
| 1502 | 1501 | |
| 1503 | 1502 | // andrazk 20070416 - release manager access |
| 1504 | -if (file_exists($path . '../assets/cache/installProc.inc.php')) { |
|
| 1505 | - @chmod($path . '../assets/cache/installProc.inc.php', 0755); |
|
| 1506 | - unlink($path . '../assets/cache/installProc.inc.php'); |
|
| 1503 | +if (file_exists($path.'../assets/cache/installProc.inc.php')) { |
|
| 1504 | + @chmod($path.'../assets/cache/installProc.inc.php', 0755); |
|
| 1505 | + unlink($path.'../assets/cache/installProc.inc.php'); |
|
| 1507 | 1506 | } |
| 1508 | 1507 | |
| 1509 | 1508 | // setup completed! |
| 1510 | -echo PHP_EOL . $_lang['installation_successful'] . PHP_EOL . PHP_EOL; |
|
| 1509 | +echo PHP_EOL.$_lang['installation_successful'].PHP_EOL.PHP_EOL; |
|
| 1511 | 1510 | //echo "<p>" . $_lang['to_log_into_content_manager'] . "</p>"; |
| 1512 | 1511 | if ($installMode == 0) { |
| 1513 | - echo strip_tags($_lang['installation_note']) . PHP_EOL; |
|
| 1512 | + echo strip_tags($_lang['installation_note']).PHP_EOL; |
|
| 1514 | 1513 | } else { |
| 1515 | - echo strip_tags($_lang['upgrade_note']) . PHP_EOL; |
|
| 1514 | + echo strip_tags($_lang['upgrade_note']).PHP_EOL; |
|
| 1516 | 1515 | } |
| 1517 | 1516 | |
| 1518 | 1517 | |
| 1519 | 1518 | if (empty($args)) { |
| 1520 | - echo PHP_EOL . 'Remove install folder?' . PHP_EOL; |
|
| 1519 | + echo PHP_EOL.'Remove install folder?'.PHP_EOL; |
|
| 1521 | 1520 | $removeInstall = readline("Type 'y' or 'n' to continue: "); |
| 1522 | 1521 | } |
| 1523 | 1522 | //remove installFolder |
| 1524 | 1523 | if ($removeInstall === 'y') { |
| 1525 | 1524 | removeFolder($path); |
| 1526 | - removeFolder($base_path . '.tx'); |
|
| 1527 | - unlink($base_path . 'README.md'); |
|
| 1528 | - echo 'Install folder deleted!' . PHP_EOL . PHP_EOL; |
|
| 1525 | + removeFolder($base_path.'.tx'); |
|
| 1526 | + unlink($base_path.'README.md'); |
|
| 1527 | + echo 'Install folder deleted!'.PHP_EOL.PHP_EOL; |
|
| 1529 | 1528 | } |