Completed
Pull Request — master (#616)
by Richard
13:56
created
htdocs/class/class.tar.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
                 // Increment number of files
207 207
                 $this->numFiles++;
208 208
                 // Create us a new file in our array
209
-                $activeFile =& $this->files[];
209
+                $activeFile = & $this->files[];
210 210
                 // Asign Values
211 211
                 $activeFile["name"] = $file_name;
212 212
                 $activeFile["mode"] = $file_mode;
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                 // Increment number of directories
223 223
                 $this->numDirectories++;
224 224
                 // Create a new directory in our array
225
-                $activeDir =& $this->directories[];
225
+                $activeDir = & $this->directories[];
226 226
                 // Assign values
227 227
                 $activeDir["name"] = $file_name;
228 228
                 $activeDir["mode"] = $file_mode;
@@ -288,16 +288,16 @@  discard block
 block discarded – undo
288 288
                 // Generate tar header for this directory
289 289
                 // Filename, Permissions, UID, GID, size, Time, checksum, typeflag, linkname, magic, version, user name, group name, devmajor, devminor, prefix, end
290 290
                 $header .= str_pad($information["name"], 100, chr(0));
291
-                $header .= str_pad(decoct($information["mode"]), 7, "0", STR_PAD_LEFT) . chr(0);
292
-                $header .= str_pad(decoct($information["user_id"]), 7, "0", STR_PAD_LEFT) . chr(0);
293
-                $header .= str_pad(decoct($information["group_id"]), 7, "0", STR_PAD_LEFT) . chr(0);
294
-                $header .= str_pad(decoct(0), 11, "0", STR_PAD_LEFT) . chr(0);
295
-                $header .= str_pad(decoct($information["time"]), 11, "0", STR_PAD_LEFT) . chr(0);
291
+                $header .= str_pad(decoct($information["mode"]), 7, "0", STR_PAD_LEFT).chr(0);
292
+                $header .= str_pad(decoct($information["user_id"]), 7, "0", STR_PAD_LEFT).chr(0);
293
+                $header .= str_pad(decoct($information["group_id"]), 7, "0", STR_PAD_LEFT).chr(0);
294
+                $header .= str_pad(decoct(0), 11, "0", STR_PAD_LEFT).chr(0);
295
+                $header .= str_pad(decoct($information["time"]), 11, "0", STR_PAD_LEFT).chr(0);
296 296
                 $header .= str_repeat(" ", 8);
297 297
                 $header .= "5";
298 298
                 $header .= str_repeat(chr(0), 100);
299 299
                 $header .= str_pad("ustar", 6, chr(32));
300
-                $header .= chr(32) . chr(0);
300
+                $header .= chr(32).chr(0);
301 301
                 $header .= str_pad("", 32, chr(0));
302 302
                 $header .= str_pad("", 32, chr(0));
303 303
                 $header .= str_repeat(chr(0), 8);
@@ -323,16 +323,16 @@  discard block
 block discarded – undo
323 323
                 // Generate the TAR header for this file
324 324
                 // Filename, Permissions, UID, GID, size, Time, checksum, typeflag, linkname, magic, version, user name, group name, devmajor, devminor, prefix, end
325 325
                 $header .= str_pad($information["name"], 100, chr(0));
326
-                $header .= str_pad(decoct($information["mode"]), 7, "0", STR_PAD_LEFT) . chr(0);
327
-                $header .= str_pad(decoct($information["user_id"]), 7, "0", STR_PAD_LEFT) . chr(0);
328
-                $header .= str_pad(decoct($information["group_id"]), 7, "0", STR_PAD_LEFT) . chr(0);
329
-                $header .= str_pad(decoct($information["size"]), 11, "0", STR_PAD_LEFT) . chr(0);
330
-                $header .= str_pad(decoct($information["time"]), 11, "0", STR_PAD_LEFT) . chr(0);
326
+                $header .= str_pad(decoct($information["mode"]), 7, "0", STR_PAD_LEFT).chr(0);
327
+                $header .= str_pad(decoct($information["user_id"]), 7, "0", STR_PAD_LEFT).chr(0);
328
+                $header .= str_pad(decoct($information["group_id"]), 7, "0", STR_PAD_LEFT).chr(0);
329
+                $header .= str_pad(decoct($information["size"]), 11, "0", STR_PAD_LEFT).chr(0);
330
+                $header .= str_pad(decoct($information["time"]), 11, "0", STR_PAD_LEFT).chr(0);
331 331
                 $header .= str_repeat(" ", 8);
332 332
                 $header .= "0";
333 333
                 $header .= str_repeat(chr(0), 100);
334 334
                 $header .= str_pad("ustar", 6, chr(32));
335
-                $header .= chr(32) . chr(0);
335
+                $header .= chr(32).chr(0);
336 336
                 $header .= str_pad($information["user_name"], 32, chr(0)); // How do I get a file's user name from PHP?
337 337
                 $header .= str_pad($information["group_name"], 32, chr(0)); // How do I get a file's group name from PHP?
338 338
                 $header .= str_repeat(chr(0), 8);
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
                 // Pad file contents to byte count divisible by 512
350 350
                 $file_contents = str_pad($information["file"], (ceil($information["size"] / 512) * 512), chr(0));
351 351
                 // Add new tar formatted data to tar file contents
352
-                $this->tar_file .= $header . $file_contents;
352
+                $this->tar_file .= $header.$file_contents;
353 353
             }
