Files
Kleeja/install/index.php

141 lines
2.4 KiB
PHP
Raw Normal View History

2018-01-09 02:09:07 +03:00
<?php
/**
*
* @package install
2020-04-11 22:45:48 +02:00
* @copyright (c) 2007 Kleeja.net
2018-01-09 02:09:07 +03:00
* @license ./docs/license.txt
*
*/
// Report all errors, except notices
error_reporting(E_ALL ^ E_NOTICE);
/**
* include important files
*/
define('IN_COMMON', true);
//path to this file from Kleeja root folder
2019-05-13 00:03:24 +03:00
define('PATH', '../');
2018-01-09 02:09:07 +03:00
//before anything check PHP version compatibility
if (! function_exists('version_compare')
|| version_compare(PHP_VERSION, 7.0, '<'))
{
exit(
'<h2>You are using an old PHP version (' . PHP_VERSION . '), to run Kleeja you should use PHP 7.0 or above.</h2>'
);
}
// if mysqli is not installed
if (! function_exists('mysqli_connect'))
{
exit(
'<h2>In order to use Kleeja, "<b>php_mysqli</b>" extension has to be installed on your server.</h2>'
);
}
2019-05-13 00:03:24 +03:00
if (file_exists(PATH . 'config.php'))
2018-01-09 02:09:07 +03:00
{
2019-05-13 00:03:24 +03:00
include_once PATH . 'config.php';
2018-01-09 02:09:07 +03:00
}
2019-05-13 00:03:24 +03:00
include_once PATH . 'includes/functions.php';
2018-01-09 02:09:07 +03:00
2019-05-30 07:32:17 +03:00
if (isset($dbtype) && $dbtype == 'sqlite')
{
include PATH . 'includes/sqlite.php';
}
else
{
include PATH . 'includes/mysqli.php';
}
2018-01-09 02:09:07 +03:00
include_once 'includes/functions_install.php';
/**
* print header
*/
2019-05-03 23:52:08 +03:00
if (! ip('lang'))
2018-01-09 02:09:07 +03:00
{
2019-05-03 23:52:08 +03:00
echo gettpl('header.html');
2018-01-09 02:09:07 +03:00
}
/**
* Navigation ..
*/
switch (g('step', 'str'))
{
default:
case 'language':
2018-01-09 02:09:07 +03:00
if (ig('ln'))
{
echo '<meta http-equiv="refresh" content="0;url=./?step=what_is_kleeja&lang=' . g('ln', 'str', 'en') . '">';
2019-05-03 23:52:08 +03:00
exit;
}
2018-01-09 02:09:07 +03:00
echo gettpl('lang.html');
2019-05-03 23:52:08 +03:00
break;
2018-01-09 02:09:07 +03:00
case 'what_is_kleeja':
2018-01-09 02:09:07 +03:00
echo gettpl('what_is_kleeja.html');
2019-05-03 23:52:08 +03:00
break;
2018-01-09 02:09:07 +03:00
case 'official':
2018-01-09 02:09:07 +03:00
echo gettpl('official.html');
2019-05-03 23:52:08 +03:00
break;
2018-01-09 02:09:07 +03:00
case 'choose' :
2018-01-09 02:09:07 +03:00
$install_or_no = $php_ver = true;
2019-05-03 23:52:08 +03:00
//check version of PHP
if (! function_exists('version_compare')
|| version_compare(PHP_VERSION, MIN_PHP_VERSION, '<'))
{
$php_ver = false;
}
2019-05-03 23:52:08 +03:00
if (file_exists(PATH . 'config.php'))
2019-05-03 23:52:08 +03:00
{
include_once PATH . 'config.php';
2019-05-03 23:52:08 +03:00
if (! empty($dbuser) && ! empty($dbname))
2019-05-03 23:52:08 +03:00
{
$d = inst_get_config('language');
if (! empty($d))
{
$install_or_no = false;
}
2019-05-03 23:52:08 +03:00
}
}
echo gettpl('choose.html');
2019-05-03 23:52:08 +03:00
break;
2018-01-09 02:09:07 +03:00
}
/**
* print footer
*/
echo gettpl('footer.html');