Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit cfae682

Browse files
author
Jamie Snape
committed
Tidy index page and do not require log directory to be writable
1 parent 5dee536 commit cfae682

File tree

1 file changed

+17
-25
lines changed

1 file changed

+17
-25
lines changed

index.php

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,16 @@
1818
limitations under the License.
1919
=========================================================================*/
2020

21+
define('BASE_PATH', realpath(dirname(__FILE__)));
22+
23+
set_include_path('.'
24+
. PATH_SEPARATOR . './library'
25+
. PATH_SEPARATOR . './core/dao/'
26+
. PATH_SEPARATOR . get_include_path());
27+
2128
if(function_exists('apache_get_modules'))
2229
{
23-
$modules = apache_get_modules();
24-
$mod_rewrite = in_array('mod_rewrite', $modules);
30+
$mod_rewrite = in_array('mod_rewrite', apache_get_modules());
2531
}
2632
else
2733
{
@@ -31,31 +37,20 @@
3137
if(!$mod_rewrite)
3238
{
3339
echo "Please install/enable the module rewrite";
34-
exit;
40+
exit();
3541
}
36-
error_reporting(E_ALL | E_STRICT);
37-
ini_set('display_errors', 'on');
38-
set_include_path('.'
39-
. PATH_SEPARATOR . './library'
40-
. PATH_SEPARATOR . './core/dao/'
41-
. PATH_SEPARATOR . get_include_path());
4242

43-
define('BASE_PATH', realpath(dirname(__FILE__)));
44-
45-
if(!is_writable(BASE_PATH."/core/configs") || !is_writable(BASE_PATH."/log") || !is_writable(BASE_PATH."/data") || !is_writable(BASE_PATH."/tmp"))
43+
if(!is_writable(BASE_PATH . '/core/configs') || !is_writable(BASE_PATH . '/data') || !is_writable(BASE_PATH . '/tmp'))
4644
{
47-
echo "To use Midas, the following repertories have to be writable by apache:
45+
echo 'To use Midas Platform, the following folders must be writable by your web server:
4846
<ul>
49-
<li>".BASE_PATH."/core/configs</li>
50-
<li>".BASE_PATH."/log</li>
51-
<li>".BASE_PATH."/data</li>
52-
<li>".BASE_PATH."/tmp</li>
53-
</ul>";
47+
<li>' . BASE_PATH . '/core/configs</li>
48+
<li>' . BASE_PATH . '/data</li>
49+
<li>' . BASE_PATH . '/tmp</li>
50+
</ul>';
5451
exit();
5552
}
5653

57-
// remember me cookie lifetime
58-
//ini_set('session.gc_maxlifetime', 60 * 60 * 24 * 15); //15 days
5954
define('START_TIME', microtime(true));
6055

6156
require_once 'Zend/Loader/Autoloader.php';
@@ -64,10 +59,7 @@
6459
$loader = Zend_Loader_Autoloader::getInstance();
6560
$loader->registerNamespace('App_');
6661

67-
require_once(BASE_PATH . "/core/include.php");
62+
require_once(BASE_PATH . '/core/include.php');
6863

69-
// Create application, bootstrap, and run
7064
$application = new Zend_Application('global', CORE_CONFIG);
71-
72-
$application->bootstrap()
73-
->run();
65+
$application->bootstrap()->run();

0 commit comments

Comments
 (0)