354 354
         }
355 355
         // Add 512 bytes of NULLs to designate EOF
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
         $file_information = stat($dirname);
488 488
         // Add directory to processed data
489 489
         $this->numDirectories++;
490
-        $activeDir =& $this->directories[];
490
+        $activeDir = & $this->directories[];
491 491
         $activeDir['name'] = $dirname;
492 492
         $activeDir['mode'] = $file_information['mode'];
493 493
         $activeDir['time'] = $file_information['time'];
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
         fclose($fp);
528 528
         // Add file to processed data
529 529
         $this->numFiles++;
530
-        $activeFile =& $this->files[];
530
+        $activeFile = & $this->files[];
531 531
         $activeFile['name'] = $filename;
532 532
         $activeFile['mode'] = $file_information['mode'];
533 533
         $activeFile['user_id'] = $file_information['uid'];
Please login to merge, or discard this patch.
htdocs/index.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
  * @version         $Id$
25 25
  */
26 26
 
27
-$mainfile = __DIR__ . '/mainfile.php';
27
+$mainfile = __DIR__.'/mainfile.php';
28 28
 if (file_exists($mainfile)) {
29 29
     include $mainfile;
30
-} elseif (file_exists(__DIR__ . '/install/index.php')) {
30
+} elseif (file_exists(__DIR__.'/install/index.php')) {
31 31
     header('Location: install/index.php');
32 32
     exit;
33 33
 }
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     $xoops->module = $xoops->getModuleByDirname($xoops->getConfig('startpage'));
45 45
     if (!$xoops->isModule() || !$xoops->module->getVar('isactive')) {
46 46
         $xoops->header();
47
-        echo "<h4>" . XoopsLocale::E_NO_MODULE . "</h4>";
47
+        echo "<h4>".XoopsLocale::E_NO_MODULE."</h4>";
48 48
         $xoops->footer();
49 49
     }
50 50
     $moduleperm_handler = $xoops->getHandlerGroupPermission();
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         $xoops->userIsAdmin = $xoops->user->isAdmin($xoops->module->getVar('mid'));
56 56
     } else {
57 57
         if (!$moduleperm_handler->checkRight('module_read', $xoops->module->getVar('mid'), FixedGroups::ANONYMOUS)) {
58
-            $xoops->redirect(\XoopsBaseConfig::get('url') . "/user.php", 1, XoopsLocale::E_NO_ACCESS_PERMISSION);
58
+            $xoops->redirect(\XoopsBaseConfig::get('url')."/user.php", 1, XoopsLocale::E_NO_ACCESS_PERMISSION);
59 59
         }
60 60
     }
61 61
     if ($xoops->module->getVar('hasconfig') == 1
@@ -65,22 +65,22 @@  discard block
 block discarded – undo
65 65
         $xoops->moduleConfig = $xoops->getModuleConfigs();
66 66
     }
