Completed
Push — master ( 593857...cd1c2d )
by Michael
29s queued 20s
created
htdocs/modules/schematool/admin/schematool.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  * @author          Richard Griffith <[email protected]>
16 16
  */
17 17
 
18
-require __DIR__ . '/admin_header.php';
18
+require __DIR__.'/admin_header.php';
19 19
 
20 20
 /* --------------------------------------------------------------- */
21 21
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         $schema = $schemaManager->createSchema();
63 63
 
64 64
         // invoke our RemovePrefixes visitor with list of module's tables
65
-        $visitor = new RemovePrefixes(\XoopsBaseConfig::get('db-prefix') . '_', $table_list);
65
+        $visitor = new RemovePrefixes(\XoopsBaseConfig::get('db-prefix').'_', $table_list);
66 66
         $schema->visit($visitor);
67 67
 
68 68
         // Get the schema we built with the RemovePrefixes visitor.
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             }
92 92
         }
93 93
 
94
-        echo '<h2>' . _MI_SCHEMATOOL_EXPORT_SCHEMA . '</h2>';
94
+        echo '<h2>'._MI_SCHEMATOOL_EXPORT_SCHEMA.'</h2>';
95 95
         $yamldump = Yaml::dump($schemaArray, 5);
96 96
         //echo '<div contenteditable><pre>' . $yamldump . '</pre></div>';
97 97
         $schemadump = <<<EOT1
Please login to merge, or discard this patch.
htdocs/modules/system/class/module.php 1 patch
Spacing   +128 added lines, -128 removed lines patch added patch discarded remove patch
@@ -107,20 +107,20 @@  discard block
 block discarded – undo
107 107
                     $module->setInfo('warning_update', true);
108 108
                 }
109 109
                 if (XoopsLoad::fileExists(
110
-                    \XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname') . '/icons/logo_small.png'
110
+                    \XoopsBaseConfig::get('root-path').'/modules/'.$module->getVar('dirname').'/icons/logo_small.png'
111 111
                 )) {
112 112
                     $module->setInfo(
113 113
                         'logo_small',
114
-                        \XoopsBaseConfig::get('url') . '/modules/' . $module->getVar('dirname') . '/icons/logo_small.png'
114
+                        \XoopsBaseConfig::get('url').'/modules/'.$module->getVar('dirname').'/icons/logo_small.png'
115 115
                     );
116 116
                 } else {
117
-                    $module->setInfo('logo_small', \XoopsBaseConfig::get('url') . '/media/xoops/images/icons/16/default.png');
117
+                    $module->setInfo('logo_small', \XoopsBaseConfig::get('url').'/media/xoops/images/icons/16/default.png');
118 118
                 }
119 119
                 $module->setInfo('version', round($module->getVar('version') / 100, 2));
120 120
                 $module->setInfo('update', XoopsLocale::formatTimestamp($module->getVar('last_update'), 's'));
121 121
                 $module->setInfo(
122 122
                     'link_admin',
123
-                    \XoopsBaseConfig::get('url') . '/modules/' . $module->getVar('dirname') . '/' . $module->getInfo('adminindex')
123
+                    \XoopsBaseConfig::get('url').'/modules/'.$module->getVar('dirname').'/'.$module->getInfo('adminindex')
124 124
                 );
125 125
 
126 126
                 if ($module->getVar('isactive')) {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
                 ) {
143 143
                     $module->setInfo(
144 144
                         'link_pref',
145
-                        \XoopsBaseConfig::get('url') . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod='
145
+                        \XoopsBaseConfig::get('url').'/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod='
146 146
                         . $module->getVar('mid')
147 147
                     );
148 148
                 }
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         $ret = array();
168 168
         $i = 0;
