From 2cf25c69e44af2e41c84dbd4556698a03f81a2d9 Mon Sep 17 00:00:00 2001 From: Milos Stojanovic Date: Fri, 14 Jun 2019 14:49:20 +0200 Subject: [PATCH] basic checks --- dist/index.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dist/index.php b/dist/index.php index e73be0d..9a8c0a6 100644 --- a/dist/index.php +++ b/dist/index.php @@ -9,14 +9,36 @@ * file that was distributed with this source code. */ +if (version_compare(PHP_VERSION, '7.1.3', '<')) { + echo 'Minimum requirement is PHP 7.1.3. You are using: '.PHP_VERSION."\n"; + die; +} + +if (! is_writable(__DIR__.'/../private/logs/')) { + echo 'Folder not writable: /private/logs/'."\n"; + die; +} + +if (! is_writable(__DIR__.'/../private/tmp/')) { + echo 'Folder not writable: /private/tmp/'."\n"; + die; +} + +if (! is_writable(__DIR__.'/../repository/')) { + echo 'Folder not writable: /repository/'."\n"; + die; +} + require __DIR__.'/../vendor/autoload.php'; if (! defined('APP_ENV')) { define('APP_ENV', 'production'); } + if (! defined('APP_PUBLIC_PATH')) { define('APP_PUBLIC_PATH', ''); } + define('APP_PUBLIC_DIR', __DIR__); define('APP_VERSION', '7.0.0');