67 67
 
68
-    chdir('modules/' . $xoops->getConfig('startpage') . '/');
68
+    chdir('modules/'.$xoops->getConfig('startpage').'/');
69 69
     $xoops->loadLanguage('main', $xoops->module->getVar('dirname', 'n'));
70 70
     $parsed = parse_url(\XoopsBaseConfig::get('url'));
71
-    $url = isset($parsed['scheme']) ? $parsed['scheme'] . '://' : 'http://';
71
+    $url = isset($parsed['scheme']) ? $parsed['scheme'].'://' : 'http://';
72 72
     if (isset($parsed['host'])) {
73 73
         $url .= $parsed['host'];
74 74
         if (isset($parsed['port'])) {
75
-            $url .= ':' . $parsed['port'];
75
+            $url .= ':'.$parsed['port'];
76 76
         }
77 77
     } else {
78 78
         $url .= $_SERVER['HTTP_HOST'];
79 79
     }
80 80
 
81 81
     $_SERVER['REQUEST_URI'] =
82
-        substr(\XoopsBaseConfig::get('url'), strlen($url)) . '/modules/' . $xoops->getConfig('startpage') . '/index.php';
83
-    include $xoops->path('modules/' . $xoops->getConfig('startpage') . '/index.php');
82
+        substr(\XoopsBaseConfig::get('url'), strlen($url)).'/modules/'.$xoops->getConfig('startpage').'/index.php';
83
+    include $xoops->path('modules/'.$xoops->getConfig('startpage').'/index.php');
84 84
     exit();
85 85
 } else {
86 86
     $xoops->setOption('show_cblock', 1);
Please login to merge, or discard this patch.
htdocs/mainfile.dist.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     // URL Association for SSL and Protocol Compatibility
37 37
     $http = 'http://';
38 38
     if (!empty($_SERVER['HTTPS'])) {
39
-        $http = ($_SERVER['HTTPS']==='on') ? 'https://' : 'http://';
39
+        $http = ($_SERVER['HTTPS'] === 'on') ? 'https://' : 'http://';
40 40
     }
41 41
     define('XOOPS_PROT', $http);
42 42
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             }
57 57
             $xoopsScriptPath = $xoopsScriptPath[0]["file"];
58 58
         } else {
59
-            $xoopsScriptPath = isset($_SERVER["PATH_TRANSLATED"]) ? $_SERVER["PATH_TRANSLATED"] :  $_SERVER["SCRIPT_FILENAME"];
59
+            $xoopsScriptPath = isset($_SERVER["PATH_TRANSLATED"]) ? $_SERVER["PATH_TRANSLATED"] : $_SERVER["SCRIPT_FILENAME"];
60 60
         }
61 61
         if (DIRECTORY_SEPARATOR !== "/") {
62 62
             // IIS6 may double the \ chars
@@ -68,10 +68,10 @@  discard block
 block discarded – undo
68 68
     }
69 69
 
70 70
     // Secure file
71
-    require XOOPS_VAR_PATH . '/data/secure.php';
71
+    require XOOPS_VAR_PATH.'/data/secure.php';
72 72
 
73 73
     if (!class_exists('XoopsBaseConfig', false)) {
74
-        include __DIR__ . '/class/XoopsBaseConfig.php';
74
+        include __DIR__.'/class/XoopsBaseConfig.php';
75 75
         XoopsBaseConfig::bootstrapTransition();
76 76
     }
77 77
 
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         if (function_exists("debug_backtrace")) {
50 50
             $xoopsScriptPath = debug_backtrace();
51 51
             if (!count($xoopsScriptPath)) {
52
-                 die("XOOPS path check: this file cannot be requested directly");
52
+                    die("XOOPS path check: this file cannot be requested directly");
53 53
             }
54 54
             $xoopsScriptPath = $xoopsScriptPath[0]["file"];
55 55
         } else {
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
             $xoopsScriptPath = str_replace(strpos($xoopsScriptPath, "\\\\", 2) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $xoopsScriptPath);
61 61
         }
