Completed
Pull Request — master (#314)
by Thomas
07:26
created
local/maintenance/email_recovery.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -16,25 +16,25 @@  discard block
 block discarded – undo
16 16
  *  Unicode Reminder メモ
17 17
  ***************************************************************************/
18 18
 
19
-$opt['rootpath'] = __DIR__ . '/../../htdocs/';
20
-require $opt['rootpath'] . 'lib2/cli.inc.php';
19
+$opt['rootpath'] = __DIR__.'/../../htdocs/';
20
+require $opt['rootpath'].'lib2/cli.inc.php';
21 21
 
22 22
 if ($argc < 3 || $argc > 4) {
23 23
     die(
24
-        "usage:    php email_recovery.php \"from-datetime\" \"to-datetime\" [option]\n" .
25
-        "\n" .
26
-        "          Datetimes must be in YYYY-MM-DD HH:MM:SS format and are inclusive.\n" .
27
-        "\n" .
28
-        "options:  <none>          show information about all lost information\n" .
29
-        "          watchlist       resend log notifications\n" .
30
-        "          newcaches       resend new caches notifications\n" .
24
+        "usage:    php email_recovery.php \"from-datetime\" \"to-datetime\" [option]\n".
25
+        "\n".
26
+        "          Datetimes must be in YYYY-MM-DD HH:MM:SS format and are inclusive.\n".
27
+        "\n".
28
+        "options:  <none>          show information about all lost information\n".
29
+        "          watchlist       resend log notifications\n".
30
+        "          newcaches       resend new caches notifications\n".
31 31
         "          registrations   resend activation codes\n"
32 32
     );
33 33
 }
34 34
 
35 35
 $er = new EmailRecovery($argv[1], $argv[2], $errormsg);
36 36
 if ($errormsg != '') {
37
-    die($errormsg . "\n");
37
+    die($errormsg."\n");
38 38
 }
39 39
 
40 40
 if ($argc < 4) {
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             $er->resendActivationCodes();
53 53
             break;
54 54
         default:
55
-            die('invalid option: '. $option . "\n");
55
+            die('invalid option: '.$option."\n");
56 56
     }
57 57
 }
58 58
 
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
     public function __construct($fromDT, $toDT, &$errormsg)
66 66
     {
67 67
         if (!self::verifyDateTime($fromDT)) {
68
-            $errormsg = 'invalid from-datetime (must be SQL format): "' . $fromDT . '"';
68
+            $errormsg = 'invalid from-datetime (must be SQL format): "'.$fromDT.'"';
69 69
         } elseif (!self::verifyDateTime($toDT)) {
70
-            $errormsg = 'invalid from-datetime (must be SQL format): "' . $toDT . '"';
70
+            $errormsg = 'invalid from-datetime (must be SQL format): "'.$toDT.'"';
71 71
         } else {
72 72
             $this->fromDateTime = $fromDT;
73 73
             $this->toDateTime = $toDT;
@@ -85,26 +85,26 @@  discard block
 block discarded – undo
85 85
 
86 86
     private static function message($level, $text)
87 87
     {
88
-        echo str_repeat(' ', 2 * $level) . $text . "\n";
88
+        echo str_repeat(' ', 2 * $level).$text."\n";
89 89
     }
90 90
 
91 91
     private function getDateCondition($table, $field)
92 92
     {
93 93
         return
94
-            "`" . $table . "`.`" . $field . "` >= '" . sql_escape($this->fromDateTime) . "'" .
95
-            " AND `" . $table . "`.`" . $field . "` <= '" . sql_escape($this->toDateTime) . "'";
94
+            "`".$table."`.`".$field."` >= '".sql_escape($this->fromDateTime)."'".
95
+            " AND `".$table."`.`".$field."` <= '".sql_escape($this->toDateTime)."'";
96 96
     }
97 97
 
98 98
     private function showObjectCount($table, $dateField, $description, $andWhere = '')
99 99
     {
100 100
         $objectCount = sql_value(
101 101
             "SELECT COUNT(*)
102
-             FROM `" . $table . "`
103
-             WHERE " . $this->getDateCondition($table, $dateField) .
104
-                       ($andWhere ? ' AND (' . $andWhere . ')' : ''),
102
+             FROM `" . $table."`
103
+             WHERE " . $this->getDateCondition($table, $dateField).
104
+                       ($andWhere ? ' AND ('.$andWhere.')' : ''),
105 105
             0
106 106
         );
107
-        self::message(1, $objectCount . ' ' . $description);
107
+        self::message(1, $objectCount.' '.$description);
108 108
     }
109 109
 
110 110
 
@@ -153,16 +153,16 @@  discard block
 block discarded – undo
153 153
              JOIN `user` `user1` ON `user1`.`user_id` = `cache_logs_archived`.`user_id`
154 154
              JOIN `user` `user2` ON `user2`.`user_id` = `cache_logs_archived`.`deleted_by`
155 155
              JOIN `caches` ON `caches`.`cache_id` = `cache_logs_archived`.`cache_id`
156
-             WHERE " . $this->getDateCondition('cache_logs_archived', 'deletion_date') . "
156
+             WHERE " . $this->getDateCondition('cache_logs_archived', 'deletion_date')."
157 157
              ORDER BY `cache_logs_archived`.`deletion_date` DESC"
158 158
         );
159 159
         while ($r = sql_fetch_assoc($rs)) {
160 160
             self::message(
161 161
                 2,
162 162
                 $r['wp_oc']
163
-                . ' logged:' . $r['logdate']
164
-                . ' logger:' . $r['logger_name']
165
-                . ' deleter:' . $r['deleter_name']
163
+                . ' logged:'.$r['logdate']
164
+                . ' logger:'.$r['logger_name']
165
+                . ' deleter:'.$r['deleter_name']
166 166
             );
167 167
         }
168 168
         sql_free_result($rs);
@@ -175,12 +175,12 @@  discard block
 block discarded – undo
175 175
                 `username`
176 176
              FROM `user`
177 177
              WHERE " .
178
-                $this->getDateCondition('user', 'date_created') . "
178
+                $this->getDateCondition('user', 'date_created')."
179 179
                 AND last_login IS NULL AND `activation_code` <> ''
180 180
              ORDER BY `date_created` DESC"
181 181
         );
