Changeset 8722


Ignore:
Timestamp:
01/17/11 19:48:13 (9 years ago)
Author:
plg
Message:

feature 2112 added: ability to set an additional local directory
$conflocal_dir_site in local/config/multisite.inc.php

Location:
trunk
Files:
11 edited

Legend:

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

    r8247 r8722  
    7171$filter = array(); 
    7272 
    73 @include(PHPWG_ROOT_PATH .'local/config/database.inc.php'); 
     73if (is_file(PHPWG_ROOT_PATH .'local/config/multisite.inc.php')) 
     74{ 
     75  include(PHPWG_ROOT_PATH .'local/config/multisite.inc.php'); 
     76  define('PWG_LOCAL_DIR', $conf['local_dir_site']); 
     77} 
     78else 
     79{ 
     80  define('PWG_LOCAL_DIR', 'local/'); 
     81} 
     82 
     83@include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR .'config/database.inc.php'); 
    7484if (!defined('PHPWG_INSTALLED')) 
    7585{ 
     
    93103include(PHPWG_ROOT_PATH . 'include/config_default.inc.php'); 
    94104@include(PHPWG_ROOT_PATH. 'local/config/config.inc.php'); 
     105if (isset($conf['local_dir_site'])) 
     106{ 
     107  @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR. 'config/config.inc.php'); 
     108} 
    95109include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$conf['dblayer'].'.inc.php'); 
    96110 
     
    152166} 
    153167trigger_action('loading_lang'); 
    154 load_language('lang', PHPWG_ROOT_PATH.'local/', array('no_fallback'=>true, 'local'=>true) ); 
     168load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true) ); 
    155169 
    156170// only now we can set the localized username of the guest user (and not in 
  • trunk/include/constants.php

    r8651 r8722  
    2828 
    2929define('PHPWG_THEMES_PATH', $conf['themes_dir'].'/'); 
     30define('PWG_COMBINED_DIR', PWG_LOCAL_DIR.'combined/'); 
    3031 
    3132// Required versions 
  • trunk/include/functions.inc.php

    r8665 r8722  
    576576    load_language('common.lang'); 
    577577    trigger_action('loading_lang'); 
    578     load_language('lang', PHPWG_ROOT_PATH.'local/', array('no_fallback'=>true, 'local'=>true) ); 
     578    load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true) ); 
    579579    $template = new Template(PHPWG_ROOT_PATH.'themes', get_default_theme()); 
    580580  } 
  • trunk/include/functions_mail.inc.php

    r8131 r8722  
    224224    load_language('admin.lang', '', array('language'=>$language) ); 
    225225    trigger_action('loading_lang'); 
    226     load_language('lang', PHPWG_ROOT_PATH.'local/', 
     226    load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, 
    227227      array('language'=>$language, 'no_fallback'=>true, 'local'=>true) 
    228228    ); 
  • trunk/include/template.class.php

    r8634 r8722  
    798798    foreach ($smarty->get_template_vars('themes') as $theme) 
    799799    { 
    800       $f = 'local/css/'.$theme['id'].'-rules.css'; 
     800      $f = PWG_LOCAL_DIR.'css/'.$theme['id'].'-rules.css'; 
    801801      if (file_exists(PHPWG_ROOT_PATH.$f)) 
    802802      { 
     
    804804      } 
    805805    } 
    806     $f = 'local/css/rules.css'; 
     806    $f = PWG_LOCAL_DIR.'css/rules.css'; 
    807807    if (file_exists(PHPWG_ROOT_PATH.$f)) 
    808808    { 
     
    11341134final class FileCombiner 
    11351135{ 
    1136   const OUT_SUB_DIR = 'local/combined/'; 
     1136  const OUT_SUB_DIR = PWG_COMBINED_DIR; 
    11371137  private $type; // js or css 
    11381138  private $files = array(); 
  • trunk/install.php

    r8311 r8722  
    115115} 
    116116 
     117if (is_file(PHPWG_ROOT_PATH .'local/config/multisite.inc.php')) 
     118{ 
     119  include(PHPWG_ROOT_PATH .'local/config/multisite.inc.php'); 
     120  define('PWG_LOCAL_DIR', $conf['local_dir_site']); 
     121} 
     122else 
     123{ 
     124  define('PWG_LOCAL_DIR', 'local/'); 
     125} 
     126 
    117127include(PHPWG_ROOT_PATH . 'include/config_default.inc.php'); 
    118128@include(PHPWG_ROOT_PATH. 'local/config/config.inc.php'); 
     129if (isset($conf['local_dir_site'])) 
     130{ 
     131  @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR. 'config/config.inc.php'); 
     132} 
    119133 
    120134// download database config file if exists 
     
    153167$errors = array(); 
    154168 
    155 $config_file = PHPWG_ROOT_PATH . 'local/config/database.inc.php'; 
     169$config_file = PHPWG_ROOT_PATH.PWG_LOCAL_DIR .'config/database.inc.php'; 
    156170if (@file_exists($config_file)) 
    157171{ 
  • trunk/nbm.php

    r6363 r8722  
    3535// Need to update a second time 
    3636trigger_action('loading_lang'); 
    37 load_language('lang', PHPWG_ROOT_PATH.'local/', array('no_fallback'=>true, 'local'=>true) ); 
     37load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true) ); 
    3838 
    3939 
  • trunk/plugins/LocalFilesEditor/admin.php

    r8126 r8722  
    131131{ 
    132132  case 'localconf': 
    133     $edited_file = PHPWG_ROOT_PATH . "local/config/config.inc.php"; 
     133    $edited_file = PHPWG_ROOT_PATH.PWG_LOCAL_DIR . "config/config.inc.php"; 
    134134    $content_file = file_exists($edited_file) ? 
    135135      file_get_contents($edited_file) : $new_file['localconf']; 
     
    146146    $options[] = l10n('locfiledit_choose_file'); 
    147147    $options[] = '----------------------'; 
    148     $value = PHPWG_ROOT_PATH . "local/css/rules.css"; 
     148    $value = PHPWG_ROOT_PATH.PWG_LOCAL_DIR . "css/rules.css"; 
    149149    $options[$value] = 'local / css / rules.css'; 
    150150    if ($edited_file == $value) $selected = $value; 
     
    153153    foreach (get_dirs($conf['themes_dir']) as $theme_id) 
    154154    { 
    155       $value = PHPWG_ROOT_PATH . 'local/css/'.$theme_id.'-rules.css'; 
     155      $value = PHPWG_ROOT_PATH.PWG_LOCAL_DIR . 'css/'.$theme_id.'-rules.css'; 
    156156      $options[$value] = 'local / css / '.$theme_id.'-rules.css'; 
    157157      if ($edited_file == $value) $selected = $value; 
     
    248248    foreach (get_languages() as $language_code => $language_name) 
    249249    { 
    250       $value = PHPWG_ROOT_PATH.'local/language/'.$language_code.'.lang.php'; 
     250      $value = PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'language/'.$language_code.'.lang.php'; 
    251251      if ($edited_file == $value) 
    252252      { 
  • trunk/plugins/language_switch/language_switch.inc.php

    r5845 r8722  
    5050    if ( $same !== $user['language']) { 
    5151      load_language('common.lang', '', array('language'=>$user['language']) ); 
    52       load_language('lang', PHPWG_ROOT_PATH.'local/', 
     52      load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, 
    5353        array('language'=>$user['language'], 'no_fallback'=>true, 'local'=>true) 
    5454      ); 
  • trunk/upgrade.php

    r6363 r8722  
    2525 
    2626// load config file 
    27 $config_file = PHPWG_ROOT_PATH.'local/config/database.inc.php'; 
     27if (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} 
     32else 
     33{ 
     34  define('PWG_LOCAL_DIR', 'local/'); 
     35} 
     36 
     37$config_file = PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'config/database.inc.php'; 
    2838$config_file_contents = @file_get_contents($config_file); 
    2939if ($config_file_contents === false) 
     
    3747} 
    3848 
    39 include(PHPWG_ROOT_PATH.'local/config/database.inc.php'); 
     49include($config_file); 
    4050include(PHPWG_ROOT_PATH . 'include/config_default.inc.php'); 
    4151@include(PHPWG_ROOT_PATH. 'local/config/config.inc.php'); 
     52if (isset($conf['local_dir_site'])) 
     53{ 
     54  @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR. 'config/config.inc.php'); 
     55} 
    4256 
    4357// $conf is not used for users tables - define cannot be re-defined 
     
    309323          sprintf( 
    310324            l10n('In <i>%s</i>, before <b>?></b>, insert:'), 
    311             'local/config/database.inc.php' 
     325            PWG_LOCAL_DIR.'config/database.inc.php' 
    312326            ) 
    313327          .'<p><textarea rows="4" cols="40">' 
  • trunk/upgrade_feed.php

    r6363 r8722  
    3333include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 
    3434include_once(PHPWG_ROOT_PATH.'admin/include/functions_upgrade.php'); 
    35 include(PHPWG_ROOT_PATH.'local/config/database.inc.php'); 
     35 
     36if (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} 
     41else 
     42{ 
     43  define('PWG_LOCAL_DIR', 'local/'); 
     44} 
     45 
     46include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR .'config/database.inc.php'); 
    3647include(PHPWG_ROOT_PATH . 'include/config_default.inc.php'); 
    3748@include(PHPWG_ROOT_PATH. 'local/config/config.inc.php'); 
     49if (isset($conf['local_dir_site'])) 
     50{ 
     51  @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR. 'config/config.inc.php'); 
     52} 
    3853include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$conf['dblayer'].'.inc.php'); 
    3954 
Note: See TracChangeset for help on using the changeset viewer.