62 62
         if (strcasecmp(substr($xoopsScriptPath, 0, strlen(XOOPS_ROOT_PATH)), str_replace(DIRECTORY_SEPARATOR, "/", XOOPS_ROOT_PATH))) {
63
-             exit("XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run.");
63
+                exit("XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run.");
64 64
         }
65 65
     }
66 66
 
Please login to merge, or discard this patch.
console/config.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 $configs = array(
3
-    'autoloader' => dirname(__DIR__) . '/xoops_lib/vendor/autoload.php',
4
-    'configfile' => getcwd() . '/xoopsCIconfigs.php',
5
-    'mainfile' => dirname(__DIR__) . '/htdocs/mainfile.php',
3
+    'autoloader' => dirname(__DIR__).'/xoops_lib/vendor/autoload.php',
4
+    'configfile' => getcwd().'/xoopsCIconfigs.php',
5
+    'mainfile' => dirname(__DIR__).'/htdocs/mainfile.php',
6 6
 );
7 7
 return new \XoopsConsole\Library\SimpleContainer($configs);
Please login to merge, or discard this patch.
console/console.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,15 +8,15 @@
 block discarded – undo
8 8
     die ('CLI use only');
9 9
 }
10 10
 
11
-spl_autoload_register(function ($class) {
11
+spl_autoload_register(function($class) {
12 12
     $prefix = 'XoopsConsole\\';
13
-    $base_dir = __DIR__ . '/';
13
+    $base_dir = __DIR__.'/';
14 14
     $len = strlen($prefix);
15 15
     if (strncmp($prefix, $class, $len) !== 0) {
16 16
         return;
17 17
     }
18 18
     $relative_class = substr($class, $len);
19
-    $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
19
+    $file = $base_dir.str_replace('\\', '/', $relative_class).'.php';
20 20
     if (file_exists($file)) {
21 21
         require $file;
22 22
     }
Please login to merge, or discard this patch.
console/Commands/TestCommand.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,15 +11,15 @@
 block discarded – undo
11 11
 class TestCommand extends Command {
12 12
     protected function configure() {
13 13
         $this->setName("test")
14
-             ->setDescription("Sample description for our command named test")
15
-             ->setDefinition(array(
14
+                ->setDescription("Sample description for our command named test")
15
+                ->setDefinition(array(
16 16
                 new InputOption('flag', 'f', InputOption::VALUE_NONE, 'Raise a flag'),
17 17
                 new InputArgument('name', InputArgument::OPTIONAL, 'A name', 'uhhh, ... Clem'),
18 18
             ))
19
-             ->setHelp(<<<EOT
19
+                ->setHelp(<<<EOT
20 20
 The <info>test</info> command just says hello.
21 21
 EOT
22
-             );
22
+                );
23 23
     }
24 24
 
25 25
     protected function execute(InputInterface $input, OutputInterface $output) {
Please login to merge, or discard this patch.
console/Commands/UninstallModuleCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
                 $output->writeln(strip_tags($message));
48 48
             }
49 49
         }
50
-        if ($result===false) {
50
+        if ($result === false) {
51 51
             $output->writeln(sprintf('<error>Uninstall of %s failed!</error>', $module));
52 52
         } else {
53 53
             $output->writeln(sprintf('<info>Uninstall of %s completed.</info>', $module));
Please login to merge, or discard this patch.
console/Commands/InstallModuleCommand.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
             ))->setHelp(<<<EOT
25 25
 The <info>install-module</info> command installs a module.
26 26
 EOT
27
-             );
27
+                );
28 28
     }
29 29
 
30 30
     /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
                 $output->writeln(strip_tags($message));
63 63
             }
64 64
         }
65
-        if ($result===false) {
65
+        if ($result === false) {
66 66
             $output->writeln(sprintf('<error>Install of %s failed!</error>', $module));
67 67
         } else {
68 68
             $output->writeln(sprintf('<info>Install of %s completed.</info>', $module));
Please login to merge, or discard this patch.
console/Commands/SetConfigCommand.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
             ))->setHelp(<<<EOT
27 27
 The <info>set-config</info> command sets a configuration item to the specified value.
28 28
 EOT
29
-             );
29
+                );
30 30
     }
31 31
 
32 32
     /**
Please login to merge, or discard this patch.