1 | <?php |
||||||||||||||
2 | |||||||||||||||
3 | /** |
||||||||||||||
4 | * This is an internal development file. It should NOT be included in |
||||||||||||||
5 | * any SMF distribution packages. |
||||||||||||||
6 | * |
||||||||||||||
7 | * This file exists to make it easy for developers to update the |
||||||||||||||
8 | * Unicode data in $sourcedir/Unicode whenever a new version of the |
||||||||||||||
9 | * Unicode Character Database is released. Just run this file from the |
||||||||||||||
10 | * command line in order to perform the update. |
||||||||||||||
11 | * |
||||||||||||||
12 | * Note: |
||||||||||||||
13 | * |
||||||||||||||
14 | * 1. Any updates to the Unicode data files SHOULD be included in the |
||||||||||||||
15 | * install and large upgrade packages. |
||||||||||||||
16 | * |
||||||||||||||
17 | * 2. Any updates to the Unicode data files SHOULD NOT be included in |
||||||||||||||
18 | * the patch packages. The Update_Unicode background task will take |
||||||||||||||
19 | * care of that on existing forums. |
||||||||||||||
20 | * |
||||||||||||||
21 | * |
||||||||||||||
22 | * Simple Machines Forum (SMF) |
||||||||||||||
23 | * |
||||||||||||||
24 | * @package SMF |
||||||||||||||
25 | * @author Simple Machines https://www.simplemachines.org |
||||||||||||||
26 | * @copyright 2025 Simple Machines and individual contributors |
||||||||||||||
27 | * @license https://www.simplemachines.org/about/smf/license.php BSD |
||||||||||||||
28 | * |
||||||||||||||
29 | * @version 2.1.6 |
||||||||||||||
30 | */ |
||||||||||||||
31 | |||||||||||||||
32 | // 1. Set a couple of variables that we'll need. |
||||||||||||||
33 | $boarddir = realpath(dirname(__DIR__)); |
||||||||||||||
34 | $sourcedir = $boarddir . '/Sources'; |
||||||||||||||
35 | |||||||||||||||
36 | // 2. Borrow a bit of stuff from cron.php. |
||||||||||||||
37 | $cron_php_start = file_get_contents($boarddir . '/cron.php', false, null, 0, 4096); |
||||||||||||||
38 | |||||||||||||||
39 | foreach (array('SMF', 'SMF_VERSION', 'SMF_SOFTWARE_YEAR') as $const) |
||||||||||||||
40 | { |
||||||||||||||
41 | preg_match("/define\('$const', '([^)]+)'\);/", $cron_php_start, $matches); |
||||||||||||||
42 | |||||||||||||||
43 | if (empty($matches[1])) |
||||||||||||||
44 | die("Could not find value for $const in cron.php"); |
||||||||||||||
45 | |||||||||||||||
46 | define($const, $matches[1]); |
||||||||||||||
47 | } |
||||||||||||||
48 | |||||||||||||||
49 | define('SMF_USER_AGENT', 'SMF'); |
||||||||||||||
50 | define('MAX_CLAIM_THRESHOLD', 300); |
||||||||||||||
51 | define('TIME_START', microtime(true)); |
||||||||||||||
52 | |||||||||||||||
53 | abstract class SMF_BackgroundTask |
||||||||||||||
54 | { |
||||||||||||||
55 | abstract public function execute(); |
||||||||||||||
56 | } |
||||||||||||||
57 | |||||||||||||||
58 | // This should never be needed, but set it for completeness. |
||||||||||||||
59 | $smcFunc['db_insert'] = function($method, $table, $columns, $data, $keys, $returnmode = 0, $connection = null) {}; |
||||||||||||||
0 ignored issues
–
show
The parameter
$returnmode is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$table is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$keys is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$connection is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$method is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$data is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||||||||||
60 | |||||||||||||||
61 | // 3. Do the job. |
||||||||||||||
62 | require_once($sourcedir . '/Subs.php'); |
||||||||||||||
63 | require_once($sourcedir . '/tasks/UpdateUnicode.php'); |
||||||||||||||
64 | |||||||||||||||
65 | $unicode_updater = new Update_Unicode(); |
||||||||||||||
0 ignored issues
–
show
The call to
Update_Unicode::__construct() has too few arguments starting with details .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above. ![]() |
|||||||||||||||
66 | $unicode_updater->execute(); |
||||||||||||||
67 | |||||||||||||||
68 | ?> |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.