169 169
         foreach ($this->modulesList as $file) {
170
-            if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $file . '/xoops_version.php')) {
170
+            if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path').'/modules/'.$file.'/xoops_version.php')) {
171 171
                 clearstatcache();
172 172
                 $file = trim($file);
173 173
                 if (!in_array($file, $this->modulesDirnames)) {
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
             $this->addTemporaryAutoloader($module);
216 216
             $install_script = $module->getInfo('onInstall');
217 217
             if ($install_script && trim($install_script) != '') {
218
-                XoopsLoad::loadFile($xoops->path('modules/' . $mod . '/' . trim($install_script)));
218
+                XoopsLoad::loadFile($xoops->path('modules/'.$mod.'/'.trim($install_script)));
219 219
             }
220 220
             $func = "xoops_module_pre_install_{$mod}";
221 221
             // If pre install function is defined, execute
@@ -236,20 +236,20 @@  discard block
 block discarded – undo
236 236
                 $schema_file = $module->getInfo('schema');
237 237
                 $sql_file = $module->getInfo('sqlfile');
238 238
                 if (!empty($schema_file)) {
239
-                    $schema_file_path = \XoopsBaseConfig::get('root-path') . '/modules/' . $mod . '/' . $schema_file;
239
+                    $schema_file_path = \XoopsBaseConfig::get('root-path').'/modules/'.$mod.'/'.$schema_file;
240 240
                     if (!XoopsLoad::fileExists($schema_file_path)) {
241 241
                         $this->error[] =
242 242
                             sprintf(SystemLocale::EF_SQL_FILE_NOT_FOUND, "<strong>{$schema_file}</strong>");
243 243
                         return false;
244 244
                     }
245
-                    $importer = new ImportSchema(\XoopsBaseConfig::get('db-prefix') . '_');
245
+                    $importer = new ImportSchema(\XoopsBaseConfig::get('db-prefix').'_');
246 246
                     $importSchema = $importer->importSchemaArray(Yaml::read($schema_file_path));
247 247
                     $synchronizer = new SingleDatabaseSynchronizer($xoops->db());
248 248
                     $synchronizer->updateSchema($importSchema, true);
249 249
                 } elseif (is_array($sql_file) && !empty($sql_file[\XoopsBaseConfig::get('db-type')])) {
250 250
                     $xoops->deprecated('Install SQL files are deprecated since 2.6.0. Convert to portable Schemas');
251 251
 
252
-                    $sql_file_path = \XoopsBaseConfig::get('root-path') . '/modules/' . $mod . '/' . $sql_file[\XoopsBaseConfig::get('db-type')];
252
+                    $sql_file_path = \XoopsBaseConfig::get('root-path').'/modules/'.$mod.'/'.$sql_file[\XoopsBaseConfig::get('db-type')];
253 253
                     if (!XoopsLoad::fileExists($sql_file_path)) {
254 254
                         $this->error[] =
255 255
                             sprintf(SystemLocale::EF_SQL_FILE_NOT_FOUND, "<strong>{$sql_file_path}</strong>");
@@ -266,10 +266,10 @@  discard block
 block discarded – undo
266 266
                             // [4] contains unprefixed table name
267 267
                             $prefixed_query = SqlUtility::prefixQuery($piece, $xoops->db()->prefix());
268 268
                             if (!$prefixed_query) {
269
-                                $this->error[]['sub'] = '<span class="red">' . sprintf(
269
+                                $this->error[]['sub'] = '<span class="red">'.sprintf(
270 270
                                     XoopsLocale::EF_INVALID_SQL,
271
-                                    '<strong>' . $piece . '</strong>'
272
-                                ) . '</span>';
271
+                                    '<strong>'.$piece.'</strong>'
272
+                                ).'</span>';
273 273
                                 break;
274 274
                             }
275 275
                             // check if the table name is reserved
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
                                     $result = $xoops->db()->query($prefixed_query[0]);
280 280
                                 } catch (Exception $e) {
281 281
                                     $xoops->events()->triggerEvent('core.exception', $e);
282
-                                    $result=false;
282
+                                    $result = false;
283 283
                                 }
284 284
 
285 285
                                 if (!$result) {
@@ -289,13 +289,13 @@  discard block
 block discarded – undo
289 289
                                     if (!in_array($prefixed_query[4], $created_tables)) {
290 290
                                         $this->trace[]['sub'] = sprintf(
291 291
                                             XoopsLocale::SF_TABLE_CREATED,
292
-                                            '<strong>' . $xoops->db()->prefix($prefixed_query[4]) . '</strong>'
292
+                                            '<strong>'.$xoops->db()->prefix($prefixed_query[4]).'</strong>'
293 293
                                         );
294 294
                                         $created_tables[] = $prefixed_query[4];
295 295
                                     } else {
296 296
                                         $this->trace[]['sub'] = sprintf(
297 297
                                             XoopsLocale::SF_DATA_INSERTED_TO_TABLE,
298
-                                            '<strong>' . $xoops->db()->prefix($prefixed_query[4]) . '</strong>'
298
+                                            '<strong>'.$xoops->db()->prefix($prefixed_query[4]).'</strong>'
299 299
                                         );
300 300
                                     }
301 301
                                 }
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
                                 // the table name is reserved, so halt the installation
304 304
                                 $this->error[]['sub'] = sprintf(
305 305
                                     SystemLocale::EF_TABLE_IS_RESERVED,
306
-                                    '<strong>' . $prefixed_query[4] . '</strong>'
306
+                                    '<strong>'.$prefixed_query[4].'</strong>'
307 307
                                 );
308 308
                                 break;
309 309
                             }
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
                         if (count($this->error) > 0) {
314 314
                             foreach ($created_tables as $table) {
315 315
                                 try {
316
-                                    $xoops->db()->query('DROP TABLE ' . $xoops->db()->prefix($table));
316
+                                    $xoops->db()->query('DROP TABLE '.$xoops->db()->prefix($table));
317 317
                                 } catch (Exception $e) {
318 318
                                     $xoops->events()->triggerEvent('core.exception', $e);
319 319
                                 }
@@ -328,25 +328,25 @@  discard block
 block discarded – undo
328 328
                 if (!$module_handler->insertModule($module)) {
329 329
                     $this->error[] = sprintf(
330 330
                         XoopsLocale::EF_NOT_INSERTED_TO_DATABASE,
331
-                        '<strong>' . $module->getVar('name') . '</strong>'
331
+                        '<strong>'.$module->getVar('name').'</strong>'
332 332
                     );
333 333
                     foreach ($created_tables as $ct) {
334 334
                         try {
335
-                            $xoops->db()->query('DROP TABLE ' . $xoops->db()->prefix($ct));
335
+                            $xoops->db()->query('DROP TABLE '.$xoops->db()->prefix($ct));
336 336
                         } catch (Exception $e) {
337 337
                             $xoops->events()->triggerEvent('core.exception', $e);
338 338
                         }
339 339
                     }
340
-                    $this->error[] = sprintf(XoopsLocale::EF_NOT_INSTALLED, "<strong>" . $module->name() . "</strong>");
340
+                    $this->error[] = sprintf(XoopsLocale::EF_NOT_INSTALLED, "<strong>".$module->name()."</strong>");
341 341
                     $this->error[] = XoopsLocale::C_ERRORS;
342 342
                     unset($module);
343 343
                     unset($created_tables);
344 344
                     return false;
345 345
                 }
346 346
                 unset($created_tables);
347
-                $this->trace[] = XoopsLocale::S_DATA_INSERTED . sprintf(
347
+                $this->trace[] = XoopsLocale::S_DATA_INSERTED.sprintf(
348 348
                     SystemLocale::F_MODULE_ID,
349
-                    '<strong>' . $module->getVar('mid') . '</strong>'
349
+                    '<strong>'.$module->getVar('mid').'</strong>'
350 350
                 );
351 351
                 $xoops->db()->beginTransaction();
352 352
                 // install Templates
@@ -378,14 +378,14 @@  discard block
 block discarded – undo
378 378
                         $mperm->setVar('gperm_name', 'module_admin');
379 379
                         $mperm->setVar('gperm_modid', 1);
380 380
                         if (!$gperm_handler->insert($mperm)) {
381
-                            $this->trace[]['sub'] = '<span class="red">' . sprintf(
381
+                            $this->trace[]['sub'] = '<span class="red">'.sprintf(
382 382
                                 SystemLocale::EF_GROUP_ID_ADMIN_ACCESS_RIGHT_NOT_ADDED,
383
-                                '<strong>' . $mygroup . '</strong>'
384
-                            ) . '</span>';
383
+                                '<strong>'.$mygroup.'</strong>'
384
+                            ).'</span>';
385 385
                         } else {
386 386
                             $this->trace[]['sub'] = sprintf(
387 387
                                 SystemLocale::SF_GROUP_ID_ADMIN_ACCESS_RIGHT_ADDED,
388
-                                '<strong>' . $mygroup . '</strong>'
388
+                                '<strong>'.$mygroup.'</strong>'
389 389
                             );
390 390
                         }
391 391
                         unset($mperm);
@@ -396,14 +396,14 @@  discard block
 block discarded – undo
396 396
                     $mperm->setVar('gperm_name', 'module_read');
397 397
                     $mperm->setVar('gperm_modid', 1);
398 398
                     if (!$gperm_handler->insert($mperm)) {
399
-                        $this->trace[]['sub'] = '<span class="red">' . sprintf(
399
+                        $this->trace[]['sub'] = '<span class="red">'.sprintf(
400 400
                             SystemLocale::EF_GROUP_ID_USER_ACCESS_RIGHT_NOT_ADDED,
401
-                            '<strong>' . $mygroup . '</strong>'
402
-                        ) . '</span>';
401
+                            '<strong>'.$mygroup.'</strong>'
402
+                        ).'</span>';
403 403
                     } else {
404 404
                         $this->trace[]['sub'] = sprintf(
405 405
                             SystemLocale::SF_GROUP_ID_USER_ACCESS_RIGHT_ADDED,
406
-                            '<strong>' . $mygroup . '</strong>'
406
+                            '<strong>'.$mygroup.'</strong>'
407 407
                         );
408 408
                     }
409 409
                     unset($mperm);
@@ -415,12 +415,12 @@  discard block
 block discarded – undo
415 415
                         $bperm->setVar('gperm_modid', 1);
416 416
                         if (!$gperm_handler->insert($bperm)) {
417 417
                             $this->trace[]['sub'] = '<span class="red">'
418
-                            . SystemLocale::E_BLOCK_ACCESS_NOT_ADDED . ' Block ID: <strong>'
419
-                            . $blc . '</strong> Group ID: <strong>' . $mygroup . '</strong></span>';
418
+                            . SystemLocale::E_BLOCK_ACCESS_NOT_ADDED.' Block ID: <strong>'
419
+                            . $blc.'</strong> Group ID: <strong>'.$mygroup.'</strong></span>';
420 420
                         } else {
421 421
                             $this->trace[]['sub'] = SystemLocale::S_BLOCK_ACCESS_ADDED
422
-                                . sprintf(SystemLocale::F_BLOCK_ID, "<strong>" . $blc . "</strong>")
423
-                                . sprintf(SystemLocale::F_GROUP_ID, "<strong>" . $mygroup . "</strong>");
422
+                                . sprintf(SystemLocale::F_BLOCK_ID, "<strong>".$blc."</strong>")
423
+                                . sprintf(SystemLocale::F_GROUP_ID, "<strong>".$mygroup."</strong>");
424 424
                         }
425 425
                         unset($bperm);
426 426
                     }
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 
445 445
                 $this->trace[] = sprintf(
446 446
                     XoopsLocale::SF_INSTALLED,
447
-                    '<strong>' . $module->getVar('name', 's') . '</strong>'
447
+                    '<strong>'.$module->getVar('name', 's').'</strong>'
448 448
                 );
449 449
                 unset($blocks);
450 450
 
@@ -456,8 +456,8 @@  discard block
 block discarded – undo
456 456
         } else {
457 457
             $this->error[] = sprintf(
458 458
                 XoopsLocale::EF_NOT_INSTALLED,
459
-                '<strong>' . $mod . '</strong>'
460
-            ) . "&nbsp;" . XoopsLocale::C_ERRORS;
459
+                '<strong>'.$mod.'</strong>'
460
+            )."&nbsp;".XoopsLocale::C_ERRORS;
461 461
             return false;
462 462
         }
463 463
         return false;
@@ -480,22 +480,22 @@  discard block
 block discarded – undo
480 480
         if ($module->getVar('dirname') === 'system') {
481 481
             $this->error[] = sprintf(
482 482
                 XoopsLocale::EF_NOT_UNINSTALLED,
483
-                '<strong>' . $module->getVar('name') . '</strong>'
484
-            ) . "&nbsp;" . XoopsLocale::C_ERRORS;
485
-            $this->error[] = " - " . SystemLocale::E_SYSTEM_MODULE_CANNOT_BE_DEACTIVATED;
483
+                '<strong>'.$module->getVar('name').'</strong>'
484
+            )."&nbsp;".XoopsLocale::C_ERRORS;
485
+            $this->error[] = " - ".SystemLocale::E_SYSTEM_MODULE_CANNOT_BE_DEACTIVATED;
486 486
             return false;
487 487
         } elseif ($module->getVar('dirname') == $xoops->getConfig('startpage')) {
488 488
             $this->error[] = sprintf(
489 489
                 XoopsLocale::EF_NOT_UNINSTALLED,
490
-                '<strong>' . $module->getVar('name') . '</strong>'
491
-            ) . "&nbsp;" . XoopsLocale::C_ERRORS;
492
-            $this->error[] = " - " . SystemLocale::E_THIS_MODULE_IS_SET_AS_DEFAULT_START_PAGE;
490
+                '<strong>'.$module->getVar('name').'</strong>'
491
+            )."&nbsp;".XoopsLocale::C_ERRORS;
492
+            $this->error[] = " - ".SystemLocale::E_THIS_MODULE_IS_SET_AS_DEFAULT_START_PAGE;
493 493
             return false;
494 494
         } else {
495 495
             // Load module specific install script if any
496 496
             $uninstall_script = $module->getInfo('onUninstall');
497 497
             if ($uninstall_script && trim($uninstall_script) != '') {
498
-                XoopsLoad::loadFile($xoops->path('modules/' . $mod . '/' . trim($uninstall_script)));
498
+                XoopsLoad::loadFile($xoops->path('modules/'.$mod.'/'.trim($uninstall_script)));
499 499
             }
500 500
             $func = "xoops_module_pre_uninstall_{$mod}";
501 501
             // If pre uninstall function is defined, execute
@@ -505,8 +505,8 @@  discard block
 block discarded – undo
505 505
                     $this->error[] = sprintf(XoopsLocale::EF_NOT_EXECUTED, $func);
506 506
                     $this->error[] = sprintf(
507 507
                         XoopsLocale::EF_NOT_UNINSTALLED,
508
-                        '<strong>' . $module->getVar('name') . '</strong>'
509
-                    ) . "&nbsp;" . XoopsLocale::C_ERRORS;
508
+                        '<strong>'.$module->getVar('name').'</strong>'
509
+                    )."&nbsp;".XoopsLocale::C_ERRORS;
510 510
                     $this->error = array_merge($this->error, $module->getErrors());