182 182
         while ($r = sql_fetch_assoc($rs)) {
183
-            self::message(2, $r['registration_date'] . ' ' . $r['username']);
183
+            self::message(2, $r['registration_date'].' '.$r['username']);
184 184
         }
185 185
         sql_free_result($rs);
186 186
 
@@ -192,11 +192,11 @@  discard block
 block discarded – undo
192 192
                 `user`.`username` `sender_name`
193 193
              FROM `email_user`
194 194
              JOIN `user` ON `user`.`user_id` = `email_user`.`from_user_id`
195
-             WHERE " . $this->getDateCondition('email_user', 'date_created') . "
195
+             WHERE " . $this->getDateCondition('email_user', 'date_created')."
196 196
              ORDER BY `email_user`.`date_created` DESC"
197 197
         );
198 198
         while ($r = sql_fetch_assoc($rs)) {
199
-            self::message(2, $r['emaildate'] . ' from:' . $r['sender_name']);
199
+            self::message(2, $r['emaildate'].' from:'.$r['sender_name']);
200 200
         }
201 201
         sql_free_result($rs);
202 202
     }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
                 JOIN `cache_status` ON `cache_status`.`id` = `caches`.`status`
233 233
                 JOIN `cache_watches` ON `cache_watches`.`cache_id` = `caches`.`cache_id`
234 234
                 WHERE
235
-                    " . $this->getDateCondition('cache_logs', 'date_created') . "
235
+                    " . $this->getDateCondition('cache_logs', 'date_created')."
236 236
                     AND `cache_status`.`allow_user_view` = 1"
237 237
         );
238 238
         $watcher_notifications = sql_affected_rows();
@@ -247,13 +247,13 @@  discard block
 block discarded – undo
247 247
                 JOIN `cache_list_items` ON `cache_list_items`.`cache_id` = `cache_logs`.`cache_id`
248 248
                 JOIN `cache_list_watches` ON `cache_list_watches`.`cache_list_id` = `cache_list_items`.`cache_list_id`
249 249
                 WHERE
250
-                    " . $this->getDateCondition('cache_logs', 'date_created') . "
250
+                    " . $this->getDateCondition('cache_logs', 'date_created')."
251 251
                     AND `cache_status`.`allow_user_view` = 1"
252 252
         );
253 253
         $watcher_notifications += sql_affected_rows();
254 254
 
