These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * Cron script |
||
4 | * |
||
5 | * This file describes runs actions needed by the system occasionally that take a long time |
||
6 | * |
||
7 | * PHP version 5 and 7 |
||
8 | * |
||
9 | * @author Patrick Boyd / [email protected] |
||
10 | * @copyright Copyright (c) 2015, Austin Artistic Reconstruction |
||
11 | * @license http://www.apache.org/licenses/ Apache 2.0 License |
||
12 | */ |
||
13 | |||
14 | /** |
||
15 | * This cron script recompiles the Browscap cache |
||
16 | */ |
||
17 | ini_set('memory_limit','-1'); // turn off memory limit for this script |
||
18 | set_time_limit(120); // change to 2 minutes for this script |
||
19 | |||
20 | require('vendor/autoload.php'); |
||
21 | |||
22 | use BrowscapPHP\Browscap; |
||
23 | |||
24 | date_default_timezone_set('America/Chicago'); |
||
25 | |||
26 | $bc = new \BrowscapPHP\BrowscapUpdater('/var/php_cache/browser'); |
||
0 ignored issues
–
show
|
|||
27 | $adapter = new \WurflCache\Adapter\File([\WurflCache\Adapter\File::DIR => '/var/php_cache/browser']); |
||
28 | $bc->setCache($adapter); |
||
29 | //$browscap = new Browscap('/var/php_cache/browser'); |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
62% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
|||
30 | //$browscap->updateCache(); |
||
31 | $bc->update(); |
||
32 |
This check compares calls to functions or methods with their respective definitions. If the call has more 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.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.