Skip to content

Commit 39e6c3b

Browse files
committed
run fixer
1 parent 3b2d581 commit 39e6c3b

File tree

279 files changed

+4681
-4681
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

279 files changed

+4681
-4681
lines changed

bin/cleandb.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ if (!empty($_SERVER['argv'][1])) {
2828
$days = 7;
2929
}
3030

31-
rcmail_utils::db_clean($days);
31+
\rcmail_utils::db_clean($days);

bin/decrypt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ if ($argc < 2) {
5959
exit('Usage: ' . basename($argv[0]) . " encrypted-hdr-part [encrypted-hdr-part ...]\n");
6060
}
6161

62-
$RCMAIL = rcube::get_instance();
62+
$RCMAIL = \rcube::get_instance();
6363

6464
for ($i = 1; $i < $argc; $i++) {
6565
printf("%s\n", $RCMAIL->decrypt($argv[$i]));

bin/deluser.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ function _die($msg, $usage = false)
4141
exit(1);
4242
}
4343

44-
$rcmail = rcube::get_instance();
44+
$rcmail = \rcube::get_instance();
4545

4646
// get arguments
47-
$args = rcube_utils::get_opt(['h' => 'host', 'a' => 'age', 'd' => 'dry-run:bool']);
47+
$args = \rcube_utils::get_opt(['h' => 'host', 'a' => 'age', 'd' => 'dry-run:bool']);
4848

