Changeset 12768


Ignore:
Timestamp:
Dec 19, 2011, 9:25:42 PM (9 years ago)
Author:
rvelices
Message:

simplification of 'startup phase' - multisite.inc.php is not required anymore / database.inc.php is included after config.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/common.inc.php

    r12764 r12768  
    7474$filter = array();
    7575
    76 if (is_file(PHPWG_ROOT_PATH .'local/config/multisite.inc.php'))
    77 {
    78   include(PHPWG_ROOT_PATH .'local/config/multisite.inc.php');
    79   define('PWG_LOCAL_DIR', $conf['local_dir_site']);
    80 }
    81 else
    82 {
    83   define('PWG_LOCAL_DIR', 'local/');
    84 }
    85 
    86 @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR .'config/database.inc.php');
    87 if (!defined('PHPWG_INSTALLED'))
    88 {
    89   header('Location: install.php');
    90   exit;
    91 }
    92 
    9376foreach( array(
    9477  'array_intersect_key', //PHP 5 >= 5.1.0RC1
     
    10689include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
    10790@include(PHPWG_ROOT_PATH. 'local/config/config.inc.php');
    108 if (isset($conf['local_dir_site']))
    109 {
    110   @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR. 'config/config.inc.php');
    111 }
    112 
    113 // that's for migration from 2.2, will be deprecated in 2.4
    114 if (isset($conf['order_by']))
    115 {
    116   $conf['order_by_custom'] = $conf['order_by'];
    117 }
    118 if (isset($conf['order_by_inside_category']))
    119 {
    120   $conf['order_by_inside_category_custom'] = $conf['order_by_inside_category'];
    121 }
    122 
     91defined('PWG_LOCAL_DIR') or define('PWG_LOCAL_DIR', 'local/');
     92
     93
     94@include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR .'config/database.inc.php');
     95if (!defined('PHPWG_INSTALLED'))
     96{
     97  header('Location: install.php');
     98  exit;
     99}
    123100include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$conf['dblayer'].'.inc.php');
    124101
  • trunk/include/config_default.inc.php

    r11978 r12768  
    503503// All informations contained in these tables and column are related to
    504504// piwigo_users table.
    505 $conf['users_table'] = $prefixeTable.'users';
     505$conf['users_table'] = null;
    506506
    507507// If you decide to use external authentication
  • trunk/include/constants.php

    r12346 r12768  
    7474  define('USER_GROUP_TABLE', $prefixeTable.'user_group');
    7575if (!defined('USERS_TABLE'))
    76   define('USERS_TABLE', $conf['users_table']);
     76  define('USERS_TABLE', isset($conf['users_table']) ? $conf['users_table'] : $prefixeTable.'users' );
    7777if (!defined('USER_INFOS_TABLE'))
    7878  define('USER_INFOS_TABLE', $prefixeTable.'user_infos');
  • trunk/upgrade.php

    r12296 r12768  
    2525
    2626// load config file
    27 if (is_file(PHPWG_ROOT_PATH .'local/config/multisite.inc.php'))
    28 {
    29   include(PHPWG_ROOT_PATH .'local/config/multisite.inc.php');
    30   define('PWG_LOCAL_DIR', $conf['local_dir_site']);
    31 }
    32 else
    33 {
    34   define('PWG_LOCAL_DIR', 'local/');
    35 }
     27include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
     28@include(PHPWG_ROOT_PATH. 'local/config/config.inc.php');
     29defined('PWG_LOCAL_DIR') or define('PWG_LOCAL_DIR', 'local/');
    3630
    3731$config_file = PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'config/database.inc.php';
     
    4842
    4943include($config_file);
    50 include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
    51 @include(PHPWG_ROOT_PATH. 'local/config/config.inc.php');
    52 if (isset($conf['local_dir_site']))
    53 {
    54   @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR. 'config/config.inc.php');
    55 }
    5644
    5745// $conf is not used for users tables - define cannot be re-defined
  • trunk/upgrade_feed.php

    r8728 r12768  
    3030define('PHPWG_ROOT_PATH', './');
    3131
     32include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
     33@include(PHPWG_ROOT_PATH. 'local/config/config.inc.php');
     34defined('PWG_LOCAL_DIR') or define('PWG_LOCAL_DIR', 'local/');
     35
     36include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR .'config/database.inc.php');
     37include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$conf['dblayer'].'.inc.php');
     38
    3239include_once(PHPWG_ROOT_PATH.'include/functions.inc.php');
    3340include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
    3441include_once(PHPWG_ROOT_PATH.'admin/include/functions_upgrade.php');
    3542
    36 if (is_file(PHPWG_ROOT_PATH .'local/config/multisite.inc.php'))
    37 {
    38   include(PHPWG_ROOT_PATH .'local/config/multisite.inc.php');
    39   define('PWG_LOCAL_DIR', $conf['local_dir_site']);
    40 }
    41 else
    42 {
    43   define('PWG_LOCAL_DIR', 'local/');
    44 }
    45 
    46 include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR .'config/database.inc.php');
    47 include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
    48 @include(PHPWG_ROOT_PATH. 'local/config/config.inc.php');
    49 if (isset($conf['local_dir_site']))
    50 {
    51   @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR. 'config/config.inc.php');
    52 }
    53 include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$conf['dblayer'].'.inc.php');
    5443
    5544// +-----------------------------------------------------------------------+
Note: See TracChangeset for help on using the changeset viewer.