255
-        self::message(0, $owner_notifications . ' owners will be notified');
256
-        self::message(0, $watcher_notifications . ' watchers will be notified');
255
+        self::message(0, $owner_notifications.' owners will be notified');
256
+        self::message(0, $watcher_notifications.' watchers will be notified');
257 257
     }
258 258
 
259 259
     public function resendCacheNotifications()
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
              FROM `caches`
266 266
              JOIN `cache_status` ON `cache_status`.`id` = `caches`.`status`
267 267
              WHERE
268
-                " . $this->getDateCondition('caches', 'date_created') . "
268
+                " . $this->getDateCondition('caches', 'date_created')."
269 269
                 AND `cache_status`.`allow_user_view` = 1"
270 270
         );
271 271
         while ($r = sql_fetch_assoc($rs)) {
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 
281 281
         $new_notifications =
282 282
             sql_value("SELECT COUNT(*) FROM `notify_waiting`", 0) - $notifies_wating;
283
-        self::message(0, $new_notifications . ' new cache notifications will be sent');
283
+        self::message(0, $new_notifications.' new cache notifications will be sent');
284 284
     }
285 285
     
286 286
     public function resendActivationCodes()
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
             "SELECT `user_id`
290 290
              FROM `user`
291 291
              WHERE
292
-                " . $this->getDateCondition('user', 'date_created') . "
292
+                " . $this->getDateCondition('user', 'date_created')."
293 293
                 AND last_login IS NULL
294 294
                 AND `activation_code` <> ''"
295 295
         );
@@ -297,10 +297,10 @@  discard block
 block discarded – undo
297 297
         while ($r = sql_fetch_assoc($rs)) {
298 298
             $user = new user($r['user_id']);
299 299
             $user->sendRegistrationCode();
300
-            ++ $n;
300
+            ++$n;
301 301
         }
302 302
         sql_free_result($rs);
303
-        self::message(0, $n . ' users have been re-sent the activation code');
303
+        self::message(0, $n.' users have been re-sent the activation code');
304 304
     }
305 305
     
306 306
 }
Please login to merge, or discard this patch.
local/maintenance/init_user_languages.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@  discard block
 block discarded – undo
8 8
  *  Unicode Reminder メモ
9 9
  ***************************************************************************/
10 10
 
11
-$opt['rootpath'] = __DIR__ . '/../../htdocs/';
12
-require_once $opt['rootpath'] . 'lib2/cli.inc.php';
13
-require_once $opt['rootpath'] . 'lib2/logic/user.class.php';
11
+$opt['rootpath'] = __DIR__.'/../../htdocs/';
12
+require_once $opt['rootpath'].'lib2/cli.inc.php';
13
+require_once $opt['rootpath'].'lib2/logic/user.class.php';
14 14
 
15 15
 $write = ($argc == 2 && $argv[1] = 'write');
16 16
 if (!$write) {
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
                 $lang
32 32
             );
33 33
         }
34
-        ++ $set;
34
+        ++$set;
35 35
     }
36
-    if (++ $processed % 1000 == 0) {
37
-        echo "$set of $processed " . ($write ? '' : 'would be ') . "set\n";
36
+    if (++$processed % 1000 == 0) {
37
+        echo "$set of $processed ".($write ? '' : 'would be ')."set\n";
38 38
     }
39 39
 }
40
-echo "$set of $processed " . ($write ? '' : 'would be ') . "set\n";
40
+echo "$set of $processed ".($write ? '' : 'would be ')."set\n";
41 41
 sql_free_result($rs);
Please login to merge, or discard this patch.
local/maintenance/cleanup_coordinates.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
  *  Unicode Reminder メモ
13 13
  ***************************************************************************/
14 14
 
15
-$opt['rootpath'] = __DIR__ . '/../../htdocs/';
16
-require $opt['rootpath'] . 'lib2/cli.inc.php';
15
+$opt['rootpath'] = __DIR__.'/../../htdocs/';
16
+require $opt['rootpath'].'lib2/cli.inc.php';
17 17
 