4949
if (!empty($args['age']) && ($age = intval($args['age']))) {
5050
$db = $rcmail->get_dbh();
@@ -66,7 +66,7 @@ if (!empty($args['age']) && ($age = intval($args['age']))) {
6666
exit(0);
6767
}
6868

69-
$hostname = rcmail_utils::get_host($args);
69+
$hostname = \rcmail_utils::get_host($args);
7070
$username = isset($args[0]) ? trim($args[0]) : null;
7171

7272
if (empty($username)) {
@@ -83,7 +83,7 @@ if (!$db->is_connected() || $db->is_error()) {
8383
}
8484

8585
// find user in local database
86-
$user = rcube_user::query($username, $hostname);
86+
$user = \rcube_user::query($username, $hostname);
8787

8888
if (!$user) {
8989
exit("User not found.\n");

bin/gc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/');
2222

2323
require INSTALL_PATH . 'program/include/clisetup.php';
2424

25-
$rcmail = rcube::get_instance();
25+
$rcmail = \rcube::get_instance();
2626

2727
$session_driver = $rcmail->config->get('session_storage', 'db');
2828
$session_lifetime = $rcmail->config->get('session_lifetime', 0) * 60 * 2;

bin/identity.sh

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/');
2222

2323
require INSTALL_PATH . 'program/include/clisetup.php';
2424

25-
$options = rcube_utils::get_opt([
25+
$options = \rcube_utils::get_opt([
2626
'u' => 'username',
2727
'e' => 'email',
2828
'n' => 'name',
@@ -80,15 +80,15 @@ function get_identity_attr($options)
8080
$identity = $user->get_identity($identity_id);
8181

8282
if (empty($identity)) {
83-
rcube::raise_error('Invalid identity ID.', false, true);
83+
\rcube::raise_error('Invalid identity ID.', false, true);
8484
}
8585

8686
if (isset($identity[$attribute])) {
8787
$attrValue = $identity[$attribute];
8888

8989
echo "{$attrValue}\n";
9090
} else {
91-
rcube::raise_error('Invalid attribute name. Available attributes: identity_id, user_id, changed, del, standard, name, '
91+
\rcube::raise_error('Invalid attribute name. Available attributes: identity_id, user_id, changed, del, standard, name, '
9292
. 'organization, email, reply-to, bcc, signature, html_signature.', false, true);
9393
}
9494
}
@@ -114,7 +114,7 @@ function delete_identity($options)
114114
$identities_level = get_identities_level();
115115

116116
if ($identities_level > 1) {
117-
rcube::raise_error("Identities level doesn't allow this action.", false, true);
117+
\rcube::raise_error("Identities level doesn't allow this action.", false, true);
118118
}
119119

120120
if (count($options) === 1) {
@@ -133,7 +133,7 @@ function delete_identity($options)
133133
$identity = $user->delete_identity($identity_id);
134134

135135
if (!$identity) {
136-
rcube::raise_error('Invalid identity ID.');
136+
\rcube::raise_error('Invalid identity ID.');
137137
exit;
138138
}
139139

@@ -145,7 +145,7 @@ function add_identity($options)
145145
$identities_level = get_identities_level();
146146

147147
if ($identities_level > 1) {
148-
rcube::raise_error("Identities level doesn't allow this action.", false, true);
148+
\rcube::raise_error("Identities level doesn't allow this action.", false, true);
149149
}
150150

151151
if (count($options) === 1) {
@@ -207,7 +207,7 @@ function update_identity($options)
207207
$identities_level = get_identities_level();
208208

209209
if ($identities_level > 1) {
210-
rcube::raise_error("Identities level doesn't allow this action.", false, true);
210+
\rcube::raise_error("Identities level doesn't allow this action.", false, true);
211211
}
212212

213213
if (count($options) === 1) {
@@ -260,7 +260,7 @@ function update_identity($options)
260260

261261
if ($email !== null) {
262262
if ($identities_level > 0) {
263-
rcube::raise_error("Identities level doesn't allow setting email.", false, true);
263+
\rcube::raise_error("Identities level doesn't allow setting email.", false, true);
264264
}
265265

266266
$updated_identity['email'] = $email;
@@ -279,15 +279,15 @@ function update_identity($options)
279279
}
280280

281281
if (count($updated_identity) === 0) {
282-
rcube::raise_error('No attributes changed. Set some new values.', false, true);
282+
\rcube::raise_error('No attributes changed. Set some new values.', false, true);
283283
}
284284

285285
$user = get_user($options);
286286

287287
$identity = $user->update_identity($identity_id, $updated_identity);
288288

289289
if (!$identity) {
290-
rcube::raise_error('Identity not updated. Either the identity id is incorrect or provided values are invalid.', false, true);
290+
\rcube::raise_error('Identity not updated. Either the identity id is incorrect or provided values are invalid.', false, true);
291291
}
292292

293293
if ($setAsDefault) {
@@ -314,7 +314,7 @@ function get_option_value($options, $key, $fallback, $isBoolean, $isMandatory, $
314314
}
315315

316316
if ($isMandatory) {
317-
rcube::raise_error($message, false, true);
317+
\rcube::raise_error($message, false, true);
318318
}
319319

320320
return $fallback;
@@ -323,14 +323,14 @@ function get_option_value($options, $key, $fallback, $isBoolean, $isMandatory, $
323323
function validate_email($email, $fieldName)
324324
{
325325
if (!filter_var($email, \FILTER_VALIDATE_EMAIL)) {
326-
rcube::raise_error("invalid {$fieldName} format", false, true);
326+
\rcube::raise_error("invalid {$fieldName} format", false, true);
327327
}
328328
}
329329

330330
function validate_boolean($value, $fieldName)
331331
{
332332
if (!is_bool($value) && $value !== '0' && $value !== '1') {
333-
rcube::raise_error("{$fieldName} can either be set to 1 (true), 0 (false) or without a value (true)", false, true);
333+
\rcube::raise_error("{$fieldName} can either be set to 1 (true), 0 (false) or without a value (true)", false, true);
334334
}
335335
}
336336

@@ -363,26 +363,26 @@ function echo_shared_options()
363363

364364
function get_user($options)
365365
{
366-
$rcmail = rcube::get_instance();
366+
$rcmail = \rcube::get_instance();
367367

368368
$db = $rcmail->get_dbh();
369369

370370
$username = get_option_value($options, 'username', '', false, true, 'Enter the username e.g. -u user@example.com');
371-
$host = rcmail_utils::get_host($options);
371+
$host = \rcmail_utils::get_host($options);
372372

373373
// find user in local database
374-
$user = rcube_user::query($username, $host);
374+
$user = \rcube_user::query($username, $host);
375375

376376
if (empty($user)) {
377-
rcube::raise_error("User does not exist: {$username}", false, true);
377+
\rcube::raise_error("User does not exist: {$username}", false, true);
378378
}
379379

380380
return $user;
381381
}
382382

383383
function get_identities_level()
384384
{
385-
$rcmail = rcube::get_instance();
385+
$rcmail = \rcube::get_instance();
386386
$identities_level = intval($rcmail->config->get('identities_level', 0));
387387

388388
return $identities_level;

bin/indexcontacts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/');
2424
require_once INSTALL_PATH . 'program/include/clisetup.php';
2525
ini_set('memory_limit', -1);
2626

27-
rcmail_utils::indexcontacts();
27+
\rcmail_utils::indexcontacts();

bin/initdb.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,25 @@ define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/');
2424
require_once INSTALL_PATH . 'program/include/clisetup.php';
2525

2626
// get arguments
27-
$opts = rcube_utils::get_opt([
27+
$opts = \rcube_utils::get_opt([
2828
'd' => 'dir',
2929
'u' => 'update',
3030
]);
3131

3232
if (empty($opts['dir'])) {
33-
rcube::raise_error('Database schema directory not specified (--dir).', false, true);
33+
\rcube::raise_error('Database schema directory not specified (--dir).', false, true);
3434
}
3535

3636
// Check if directory exists
3737
if (!file_exists($opts['dir'])) {
38-
rcube::raise_error("Specified database schema directory doesn't exist.", false, true);
38+
\rcube::raise_error("Specified database schema directory doesn't exist.", false, true);
3939
}
4040

41-
$db = rcmail_utils::db();
41+
$db = \rcmail_utils::db();
4242

4343
if (!empty($opts['update']) && in_array($db->table_name('system'), (array) $db->list_tables())) {
4444
echo 'Checking for database schema updates...' . \PHP_EOL;
45-
rcmail_utils::db_update($opts['dir'], 'roundcube', null, ['errors' => true]);
45+
\rcmail_utils::db_update($opts['dir'], 'roundcube', null, ['errors' => true]);
4646
} else {
47-
rcmail_utils::db_init($opts['dir']);
47+
\rcmail_utils::db_init($opts['dir']);
4848
}

bin/install-jsdeps.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/');
2424
require_once INSTALL_PATH . 'program/include/clisetup.php';
2525

2626
if (!function_exists('exec')) {
27-
rcube::raise_error('PHP exec() function is required. Check disable_functions in php.ini.', false, true);
27+
\rcube::raise_error('PHP exec() function is required. Check disable_functions in php.ini.', false, true);
2828
}
2929

3030
$cfgfile = INSTALL_PATH . 'jsdeps.json';
3131
$SOURCES = json_decode(file_get_contents($cfgfile), true);
3232

3333
if (empty($SOURCES['dependencies'])) {
34-
rcube::raise_error("Failed to read dependencies list from {$cfgfile}", false, true);
34+
\rcube::raise_error("Failed to read dependencies list from {$cfgfile}", false, true);
3535
}
3636

3737
$CURL = trim(shell_exec('which curl'));
@@ -111,7 +111,7 @@ function fetch_from_source($package, $useCache = true, &$filetype = null)
111111

112112
if (!is_readable($cache_file) || !$useCache) {
113113
if (empty($CURL) && empty($WGET)) {
114-
rcube::raise_error("Required 'wget' or 'curl' program not found.", false, true);
114+
\rcube::raise_error("Required 'wget' or 'curl' program not found.", false, true);
115115
}
116116

117117
$url = str_replace('$v', $package['version'], $package['url']);
@@ -129,7 +129,7 @@ function fetch_from_source($package, $useCache = true, &$filetype = null)
129129
$url = str_replace('$v', $package['version'], $package['api_url']);
130130
$header = 'Accept:application/vnd.github.v3.raw';
131131

132-
rcube::raise_error("Fetching failed. Using Github API on {$url}");
132+
\rcube::raise_error("Fetching failed. Using Github API on {$url}");
133133

134134
if ($CURL) {
135135
exec(sprintf('%s -L -H %s -s %s -o %s', $CURL, escapeshellarg($header), escapeshellarg($url), $cache_file), $out, $retval);
@@ -139,7 +139,7 @@ function fetch_from_source($package, $useCache = true, &$filetype = null)
139139
}
140140

141141
if ($retval !== 0) {
142-
rcube::raise_error("Failed to download source file from {$url}", false, true);
142+
\rcube::raise_error("Failed to download source file from {$url}", false, true);
143143
}
144144
}
145145

@@ -201,7 +201,7 @@ function compose_destfile($package, $srcfile)
201201
if (file_put_contents(INSTALL_PATH . $package['dest'], $header . file_get_contents($srcfile))) {
202202
echo 'Wrote file ' . INSTALL_PATH . $package['dest'] . "\n";
203203
} else {
204-
rcube::raise_error('Failed to write destination file ' . INSTALL_PATH . $package['dest'], false, true);
204+
\rcube::raise_error('Failed to write destination file ' . INSTALL_PATH . $package['dest'], false, true);
205205
}
206206
}
207207

@@ -218,7 +218,7 @@ function extract_zipfile($package, $srcfile)
218218
}
219219

220220
if (!is_writable($destdir)) {
221-
rcube::raise_error("Cannot write to destination directory: {$destdir}", false, true);
221+
\rcube::raise_error("Cannot write to destination directory: {$destdir}", false, true);
222222
}
223223

224224
if (!empty($package['map'])) {
@@ -229,7 +229,7 @@ function extract_zipfile($package, $srcfile)
229229
}
230230

231231
// pick files from the zip archive
232-
rcmail_install::unzip($srcfile, $extract ?? $destdir, $package['pick'] ?? [], !empty($package['flat']));
232+
\rcmail_install::unzip($srcfile, $extract ?? $destdir, $package['pick'] ?? [], !empty($package['flat']));
233233

234234
// map source to dest files/directories
235235
if (!empty($package['map'])) {
@@ -258,7 +258,7 @@ function extract_zipfile($package, $srcfile)
258258

259259
exec(sprintf('mv -f %s %s', $src_file, $dest_file), $out, $retval);
260260
if ($retval !== 0) {
261-
rcube::raise_error("Failed to move {$src} into {$dest_file}; " . implode('; ', $out));
261+
\rcube::raise_error("Failed to move {$src} into {$dest_file}; " . implode('; ', $out));
262262
}
263263
// Remove sourceMappingURL
264264
elseif (isset($package['sourcemap']) && $package['sourcemap'] === false) {
@@ -311,7 +311,7 @@ function delete_destfile($package)
311311

312312
// ////////////// Execution
313313

314-
$args = rcube_utils::get_opt([
314+
$args = \rcube_utils::get_opt([
315315
'f' => 'force:bool',
316316
'd' => 'delete:bool',
317317
'g' => 'get:bool',
@@ -351,7 +351,7 @@ foreach ($SOURCES['dependencies'] as $package) {
351351
}
352352

353353
if (!empty($package['sha1']) && ($sum = sha1_file($srcfile)) !== $package['sha1']) {
354-
rcube::raise_error("Incorrect sha1 sum of {$srcfile}. Expected: {$package['sha1']}, got: {$sum}", false, true);
354+
\rcube::raise_error("Incorrect sha1 sum of {$srcfile}. Expected: {$package['sha1']}, got: {$sum}", false, true);
355355
}
356356

357357
if ($args['extract']) {

bin/installto.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,26 @@ define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/');
2424
require_once INSTALL_PATH . 'program/include/clisetup.php';
2525

2626
if (!function_exists('system')) {
27-
rcube::raise_error('PHP system() function is required. Check disable_functions in php.ini.', false, true);
27+
\rcube::raise_error('PHP system() function is required. Check disable_functions in php.ini.', false, true);
2828
}
2929

3030
$target_dir = unslashify(end($_SERVER['argv']));
3131
$accept = in_array('-y', $_SERVER['argv']) ? 'y' : null;
3232

3333
if (empty($target_dir) || !is_dir(realpath($target_dir))) {
34-
rcube::raise_error("Invalid target: not a directory\nUsage: installto.sh [-y] <TARGET>", false, true);
34+
\rcube::raise_error("Invalid target: not a directory\nUsage: installto.sh [-y] <TARGET>", false, true);
3535
}
3636

3737
// read version from iniset.php
3838
$iniset = @file_get_contents($target_dir . '/program/include/iniset.php');
3939
if (!preg_match('/define\(.RCMAIL_VERSION.,\s*.([0-9.]+[a-z0-9-]*)/', $iniset, $m)) {
40-
rcube::raise_error("No valid Roundcube installation found at {$target_dir}", false, true);
40+
\rcube::raise_error("No valid Roundcube installation found at {$target_dir}", false, true);
4141
}
4242

4343
$oldversion = $m[1];
4444

4545
if (version_compare(version_parse($oldversion), version_parse(RCMAIL_VERSION), '>')) {
46-
rcube::raise_error("Target installation already in version {$oldversion}.", false, true);
46+
\rcube::raise_error("Target installation already in version {$oldversion}.", false, true);
4747
}
4848

4949
if (version_compare(version_parse($oldversion), version_parse(RCMAIL_VERSION), '==')) {
@@ -60,7 +60,7 @@ if (strtolower($input) == 'y') {
6060
$adds = [];
6161
$dirs = ['bin', 'SQL', 'plugins', 'skins', 'program', 'public_html'];
6262

63-
if (is_dir(INSTALL_PATH . 'vendor') && (!is_file("{$target_dir}/composer.json") || rcmail_install::vendor_dir_untouched($target_dir))) {
63+
if (is_dir(INSTALL_PATH . 'vendor') && (!is_file("{$target_dir}/composer.json") || \rcmail_install::vendor_dir_untouched($target_dir))) {
6464
$dirs[] = 'vendor';
6565
}
6666
if (file_exists("{$target_dir}/installer")) {
@@ -73,7 +73,7 @@ if (strtolower($input) == 'y') {
7373
$command = 'rsync -aC --out-format=%n ' . $delete . INSTALL_PATH . "{$dir}/ {$target_dir}/{$dir}/";
7474

7575
if (system($command, $ret) === false || $ret > 0) {
76-
rcube::raise_error("Failed to execute command: {$command}", false, true);
76+
\rcube::raise_error("Failed to execute command: {$command}", false, true);
7777
}
7878
}
7979

@@ -82,7 +82,7 @@ if (strtolower($input) == 'y') {
8282
$command = 'rsync -a --out-format=%n ' . INSTALL_PATH . "{$source_file} {$target_dir}/{$file}";
8383

8484
if (file_exists(INSTALL_PATH . $file) && (system($command, $ret) === false || $ret > 0)) {
85-
rcube::raise_error("Failed to execute command: {$command}", false, true);
85+
\rcube::raise_error("Failed to execute command: {$command}", false, true);
8686
}
8787
}
8888

0 commit comments

Comments
 (0)