These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
0 ignored issues
–
show
|
|||
2 | |||
3 | // システム要件チェック |
||
4 | if (version_compare(PHP_VERSION, '5.3.9') < 0) { |
||
5 | die('Your PHP installation is too old. EC-CUBE requires at least PHP 5.3.9. See the <a href="http://www.ec-cube.net/product/system.php">system requirements</a> page for more information.'); |
||
6 | } |
||
7 | |||
8 | if (extension_loaded('wincache')) { |
||
9 | if (!ini_get('opcache.enable')) { |
||
10 | ini_set('wincache.ocenabled', 1); |
||
11 | } |
||
12 | ini_set('wincache.fcenabled', 1); |
||
13 | } |
||
14 | |||
15 | $autoload = __DIR__.'/vendor/autoload.php'; |
||
16 | |||
17 | if (file_exists($autoload) && is_readable($autoload)) { |
||
18 | $loader = require $autoload; |
||
19 | } else { |
||
20 | die('Composer is not installed.'); |
||
21 | } |
||
22 | |||
23 | // autoloader cache |
||
24 | if (extension_loaded('apc') && ini_get('apc.enabled')) { |
||
25 | $apcLoader = new Symfony\Component\ClassLoader\ApcClassLoader(sha1(__FILE__), $loader); |
||
26 | $apcLoader->register(); |
||
27 | $loader->unregister(); |
||
28 | } elseif (extension_loaded('wincache') && ini_get('wincache.fcenabled')) { |
||
29 | $winCacheLoader = new Symfony\Component\ClassLoader\WinCacheClassLoader(sha1(__FILE__), $loader); |
||
30 | $winCacheLoader->register(); |
||
31 | $loader->unregister(); |
||
32 | } |
||
33 | |||
34 | //[INFO]index.php,install.phpをEC-CUBEルート直下に移動させる場合は、コメントアウトしている行に置き換える |
||
35 | define("RELATIVE_PUBLIC_DIR_PATH", ''); |
||
36 | //define("RELATIVE_PUBLIC_DIR_PATH", '/html'); |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
75% 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. ![]() |
|||
37 | |||
38 | return $loader; |
||
39 |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.