18 18
 $rs = sql(
19 19
     "SELECT `id`, `cache_id`, `latitude`, `longitude`
@@ -41,14 +41,14 @@  discard block
 block discarded – undo
41 41
 
42 42
 if ($duplicates) {
43 43
     if ($argc == 2 && $argv[1] == 'go') {
44
-        echo 'deleting ' . count($duplicates) . " duplicate coordinate records\n";
44
+        echo 'deleting '.count($duplicates)." duplicate coordinate records\n";
45 45
         sql(
46 46
             "DELETE FROM `cache_coordinates`
47
-             WHERE `id` IN (" . implode(',', $duplicates) . ")"
47
+             WHERE `id` IN (" . implode(',', $duplicates).")"
48 48
         );
49 49
     } else {
50 50
         echo
51
-            count($duplicates) . ' duplicate coordinates found. ' .
51
+            count($duplicates).' duplicate coordinates found. '.
52 52
             "Add parameter 'go' to delete them.\n";
53 53
     }
54 54
 } else {
Please login to merge, or discard this patch.
local/mailing/email-addresslist.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
 
8 8
 header('Content-type: text/html; charset=utf-8');
9 9
 
10
-$opt['rootpath'] = __DIR__ . '/../../htdocs/';
11
-require $opt['rootpath'] . 'lib2/web.inc.php';
10
+$opt['rootpath'] = __DIR__.'/../../htdocs/';
11
+require $opt['rootpath'].'lib2/web.inc.php';
12 12
 
13 13
 $rs = sql(
14 14
     'SELECT email FROM `user`
@@ -18,6 +18,6 @@  discard block
 block discarded – undo
18 18
      ORDER BY user_id DESC'
19 19
 );
20 20
 while ($r = sql_fetch_assoc($rs)) {
21
-    echo $r['email'] . "\n";
21
+    echo $r['email']."\n";
22 22
 }
23 23
 sql_free_result($rs);
Please login to merge, or discard this patch.
local/mailing/mailing.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 $total = count($sendto);
34 34
 $n = 0;
35
-echo 'sending email to ' . $total . ' of ' . count($addresses) . " recipients\n\n";
35
+echo 'sending email to '.$total.' of '.count($addresses)." recipients\n\n";
36 36
 
37 37
 $subject = '....';
38 38
 $from_adr = '[email protected]';
@@ -41,18 +41,18 @@  discard block
 block discarded – undo
41 41
 
42 42
 foreach ($sendto as $receiver) {
43 43
     $receiver = trim($receiver);
44
-    echo ++ $n . "/$total: $receiver";
44
+    echo ++$n."/$total: $receiver";
45 45
     mail(
46 46
         $receiver,
47 47
         $subject,
48 48
         $message,
49
-        "From: $from_adr\r\n" .
50
-        "MIME-Version: 1.0\r\n" .
51
-        "Content-Type: text/plain; charset=iso-8859-1\r\n" .
49
+        "From: $from_adr\r\n".
50
+        "MIME-Version: 1.0\r\n".
51
+        "Content-Type: text/plain; charset=iso-8859-1\r\n".
52 52
         'Content-Transfer-Encoding: 8bit'
53 53
     );
54 54
     echo "\n";
55 55
     file_put_contents('sent.txt', "$receiver\n", FILE_APPEND);
56 56
 }
57 57
 
58
-echo 'Time needed: ' . (microtime(true) - $starttime) . "s\n";
58
+echo 'Time needed: '.(microtime(true) - $starttime)."s\n";
Please login to merge, or discard this patch.
local/devel/okapi-update.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -9,12 +9,12 @@  discard block
 block discarded – undo
9 9
  *  Unicode Reminder メモ
10 10
  ***************************************************************************/
11 11
 
12
-$opt['rootpath'] = __DIR__ . '/../../htdocs/';
13
-require_once $opt['rootpath'] . 'okapi-update-settings.inc.php';
12
+$opt['rootpath'] = __DIR__.'/../../htdocs/';
13
+require_once $opt['rootpath'].'okapi-update-settings.inc.php';
14 14
 
15 15
 function git($args)
16 16
 {
17
-    return exec('git ' . $args);
17
+    return exec('git '.$args);
18 18
 }
19 19
 
20 20
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 }
40 40
 $changes = git('log upstream/master..master');
41 41
 if ($changes) {
42
-    die("[okapi-update] there are unpushed local commits:\n" . $changes);
42
+    die("[okapi-update] there are unpushed local commits:\n".$changes);
43 43
 }
44 44
 
45 45
 echo "[okapi-update] ok.\n";
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 // fetch current OKAPI revision
49 49
 
50 50
 echo "[okapi-update] pulling and replicating OKAPI master\n";
51
-echo git('pull ' . OKAPI_REMOTE . ' master') . "\n";
51
+echo git('pull '.OKAPI_REMOTE.' master')."\n";
52 52
 $okapi_version_number = git('rev-list HEAD --count') + 318;
53 53
 $okapi_git_revision = git('rev-parse HEAD');
54 54
 echo "OKAPI ver. $okapi_version_number\n";
@@ -59,26 +59,26 @@  discard block
 block discarded – undo
59 59
 passthru(
60 60
     str_replace(
61 61
         '%source',
62
-        OKAPI_SOURCE_PATH . '/okapi',
63
-        str_replace('%dest', $opt['rootpath'] . 'okapi', DIRECTORY_TREE_REPLICATOR)
62
+        OKAPI_SOURCE_PATH.'/okapi',
63
+        str_replace('%dest', $opt['rootpath'].'okapi', DIRECTORY_TREE_REPLICATOR)
64 64
     )
65 65
 );
66
-$core = file_get_contents($opt['rootpath'] . 'okapi/core.php');
66
+$core = file_get_contents($opt['rootpath'].'okapi/core.php');
67 67
 $core = str_replace(
68 68
     "\$version_number = null",
69
-    "\$version_number = " . $okapi_version_number,
69
+    "\$version_number = ".$okapi_version_number,
70 70
     str_replace(
71 71
         "\$git_revision = null",
72
-        "\$git_revision = '" . $okapi_git_revision . "'",
72
+        "\$git_revision = '".$okapi_git_revision."'",
73 73
         $core
74 74
     )
75 75
 );
76
-file_put_contents($opt['rootpath'] . 'okapi/core.php', $core);
76
+file_put_contents($opt['rootpath'].'okapi/core.php', $core);
77 77
 chdir($opt['rootpath']);
78 78
 passthru('git status');
79 79
 
80 80
 // commit changes to OC code
81 81
 
82 82
 echo "[okapi-update] committing to local OC Git repo\n";
83
-echo git('add .') . "\n";
84
-echo git('commit -m "OKAPI r' . $okapi_version_number . '"') . "\n";
83
+echo git('add .')."\n";
84
+echo git('commit -m "OKAPI r'.$okapi_version_number.'"')."\n";
Please login to merge, or discard this patch.
local/devel/find_unicode_boms.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  *  Searches for Unicode byte order marks in code and template files
8 8
  ***************************************************************************/
9 9
 
10
-chdir(__DIR__ . '/../../htdocs');
10
+chdir(__DIR__.'/../../htdocs');
11 11
 require_once 'lib2/cli.inc.php';
12 12
 
13 13
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     $hDir = opendir($dir);
26 26
     if ($hDir !== false) {
27 27
         while (($file = readdir($hDir)) !== false) {
28
-            $path = $dir . '/' . $file;
28
+            $path = $dir.'/'.$file;
29 29
             if (is_dir($path) && substr($file, 0, 1) !== '.' && $subdirs) {
30 30
                 scan($path, $subdirs);
31 31
             } else {
Please login to merge, or discard this patch.
local/devel/style-cleanup.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
     'htdocs/vendor',
35 35
 );
36 36
 
37
-chdir(__DIR__ . '/../..');
37
+chdir(__DIR__.'/../..');
38 38
 
39 39
 $cleanup = new StyleCleanup();
40 40
 $cleanup->run('.', $exclude);
41 41
 
42 42
 echo
43
-    $cleanup->getLinesModified() . ' lines in ' . $cleanup->getFilesModified() . ' files'
43
+    $cleanup->getLinesModified().' lines in '.$cleanup->getFilesModified().' files'
44 44
     . " have been cleaned up\n";
45 45
 
46 46
 
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
             # process files in $path
81 81
 
82 82
             $files = array_merge(
83
-                glob($path . '/*.php'),
84
-                glob($path . '/*.tpl')
83
+                glob($path.'/*.php'),
84
+                glob($path.'/*.tpl')
85 85
             );
86 86
 
87 87
             foreach ($files as $filepath) {
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
                 if (count($lines) && preg_match('/^(.+?)\<\?/', $lines[0], $matches)) {
95 95
                     self::warn(
96
-                        'invalid character(s) "' . $matches[1] . '" at start of ' . $display_filepath
96
+                        'invalid character(s) "'.$matches[1].'" at start of '.$display_filepath
97 97
                     );
98 98
                 }
99 99
 
@@ -108,19 +108,19 @@  discard block
 block discarded – undo
108 108
                         && !preg_match("/^ *(\\*|\/\/|#) *\n$/", $line)) {
109 109
 
110 110
                         $old_line = $line;
111
-                        $line = rtrim($line);   # trims " \t\n\r\0\x0B"
111
+                        $line = rtrim($line); # trims " \t\n\r\0\x0B"
112 112
                         $line = $this->expandTabs($line);
113 113
                         $line .= "\n";
114 114
 
115 115
                         if ($line != $old_line) {
116 116
                             $file_modified = true;
117
-                            ++ $this->lines_modified;
117
+                            ++$this->lines_modified;
118 118
                         }
119 119
                     }
120 120
                     if (preg_match('/\<\?\s/', $line)) {   # relies on \n at EOL
121
-                        self::warn('short open tag in line ' . $n . ' of ' . $display_filepath);
121
+                        self::warn('short open tag in line '.$n.' of '.$display_filepath);
122 122
                     }
123
-                    ++ $n;
123
+                    ++$n;
124 124
                 }
125 125
 
126 126
                 # remove PHP close tags and empty lines from end of file
@@ -131,23 +131,23 @@  discard block
 block discarded – undo
131 131
                     if ($trimmed_line == '?>' || $trimmed_line == '') {
132 132
                         unset($lines[$l]);
133 133
                         $file_modified = true;
134
-                        ++ $this->lines_modified;
134
+                        ++$this->lines_modified;
135 135
                     } else {
136 136
                         break;
137 137
                     }
138
-                    -- $l;
138
+                    --$l;
139 139
                 }
140 140
 
141 141
                 if ($file_modified) {
142
-                    echo 'cleaned ' . substr($filepath, 2) . "\n";
142
+                    echo 'cleaned '.substr($filepath, 2)."\n";
143 143
                     file_put_contents($filepath, implode('', $lines));
144
-                    ++ $this->files_modified;
144
+                    ++$this->files_modified;
145 145
                 }
146 146
             }
