Projekt

Obecné

Profil

« Předchozí | Další » 

Revize ed986471

Přidáno uživatelem Ondřej Fibich před téměř 6 roky(ů)

Refs #1101: Support for Debian Stretch (PHP 7.0 + Maria DB 15.1). Improved setup that no longer support database creation (in Maria DB it is hard to do so from non-root user due to security restrictions), database setup error cause was added, disabling Settings DB queries in non-setup environment. In order to fix DB init some FK indexes/constrains must have been renamed in 1.1.0 SQL script (Maria DB enforces uniqueness on FK names).

Zobrazit rozdíly:

application/libraries/MY_Controller.php
// This part only needs to be run once
if (self::$instance === NULL)
{
// init settings
$this->settings = new Settings();
$not_setup = !file_exists('config.php') || !file_exists('.htaccess');
// change setting for non-setup in order to prevent database init
// in Settings
if ($not_setup)
{
Settings::set_offline_mode(TRUE);
$this->settings->set('index_page', !file_exists('.htaccess'));
// Choose all automatically for setup (see url helper)
$this->settings->set('domain', '');
$this->settings->set('suffix', '');
$this->settings->set('protocol', '');
}
// init sessions
$this->session = Session::instance();
......
// Die
die();
}
// init settings
$this->settings = new Settings();
// if true, freenetis will run in popup mode (without header and menu)
$this->popup = (isset($_GET['popup']) && $_GET['popup']) ? 1 : 0;
......
$this->noredirect = ($this->input->get('noredirect') || $this->input->post('noredirect'));
// config file doesn't exist, we must create it
if (!file_exists('config.php') || !file_exists('.htaccess'))
if ($not_setup)
{
// protection before loop
if (url_lang::current(1) == 'setup_config')
return;
if (!file_exists('.htaccess'))
{
Settings::set('index_page', 1);
}
url::redirect('setup_config');
}

Také k dispozici: Unified diff