1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of EC-CUBE |
5
|
|
|
* |
6
|
|
|
* Copyright(c) 2000-2015 LOCKON CO.,LTD. All Rights Reserved. |
7
|
|
|
* |
8
|
|
|
* http://www.lockon.co.jp/ |
9
|
|
|
* |
10
|
|
|
* This program is free software; you can redistribute it and/or |
11
|
|
|
* modify it under the terms of the GNU General Public License |
12
|
|
|
* as published by the Free Software Foundation; either version 2 |
13
|
|
|
* of the License, or (at your option) any later version. |
14
|
|
|
* |
15
|
|
|
* This program is distributed in the hope that it will be useful, |
16
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
17
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18
|
|
|
* GNU General Public License for more details. |
19
|
|
|
* |
20
|
|
|
* You should have received a copy of the GNU General Public License |
21
|
|
|
* along with this program; if not, write to the Free Software |
22
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
23
|
|
|
*/ |
24
|
|
|
|
25
|
|
|
//[INFO]index.php,install.phpをEC-CUBEルート直下に移動させる場合は、コメントアウトしている行に置き換える |
26
|
|
|
require __DIR__.'/../autoload.php'; |
27
|
|
|
//require __DIR__.'/autoload.php'; |
|
|
|
|
28
|
|
|
|
29
|
|
|
ini_set('display_errors', 'Off'); |
30
|
|
|
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT); |
31
|
|
|
|
32
|
|
|
// see http://silex.sensiolabs.org/doc/web_servers.html#php-5-4 |
33
|
|
|
$filename = __DIR__.preg_replace('#(\?.*)$#', '', $_SERVER['REQUEST_URI']); |
34
|
|
|
if (php_sapi_name() === 'cli-server' && is_file($filename)) { |
35
|
|
|
return false; |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
// output_config_php = true に設定することで、Config Yaml ファイルを元に Config PHP ファイルが出力されます。 |
39
|
|
|
// app/config/eccube, src/Eccube/Resource/config 以下に書き込み権限が必要です。 |
40
|
|
|
// Config PHP ファイルが存在する場合は、 Config Yaml より優先されます。 |
41
|
|
|
// Yaml ファイルをパースする必要が無いため、高速化が期待できます。 |
42
|
|
|
$app = \Eccube\Application::getInstance(array('output_config_php' => false)); |
43
|
|
|
|
44
|
|
|
// インストールされてなければインストーラにリダイレクト |
45
|
|
|
if ($app['config']['eccube_install']) { |
46
|
|
|
$app->initialize(); |
47
|
|
|
$app->initializePlugin(); |
48
|
|
|
if ($app['config']['http_cache']['enabled']) { |
49
|
|
|
$app['http_cache']->run(); |
50
|
|
|
} else { |
51
|
|
|
$app->run(); |
52
|
|
|
} |
53
|
|
|
} else { |
54
|
|
|
$location = str_replace('index.php', 'install.php', $_SERVER['SCRIPT_NAME']); |
55
|
|
|
header('Location:'.$location); |
56
|
|
|
exit; |
57
|
|
|
} |
58
|
|
|
|
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.