147 147
 
148 148
             # process subdirectories in $path
149 149
 
150
-            $dirs = glob($path . '/*', GLOB_ONLYDIR);
150
+            $dirs = glob($path.'/*', GLOB_ONLYDIR);
151 151
             foreach ($dirs as $dir) {
152 152
                 if ($dir != '.' && $dir != '..') {
153 153
                     $this->cleanup($dir);
@@ -170,6 +170,6 @@  discard block
 block discarded – undo
170 170
 
171 171
     private static function warn($msg)
172 172
     {
173
-        echo '! ' . $msg . "\n";
173
+        echo '! '.$msg."\n";
174 174
     }
175 175
 }
Please login to merge, or discard this patch.
local/devel/find_bad_encodings.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  *  Searches for files which are no longer Unicode-encoded
8 8
  ***************************************************************************/
9 9
 
10
-chdir(__DIR__ . '/../../htdocs');
10
+chdir(__DIR__.'/../../htdocs');
11 11
 require_once 'lib2/cli.inc.php';
12 12
 
13 13
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     $hDir = opendir($dir);
26 26
     if ($hDir !== false) {
27 27
         while (($file = readdir($hDir)) !== false) {
28
-            $path = $dir . '/' . $file;
28
+            $path = $dir.'/'.$file;
29 29
             if (is_dir($path) && substr($file, 0, 1) !== '.' && $subdirs) {
30 30
                 scan($path, $subdirs);
31 31
             } else {
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
 function test_encoding($path)
43 43
 {
44
-    static $ur_exclude = [  // no unicode reminder needed
44
+    static $ur_exclude = [// no unicode reminder needed
45 45
         'lang/de/ocstyle/search1/search.result.caches',
46 46
         'lib2/b2evo-captcha',
47 47
         'lib2/HTMLPurifier',
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         if (mb_trim(mb_substr($contents, $ur + 17, 2)) != "メモ") {
58 58
             $ur = mb_stripos($contents, "Unicode Reminder");
59 59
             if (mb_trim(mb_substr($contents, $ur + 17, 2)) != "メモ") {
60
-                echo "Bad Unicode Reminder found in $path: " . mb_trim(mb_substr($contents, $ur + 17, 2)) . "\n";
60
+                echo "Bad Unicode Reminder found in $path: ".mb_trim(mb_substr($contents, $ur + 17, 2))."\n";
61 61
             } else {
62 62
                 echo "Unexpected non-ASCII chars (BOMs?) in header of $path\n";
63 63
             }
Please login to merge, or discard this patch.