511 511
                     return false;
512 512
                 } else {
@@ -540,13 +540,13 @@  discard block
 block discarded – undo
540 540
                             $toSchema->dropTable($xoops->db()->prefix($table));
541 541
                             $this->trace[]['sub'] = sprintf(
542 542
                                 XoopsLocale::SF_TABLE_DROPPED,
543
-                                '<strong>' . $xoops->db()->prefix($table) . '</strong>'
543
+                                '<strong>'.$xoops->db()->prefix($table).'</strong>'
544 544
                             );
545 545
                         } else {
546
-                            $this->trace[]['sub'] = '<span class="red">' . sprintf(
546
+                            $this->trace[]['sub'] = '<span class="red">'.sprintf(
547 547
                                 XoopsLocale::EF_TABLE_DROP_NOT_ALLOWED,
548
-                                '<strong>' . $xoops->db()->prefix($table) . '</strong>'
549
-                            ) . '</span>';
548
+                                '<strong>'.$xoops->db()->prefix($table).'</strong>'
549
+                            ).'</span>';
550 550
                         }
551 551
                     }
552 552
                     $synchronizer = new SingleDatabaseSynchronizer($xoops->db());
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
                 // delete permissions if any
557 557
                 $gperm_handler = $xoops->getHandlerGroupPermission();
