Пример #1
0
/**
 * Check if Lilina is installed and current
 *
 * Checks the PHP version and whether Lilina is installed and up-to-date
 */
function lilina_check_installed()
{
    require_once LILINA_PATH . '/inc/core/version.php';
    if (version_compare('5.2', phpversion(), '>')) {
        lilina_nice_die('<p>Your server is running PHP version ' . phpversion() . ' but Lilina needs PHP 5.2 or newer.</p>');
    }
    if (!lilina_is_installed()) {
        lilina_nice_die("<p>Whoops! It doesn't look like you've installed Lilina yet. Don't panic, you can <a href='" . guess_baseurl() . "install.php'>install it now</a>.</p>", 'Not Installed');
    }
    if (!lilina_settings_current()) {
        lilina_nice_die("<p>Looks like Lilina is out of date! No worries, just <a href='" . guess_baseurl() . "install.php?action=upgrade'>go ahead and update</a>.</p>", 'Out of Date');
    }
}
Пример #2
0
 */
/** */
define('LILINA_PATH', dirname(__FILE__));
define('LILINA_INCPATH', LILINA_PATH . '/inc');
define('LILINA_CONTENT_DIR', LILINA_PATH . '/content');
header('Content-Type: text/html; charset=UTF-8');
require_once LILINA_INCPATH . '/core/misc-functions.php';
require_once LILINA_INCPATH . '/core/install-functions.php';
require_once LILINA_INCPATH . '/core/file-functions.php';
require_once LILINA_INCPATH . '/core/version.php';
lilina_level_playing_field();
if (version_compare('5.2', phpversion(), '>')) {
    lilina_nice_die('<p>Your server is running PHP version ' . phpversion() . ' but Lilina needs PHP 5.2 or newer</p>');
}
//Make sure Lilina's not installed
if (lilina_is_installed()) {
    if (!lilina_settings_current()) {
        if (isset($_GET['action']) && $_GET['action'] == 'upgrade') {
            upgrade();
        } else {
            lilina_nice_die('<p>Your installation of Lilina is out of date. Please <a href="install.php?action=upgrade">upgrade your settings</a> first</p>');
        }
    } else {
        lilina_nice_die('<p>Lilina is already installed. <a href="index.php">Head back to the main page</a></p>');
    }
}
global $installer;
$installer = new Installer();
/**
 * upgrade() - Run upgrade processes on supplied data
 *