aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMarc Wilhelm <marc@suxez.com>2014-07-22 11:52:18 +0200
committerMarc Wilhelm <marc@suxez.com>2014-07-22 11:52:18 +0200
commit9c67b1b829290e5e78cb7da90acf285d6cd5c48f (patch)
tree701dc16488062092d4733a0937b815a4b9248c28
parent955fc6743871016787e8425425b63cd0f40acaa9 (diff)
downloadwallabag-9c67b1b829290e5e78cb7da90acf285d6cd5c48f.tar.gz
wallabag-9c67b1b829290e5e78cb7da90acf285d6cd5c48f.tar.zst
wallabag-9c67b1b829290e5e78cb7da90acf285d6cd5c48f.zip
Split up check_setup.php into two files. The new file check_essentials.php takes care of stuff like the PHP version and is executed before the config files are included which are needed by check_setup. This patch addresses issue #773
-rw-r--r--check_essentials.php14
-rw-r--r--check_setup.php15
-rwxr-xr-xindex.php3
3 files changed, 17 insertions, 15 deletions
diff --git a/check_essentials.php b/check_essentials.php
new file mode 100644
index 00000000..a47cd5a8
--- /dev/null
+++ b/check_essentials.php
@@ -0,0 +1,14 @@
1<?php
2
3// PHP 5.3 minimum
4if (version_compare(PHP_VERSION, '5.3.3', '<')) {
5 die('This software require PHP 5.3.3 minimum');
6}
7
8// Short tags must be enabled for PHP < 5.4
9if (version_compare(PHP_VERSION, '5.4.0', '<')) {
10
11 if (! ini_get('short_open_tag')) {
12 die('This software require to have short tags enabled, check your php.ini => "short_open_tag = On"');
13 }
14} \ No newline at end of file
diff --git a/check_setup.php b/check_setup.php
index 2b84a744..7e378b15 100644
--- a/check_setup.php
+++ b/check_setup.php
@@ -1,25 +1,12 @@
1<?php 1<?php
2 2
3// PHP 5.3 minimum
4if (version_compare(PHP_VERSION, '5.3.3', '<')) {
5 die('This software require PHP 5.3.3 minimum');
6}
7
8// Short tags must be enabled for PHP < 5.4
9if (version_compare(PHP_VERSION, '5.4.0', '<')) {
10
11 if (! ini_get('short_open_tag')) {
12 die('This software require to have short tags enabled, check your php.ini => "short_open_tag = On"');
13 }
14}
15
16// Check if /cache is writeable 3// Check if /cache is writeable
17if (! is_writable('cache')) { 4if (! is_writable('cache')) {
18 die('The directory "cache" must be writeable by your web server user'); 5 die('The directory "cache" must be writeable by your web server user');
19} 6}
20 7
21// Check if /db is writeable 8// Check if /db is writeable
22if (! is_writable('db')) { 9if (! is_writable('db') && STORAGE === 'sqlite') {
23 die('The directory "db" must be writeable by your web server user'); 10 die('The directory "db" must be writeable by your web server user');
24} 11}
25 12
diff --git a/index.php b/index.php
index 481841ec..cce10b50 100755
--- a/index.php
+++ b/index.php
@@ -9,8 +9,9 @@
9 */ 9 */
10 10
11define ('POCHE', '1.7.1'); 11define ('POCHE', '1.7.1');
12require 'check_setup.php'; 12require 'check_essentials.php';
13require_once 'inc/poche/global.inc.php'; 13require_once 'inc/poche/global.inc.php';
14require 'check_setup.php';
14 15
15# Set error reporting level 16# Set error reporting level
16if (defined('ERROR_REPORTING')) { 17if (defined('ERROR_REPORTING')) {