558 558
                 if (false === $gperm_handler->deleteByModule($module->getVar('mid'))) {
559
-                    $this->trace[] = '<span class="red">' . SystemLocale::E_GROUP_PERMISSIONS_NOT_DELETED . '</span>';
559
+                    $this->trace[] = '<span class="red">'.SystemLocale::E_GROUP_PERMISSIONS_NOT_DELETED.'</span>';
560 560
                 } else {
561 561
                     $this->trace[] = SystemLocale::S_GROUP_PERMISSIONS_DELETED;
562 562
                 }
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
                 $this->deleteConfigs($module);
566 566
 
567 567
                 // execute module specific install script if any
568
-                $func = 'xoops_module_uninstall_' . $mod;
568
+                $func = 'xoops_module_uninstall_'.$mod;
569 569
                 if (function_exists($func)) {
570 570
                     $result = $func($module);
571 571
                     if (!$result) {
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
                 }
579 579
                 $this->trace[] = sprintf(
580 580
                     XoopsLocale::SF_UNINSTALLED,
581
-                    '<strong>' . $module->getVar('name') . '</strong>'
581
+                    '<strong>'.$module->getVar('name').'</strong>'
582 582
                 );
583 583
                 $xoops->events()->triggerEvent('system.module.uninstall', $module);
584 584
                 return $module;
@@ -609,14 +609,14 @@  discard block
 block discarded – undo
609 609
         $this->addTemporaryAutoloader($module);
610 610
 
611 611
         if (!$module_handler->insertModule($module)) {
612
-            $this->error[] = sprintf(XoopsLocale::EF_NOT_UPDATED, "<strong>" . $module->getVar('name') . "</strong>");
612
+            $this->error[] = sprintf(XoopsLocale::EF_NOT_UPDATED, "<strong>".$module->getVar('name')."</strong>");
613 613
             return false;
614 614
         } else {
615 615
             // execute module specific preupdate script if any
616 616
             $update_script = $module->getInfo('onUpdate');
617 617
             if (false != $update_script && trim($update_script) != '') {
618
-                XoopsLoad::loadFile($xoops->path('modules/' . $mod . '/' . trim($update_script)));
619
-                $func = 'xoops_module_pre_update_' . $mod;
618
+                XoopsLoad::loadFile($xoops->path('modules/'.$mod.'/'.trim($update_script)));
619
+                $func = 'xoops_module_pre_update_'.$mod;
620 620
                 if (function_exists($func)) {
621 621
                     $result = $func($module, $prev_version);
622 622
                     if (!$result) {
@@ -632,13 +632,13 @@  discard block
 block discarded – undo
632 632
             // update schema
633 633
             $schema_file = $module->getInfo('schema');
634 634
             if (!empty($schema_file)) {
635
-                $schema_file_path = \XoopsBaseConfig::get('root-path') . '/modules/' . $mod . '/' . $schema_file;
635
+                $schema_file_path = \XoopsBaseConfig::get('root-path').'/modules/'.$mod.'/'.$schema_file;
636 636
                 if (!XoopsLoad::fileExists($schema_file_path)) {
637 637
                     $this->error[] =
638 638
                         sprintf(SystemLocale::EF_SQL_FILE_NOT_FOUND, "<strong>{$schema_file}</strong>");
639 639
                     return false;
640 640
                 }
641
-                $importer = new ImportSchema(\XoopsBaseConfig::get('db-prefix') . '_');
641
+                $importer = new ImportSchema(\XoopsBaseConfig::get('db-prefix').'_');
642 642
                 $importSchema = $importer->importSchemaArray(Yaml::read($schema_file_path));
643 643
                 $synchronizer = new SingleDatabaseSynchronizer($xoops->db());
644 644
                 $synchronizer->updateSchema($importSchema, true);
@@ -665,8 +665,8 @@  discard block
 block discarded – undo
665 665
             // execute module specific update script if any
666 666
             $update_script = $module->getInfo('onUpdate');
667 667
             if (false != $update_script && trim($update_script) != '') {
668
-                XoopsLoad::loadFile($xoops->path('modules/' . $mod . '/' . trim($update_script)));
669
-                $func = 'xoops_module_update_' . $mod;
668
+                XoopsLoad::loadFile($xoops->path('modules/'.$mod.'/'.trim($update_script)));
669
+                $func = 'xoops_module_update_'.$mod;
670 670
                 if (function_exists($func)) {
671 671
                     $result = $func($module, $prev_version);
672 672
                     if (!$result) {
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
                     }
679 679
                 }
680 680
             }
681
-            $this->trace[] = sprintf(XoopsLocale::SF_UPDATED, '<strong>' . $module->getVar('name', 's') . '</strong>');
681
+            $this->trace[] = sprintf(XoopsLocale::SF_UPDATED, '<strong>'.$module->getVar('name', 's').'</strong>');
682 682
             return $module;
683 683
         }
684 684
     }
@@ -699,10 +699,10 @@  discard block
 block discarded – undo
699 699
         switch ($type) {
700 700
             case 'blocks':
701 701
             case 'admin':
702
-                $path = $xoops->path('modules/' . $dirname . '/templates/' . $type . '/' . $template);
702
+                $path = $xoops->path('modules/'.$dirname.'/templates/'.$type.'/'.$template);
703 703
                 break;
704 704
             default:
705
-                $path = $xoops->path('modules/' . $dirname . '/templates/' . $template);
705
+                $path = $xoops->path('modules/'.$dirname.'/templates/'.$template);
706 706
                 break;
707 707
         }
708 708
         if (!XoopsLoad::fileExists($path)) {
@@ -755,39 +755,39 @@  discard block
 block discarded – undo
755 755
                     $tplfile->setVar('tpl_file', $tpl['file']);
756 756
                     $tplfile->setVar('tpl_desc', $tpl['description']);
757 757
                     if (!$tplfile_handler->insertTpl($tplfile)) {
758
-                        $this->trace[]['sub'] = '<span class="red">' . sprintf(
758
+                        $this->trace[]['sub'] = '<span class="red">'.sprintf(
759 759
                             SystemLocale::EF_TEMPLATE_NOT_ADDED_TO_DATABASE,
760
-                            '<strong>' . $tpl['file'] . '</strong>'
761
-                        ) . '</span>';
760
+                            '<strong>'.$tpl['file'].'</strong>'
761
+                        ).'</span>';
762 762
                     } else {
763 763
                         $newid = $tplfile->getVar('tpl_id');
764 764
                         $this->trace[]['sub'] = sprintf(
765 765
                             SystemLocale::SF_TEMPLATE_ADDED,
766
-                            '<strong>' . $tpl['file'] . '</strong>'
766
+                            '<strong>'.$tpl['file'].'</strong>'
767 767
                         );
768 768
                         if ($module->getVar('dirname') === 'system') {
769 769
                             if (!$xoops->templateTouch($newid)) {
770
-                                $this->trace[]['sub'] = '<span class="red">' . sprintf(
770
+                                $this->trace[]['sub'] = '<span class="red">'.sprintf(
771 771
                                     SystemLocale::EF_TEMPLATE_NOT_RECOMPILED,
772
-                                    '<strong>' . $tpl['file'] . '</strong>'
773
-                                ) . '</span>';
772
+                                    '<strong>'.$tpl['file'].'</strong>'
773
+                                ).'</span>';
774 774
                             } else {
775 775
                                 $this->trace[]['sub'] = sprintf(
776 776
                                     SystemLocale::SF_TEMPLATE_RECOMPILED,
777
-                                    '<strong>' . $tpl['file'] . '</strong>'
777
+                                    '<strong>'.$tpl['file'].'</strong>'
778 778
                                 );
779 779
                             }
780 780
                         } else {
781 781
                             if ($xoops->config['template_set'] === 'default') {
782 782
                                 if (!$xoops->templateTouch($newid)) {
783
-                                    $this->trace[]['sub'] = '<span class="red">' . sprintf(
783
+                                    $this->trace[]['sub'] = '<span class="red">'.sprintf(
784 784
                                         SystemLocale::EF_TEMPLATE_NOT_RECOMPILED,
785
-                                        '<strong>' . $tpl['file'] . '</strong>'
786
-                                    ) . '</span>';
785
+                                        '<strong>'.$tpl['file'].'</strong>'
786
+                                    ).'</span>';
787 787
                                 } else {
788 788
                                     $this->trace[]['sub'] = sprintf(
789 789
                                         SystemLocale::SF_TEMPLATE_RECOMPILED,
790
-                                        '<strong>' . $tpl['file'] . '</strong>'
790
+                                        '<strong>'.$tpl['file'].'</strong>'
791 791
                                     );
792 792
                                 }
793 793
                             }
@@ -795,10 +795,10 @@  discard block
 block discarded – undo
795 795
                     }
796 796
                     unset($tpldata);
797 797
                 } else {
798
-                    $this->trace[]['sub'] = '<span class="red">' . sprintf(
798
+                    $this->trace[]['sub'] = '<span class="red">'.sprintf(
799 799
                         SystemLocale::EF_TEMPLATE_NOT_DELETED,
800
-                        '<strong>' . $tpl['file'] . '</strong>'
801
-                    ) . '</span>';
800
+                        '<strong>'.$tpl['file'].'</strong>'
801
+                    ).'</span>';
802 802
                 }
803 803
             }
804 804
         }
@@ -887,17 +887,17 @@  discard block
 block discarded – undo
887 887
                     $block_obj[0]->setVar('last_modified', time());
888 888
 
889 889
                     if (!$block_handler->insert($block_obj[0])) {
890
-                        $this->trace[]['sub'] = '<span class="red">' . sprintf(
890
+                        $this->trace[]['sub'] = '<span class="red">'.sprintf(
891 891
                             XoopsLocale::EF_NOT_UPDATED,
892 892
                             $block_obj[0]->getVar('name')
893
-                        ) . '</span>';
893
+                        ).'</span>';
894 894
                     } else {
895 895
                         $this->trace[]['sub'] = sprintf(
896 896
                             SystemLocale::SF_BLOCK_UPDATED,
897
-                            '<strong>' . $block_obj[0]->getVar('name')
898
-                        ) . '</strong>' . sprintf(
897
+                            '<strong>'.$block_obj[0]->getVar('name')
898
+                        ).'</strong>'.sprintf(
899 899
                             SystemLocale::F_BLOCK_ID,
900
-                            '<strong>' . $block_obj[0]->getVar('bid') . '</strong>'
900
+                            '<strong>'.$block_obj[0]->getVar('bid').'</strong>'
901 901
                         );
902 902
 
903 903
                         if (0 == $blockmodulelink_handler->getCount(new Criteria('block_id', $block_obj[0]->getVar('bid')))) {
@@ -926,38 +926,38 @@  discard block
 block discarded – undo
926 926
                             $tplfile_new->setVar('tpl_lastmodified', time());
927 927
                             $tplfile_new->setVar('tpl_lastimported', 0);
928 928
                             if (!$tplfile_handler->insertTpl($tplfile_new)) {
929
-                                $this->trace[]['sub'] = '<span class="red">' . sprintf(
929
+                                $this->trace[]['sub'] = '<span class="red">'.sprintf(
930 930
                                     SystemLocale::EF_TEMPLATE_NOT_UPDATED,
931
-                                    '<strong>' . $block['template'] . '</strong>'
932
-                                ) . '</span>';
931
+                                    '<strong>'.$block['template'].'</strong>'
932
+                                ).'</span>';
933 933
                             } else {
934 934
                                 $this->trace[]['sub'] = sprintf(
935 935
                                     SystemLocale::SF_TEMPLATE_UPDATED,
936
-                                    '<strong>' . $block['template'] . '</strong>'
936
+                                    '<strong>'.$block['template'].'</strong>'
937 937
                                 );
938 938
                                 if ($module->getVar('dirname') === 'system') {
939 939
                                     if (!$xoops->templateTouch($tplfile_new->getVar('tpl_id'))) {
940
-                                        $this->trace[]['sub'] = '<span class="red">' . sprintf(
940
+                                        $this->trace[]['sub'] = '<span class="red">'.sprintf(
941 941
                                             SystemLocale::EF_TEMPLATE_NOT_RECOMPILED,
942
-                                            '<strong>' . $block['template'] . '</strong>'
943
-                                        ) . '</span>';
942
+                                            '<strong>'.$block['template'].'</strong>'
943
+                                        ).'</span>';
944 944
                                     } else {
945 945
                                         $this->trace[]['sub'] = sprintf(
946 946
                                             SystemLocale::SF_TEMPLATE_RECOMPILED,
947
-                                            '<strong>' . $block['template'] . '</strong>'
947
+                                            '<strong>'.$block['template'].'</strong>'
948 948
                                         );
949 949
                                     }
950 950
                                 } else {
951 951
                                     if ($xoops->config['template_set'] === 'default') {
952 952
                                         if (!$xoops->templateTouch($tplfile_new->getVar('tpl_id'))) {
953
-                                            $this->trace[]['sub'] = '<span class="red">' . sprintf(
953
+                                            $this->trace[]['sub'] = '<span class="red">'.sprintf(
954 954
                                                 SystemLocale::EF_TEMPLATE_NOT_RECOMPILED,
955
-                                                '<strong>' . $block['template'] . '</strong>'
956
-                                            ) . '</span>';
955
+                                                '<strong>'.$block['template'].'</strong>'
956
+                                            ).'</span>';
957 957
                                         } else {
958 958
                                             $this->trace[]['sub'] = sprintf(
959 959
                                                 SystemLocale::SF_TEMPLATE_RECOMPILED,
960
-                                                '<strong>' . $block['template'] . '</strong>'
960
+                                                '<strong>'.$block['template'].'</strong>'
961 961
                                             );
962 962
                                         }
963 963
                                     }
@@ -975,20 +975,20 @@  discard block
 block discarded – undo
975 975
                 || !in_array($block->getVar('func_file'), $funcfiles)
976 976
             ) {
977 977
                 if (!$block_handler->delete($block)) {
978
-                    $this->trace[]['sub'] = '<span class="red">' . sprintf(
978
+                    $this->trace[]['sub'] = '<span class="red">'.sprintf(
979 979
                         SystemLocale::EF_BLOCK_NOT_DELETED,
980
-                        "<strong>" . $block->getVar('name') . "</strong>"
981
-                    ) . sprintf(
980
+                        "<strong>".$block->getVar('name')."</strong>"
981
+                    ).sprintf(
982 982
                         SystemLocale::F_BLOCK_ID,
983
-                        "<strong>" . $block->getVar('bid') . "</strong>"
984
-                    ) . '</span>';
983
+                        "<strong>".$block->getVar('bid')."</strong>"
984
+                    ).'</span>';
985 985
                 } else {
986 986
                     $this->trace[]['sub'] = sprintf(
987 987
                         SystemLocale::SF_BLOCK_DELETED,
988
-                        '<strong>' . $block->getVar('name') . '</strong>'
989
-                    ) . '&nbsp;' . sprintf(
988
+                        '<strong>'.$block->getVar('name').'</strong>'
989
+                    ).'&nbsp;'.sprintf(
990 990
                         SystemLocale::F_BLOCK_ID,
991
-                        '<strong>' . $block->getVar('bid') . '</strong>'
991
+                        '<strong>'.$block->getVar('bid').'</strong>'
992 992
                     );
993 993
                     if ($block->getVar('template') != '') {
994 994
                         $tplfiles = $tplfile_handler->find(null, 'block', $block->getVar('bid'));
@@ -998,11 +998,11 @@  discard block
 block discarded – undo
998 998
                                 if (!$tplfile_handler->deleteTpl($tplfile)) {
999 999
                                     $this->trace[]['sub'] = '<span class="red">'
1000 1000
                                         . SystemLocale::E_BLOCK_TEMPLATE_DEPRECATED_NOT_REMOVED
1001
-                                        . '(ID: <strong>' . $tplfile->getVar('tpl_id') . '</strong>)</span>';
1001
+                                        . '(ID: <strong>'.$tplfile->getVar('tpl_id').'</strong>)</span>';
1002 1002
                                 } else {
1003 1003
                                     $this->trace[]['sub'] = sprintf(
1004 1004
                                         SystemLocale::SF_BLOCK_TEMPLATE_DEPRECATED,
1005
-                                        "<strong>" . $tplfile->getVar('tpl_file') . "</strong>"
1005
+                                        "<strong>".$tplfile->getVar('tpl_file')."</strong>"
1006 1006
                                     );
1007 1007
                                 }
1008 1008
                             }
@@ -1031,20 +1031,20 @@  discard block
 block discarded – undo
1031 1031
             /* @var $block XoopsBlock */
1032 1032
             foreach ($blocks as $block) {
1033 1033
                 if (false === $block_handler->deleteBlock($block)) {
1034
-                    $this->trace[]['sub'] = '<span class="red">' . sprintf(
1034
+                    $this->trace[]['sub'] = '<span class="red">'.sprintf(
1035 1035
                         SystemLocale::EF_BLOCK_NOT_DELETED,
1036
-                        "<strong>" . $block->getVar('name') . "</strong>"
1037
-                    ) . sprintf(
1036
+                        "<strong>".$block->getVar('name')."</strong>"
1037
+                    ).sprintf(
1038 1038
                         SystemLocale::F_BLOCK_ID,
1039
-                        "<strong>" . $block->getVar('bid') . "</strong>"
1040
-                    ) . '</span>';
1039
+                        "<strong>".$block->getVar('bid')."</strong>"
1040
+                    ).'</span>';
1041 1041
                 } else {
1042 1042
                     $this->trace[]['sub'] = sprintf(
1043 1043
                         SystemLocale::SF_BLOCK_DELETED,
1044
-                        "<strong>" . $block->getVar('name') . "</strong>"
1045
-                    ) . sprintf(
1044
+                        "<strong>".$block->getVar('name')."</strong>"
1045
+                    ).sprintf(
1046 1046
                         SystemLocale::F_BLOCK_ID,
1047
-                        "<strong>" . $block->getVar('bid') . "</strong>"
1047
+                        "<strong>".$block->getVar('bid')."</strong>"
1048 1048
                     );
1049 1049
                 }
1050 1050
                 if ($block->getVar('template') != '') {
@@ -1052,20 +1052,20 @@  discard block
 block discarded – undo
1052 1052
                     /* @var $template XoopsTplFile */
1053 1053
                     foreach ($templates as $template) {
1054 1054
                         if (!$tplfile_handler->delete($template)) {
1055
-                            $this->trace[]['sub'] = '<span class="red">' . sprintf(
1055
+                            $this->trace[]['sub'] = '<span class="red">'.sprintf(
1056 1056
                                 SystemLocale::EF_BLOCK_TEMPLATE_NOT_DELETED,
1057 1057
                                 $template->getVar('tpl_file')
1058
-                            ) . sprintf(
1058
+                            ).sprintf(
1059 1059
                                 SystemLocale::F_TEMPLATE_ID,
1060
-                                "<strong>" . $template->getVar('tpl_id') . "</strong>"
1061
-                            ) . '</span>';
1060
+                                "<strong>".$template->getVar('tpl_id')."</strong>"
1061
+                            ).'</span>';
1062 1062
                         } else {
1063 1063
                             $this->trace[]['sub'] = sprintf(
1064 1064
                                 SystemLocale::SF_BLOCK_TEMPLATE_DELETED,
1065
-                                "<strong>" . $template->getVar('tpl_file') . "</strong>"
1066
-                            ) . sprintf(
1065
+                                "<strong>".$template->getVar('tpl_file')."</strong>"
1066
+                            ).sprintf(
1067 1067
                                 SystemLocale::F_TEMPLATE_ID,
1068
-                                "<strong>" . $template->getVar('tpl_id') . "</strong>"
1068
+                                "<strong>".$template->getVar('tpl_id')."</strong>"
1069 1069
                             );
1070 1070
                         }
1071 1071
                     }
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
                 if (!$config_handler->deleteConfig($config)) {
1096 1096
                     $this->trace[]['sub'] = '<span class="red">'
1097 1097
                         . SystemLocale::E_CONFIG_DATA_NOT_DELETED
1098
-                        . sprintf(SystemLocale::F_CONFIG_ID, "<strong>" . $config->getVar('conf_id') . "</strong>")
1098
+                        . sprintf(SystemLocale::F_CONFIG_ID, "<strong>".$config->getVar('conf_id')."</strong>")
1099 1099
                         . '</span>';
1100 1100
                     // save the name of config failed to delete for later use
1101 1101
                     $this->config_delng[] = $config->getVar('conf_name');
@@ -1104,7 +1104,7 @@  discard block
 block discarded – undo
1104 1104
                     $this->config_old[$config->getVar('conf_name')]['formtype'] = $config->getVar('conf_formtype');
1105 1105
                     $this->config_old[$config->getVar('conf_name')]['valuetype'] = $config->getVar('conf_valuetype');
1106 1106
                     $this->trace[]['sub'] = SystemLocale::S_CONFIG_DATA_DELETED
1107
-                        . sprintf(SystemLocale::F_CONFIG_ID, "<strong>" . $config->getVar('conf_id') . "</strong>");
1107
+                        . sprintf(SystemLocale::F_CONFIG_ID, "<strong>".$config->getVar('conf_id')."</strong>");
1108 1108
                 }
1109 1109
             }
1110 1110
         }
@@ -1170,7 +1170,7 @@  discard block
 block discarded – undo
1170 1170
                             $confop_msgs .= ' <strong>'
1171 1171
                                 . \Xoops\Locale::translate($key, $module->getVar('dirname'))
1172 1172
                                 . '</strong> ';
1173
-                            $confop_msgs .= XoopsLocale::C_VALUE . ' <strong>' . $value . '</strong> ';
1173
+                            $confop_msgs .= XoopsLocale::C_VALUE.' <strong>'.$value.'</strong> ';
1174 1174
                             unset($confop);
1175 1175
                         }
1176 1176
                     }
@@ -1178,11 +1178,11 @@  discard block
 block discarded – undo
1178 1178
                     if (false != $config_handler->insertConfig($confobj)) {
1179 1179
                         $this->trace[]['sub'] = sprintf(
1180 1180
                             SystemLocale::SF_CONFIG_ADDED,
1181
-                            "<strong>" . $config['name'] . "</strong>"
1182
-                        ) . $confop_msgs;
1181
+                            "<strong>".$config['name']."</strong>"
1182
+                        ).$confop_msgs;
1183 1183
                     } else {
1184 1184
                         $this->trace[]['sub'] = '<span class="red">'
1185
-                            . sprintf(SystemLocale::EF_CONFIG_NOT_ADDED, "<strong>" . $config['name'] . "</strong>")
1185
+                            . sprintf(SystemLocale::EF_CONFIG_NOT_ADDED, "<strong>".$config['name']."</strong>")
1186 1186
                             . '</span>';
1187 1187
                     }
1188 1188
                     unset($confobj);
@@ -1210,7 +1210,7 @@  discard block
 block discarded – undo
1210 1210
             return;
1211 1211
         }
1212 1212
         $xoops = Xoops::getInstance();
1213
-        $base_dir = $xoops->path('modules/' . $module->getVar('dirname') . '/src');
1213
+        $base_dir = $xoops->path('modules/'.$module->getVar('dirname').'/src');
1214 1214
         $loader = new Psr4ClassLoader;
1215 1215
         $loader->register();
1216 1216
         $loader->addNamespace($prefix, $base_dir);
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Database/Schema/PrefixStripper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
         try {
64 64
             $name = $table->getName();
65 65
             $len = strlen($this->xPrefix);
66
-            if (substr_compare($name, $this->xPrefix, 0, $len)===0) {
66
+            if (substr_compare($name, $this->xPrefix, 0, $len) === 0) {
67 67
                 $name = substr($name, $len);
68 68
                 if (empty($this->tableList) || in_array($name, $this->tableList)) {
69 69
                     $idGeneratorType = 0; // how should we handle this?
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Database/Schema/ImportSchema.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,9 +82,9 @@
 block discarded – undo
82 82
      */
83 83
     public function importTables(array $tableArray)
84 84
     {
85
-        $tables=array();
85
+        $tables = array();
86 86
         foreach ($tableArray as $name => $tabledef) {
87
-            $tableName = $this->xPrefix . $name;
87
+            $tableName = $this->xPrefix.$name;
88 88
             $columns = array();
89 89
             $indexes = array();
90 90
             $fkConstraints = array();
Please login to merge, or discard this patch.