don't load any configs from DB if installing - especially in style.pcss

This commit is contained in:
friendica 2014-02-02 18:18:22 -08:00
parent 38bce48f28
commit baf3b052f6
3 changed files with 11 additions and 6 deletions

View File

@ -576,6 +576,7 @@ function startup() {
class App { class App {
public $install = false; // true if we are installing the software
public $account = null; // account record of the logged-in account public $account = null; // account record of the logged-in account
public $channel = null; // channel record of the current channel of the logged-in account public $channel = null; // channel record of the current channel of the logged-in account

View File

@ -23,7 +23,7 @@ $a = new App;
* *
*/ */
$install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false : true); $a->install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false : true);
@include(".htconfig.php"); @include(".htconfig.php");
@ -38,8 +38,8 @@ $a->language = get_best_language();
require_once("include/dba/dba_driver.php"); require_once("include/dba/dba_driver.php");
if(! $install) { if(! $a->install) {
$db = dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data, $install); $db = dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data, $a->install);
unset($db_host, $db_port, $db_user, $db_pass, $db_data); unset($db_host, $db_port, $db_user, $db_pass, $db_data);
/** /**
@ -91,7 +91,7 @@ if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) {
load_translation_table($a->language); load_translation_table($a->language);
} }
if((x($_GET,'zid')) && (! $install)) { if((x($_GET,'zid')) && (! $a->install)) {
$a->query_string = preg_replace('/[\?&]zid=(.*?)([\?&]|$)/is','',$a->query_string); $a->query_string = preg_replace('/[\?&]zid=(.*?)([\?&]|$)/is','',$a->query_string);
if(! local_user()) { if(! local_user()) {
$_SESSION['my_address'] = $_GET['zid']; $_SESSION['my_address'] = $_GET['zid'];
@ -116,7 +116,7 @@ if(! x($_SESSION,'sysmsg_info'))
*/ */
if($install) { if($a->install) {
/* Allow an exception for the view module so that pcss will be interpreted during installation */ /* Allow an exception for the view module so that pcss will be interpreted during installation */
if($a->module != 'view') if($a->module != 'view')
$a->module = 'setup'; $a->module = 'setup';

View File

@ -1,5 +1,7 @@
<?php <?php
// Get the UID of the channel owner
if(! $a->install) {
// Get the UID of the channel owner
$uid = get_theme_uid(); $uid = get_theme_uid();
if($uid) if($uid)
@ -32,6 +34,8 @@
$top_photo=get_pconfig($uid,'redbasic','top_photo'); $top_photo=get_pconfig($uid,'redbasic','top_photo');
$reply_photo=get_pconfig($uid,'redbasic','reply_photo'); $reply_photo=get_pconfig($uid,'redbasic','reply_photo');
}
// Now load the scheme. If a value is changed above, we'll keep the settings // Now load the scheme. If a value is changed above, we'll keep the settings
// If not, we'll keep those defined by the schema // If not, we'll keep those defined by the schema
// Setting $scheme to '' wasn't working for some reason, so we'll check it's // Setting $scheme to '' wasn't working for some reason, so we'll check it's