1 | <?php |
||
8 | class Updater |
||
9 | { |
||
10 | public static $ttl = 604800; // = 60 * 60 * 24 * 7 = 7 days |
||
11 | public static $updateUrl = 'https://raw.githubusercontent.com/nabble/semalt-blocker/master/domains/blocked'; |
||
12 | |||
13 | private static $blocklist = './../../domains/blocked'; |
||
14 | |||
15 | ////////////////////////////////////////// |
||
16 | // PUBLIC API // |
||
17 | ////////////////////////////////////////// |
||
18 | |||
19 | /** |
||
20 | * Try to update the blocked domains list. |
||
21 | * |
||
22 | * @param bool $force |
||
23 | */ |
||
24 | public static function update($force = false) |
||
36 | |||
37 | /** |
||
38 | * @return string |
||
39 | */ |
||
40 | public static function getNewDomainList() |
||
56 | |||
57 | /** |
||
58 | * @return string |
||
59 | */ |
||
60 | public static function getBlocklistFilename() |
||
64 | |||
65 | ////////////////////////////////////////// |
||
66 | // PRIVATE FUNCTIONS // |
||
67 | ////////////////////////////////////////// |
||
68 | |||
69 | private static function doUpdate() |
||
78 | |||
79 | /** |
||
80 | * @return bool |
||
81 | */ |
||
82 | private static function isWritable() |
||
86 | |||
87 | /** |
||
88 | * @return bool |
||
89 | */ |
||
90 | private static function isOutdated() |
||
94 | } |
||
95 |
Let’s assume you have a class which uses late-static binding:
The code above will run fine in your PHP runtime. However, if you now create a sub-class and call the
getSomeVariable()
on that sub-class, you will receive a runtime error:In the case above, it makes sense to update
SomeClass
to useself
instead: