Added local include directory

This commit is contained in:
Benjamin Renard 2013-03-31 05:23:10 +02:00
parent 9b9324b120
commit 05ff27515b
17 changed files with 37 additions and 11 deletions

View file

@ -34,6 +34,7 @@ define('LS_LIB_DIR', LS_INCLUDE_DIR .'libs/');
define('LS_ADDONS_DIR', LS_INCLUDE_DIR .'addons/');
define('LS_JS_DIR', LS_INCLUDE_DIR .'js/');
define('LS_TMP_DIR', 'tmp/');
define('LS_LOCAL_DIR', 'local/');
// Locale
define('LS_TEXT_DOMAIN', 'ldapsaisie');

1
public_html/css/local Symbolic link
View file

@ -0,0 +1 @@
../local/css/

1
public_html/images/local Symbolic link
View file

@ -0,0 +1 @@
../local/images/

View file

@ -39,13 +39,17 @@ class LSconfig {
* @retval boolean True si tout s'est bien passé, False sinon
**/
public static function start() {
if (loadDir(LS_CONF_DIR, '^config\..*\.php$')) {
if (is_array($GLOBALS['LSconfig'])) {
self :: $data = $GLOBALS['LSconfig'];
self :: $data['LSaddons'] = $GLOBALS['LSaddons'];
return true;
$files=array('config.inc.php','config.LSaddons.php');
foreach($files as $file) {
if (!LSsession::includeFile(LS_CONF_DIR.'/'.$file)) {
return;
}
}
if (is_array($GLOBALS['LSconfig'])) {
self :: $data = $GLOBALS['LSconfig'];
self :: $data['LSaddons'] = $GLOBALS['LSaddons'];
return true;
}
return;
}

View file

@ -92,7 +92,10 @@ class LSsession {
* @retval true si tout c'est bien passé, false sinon
*/
public static function includeFile($file) {
if (!file_exists($file)) {
if (file_exists(LS_LOCAL_DIR.'/'.$file)) {
$file=LS_LOCAL_DIR.'/'.$file;
}
elseif (!file_exists($file)) {
return;
}
if (defined('LSdebug') && constant('LSdebug')) {
@ -385,11 +388,10 @@ class LSsession {
bindtextdomain(LS_TEXT_DOMAIN, LS_I18N_DIR);
textdomain(LS_TEXT_DOMAIN);
if (is_file(LS_I18N_DIR.'/'.$lang.'/lang.php')) {
include(LS_I18N_DIR.'/'.$lang.'/lang.php');
}
foreach (listFiles(LS_I18N_DIR.'/'.$lang,'/^lang.+\.php$/') as $file) {
include(LS_I18N_DIR."/$lang/$file");
self :: includeFile(LS_I18N_DIR.'/'.$lang.'/lang.php');
foreach (listFiles(LS_LOCAL_DIR.'/'.LS_I18N_DIR.'/'.$lang,'/^lang.+\.php$/') as $file) {
include(LS_LOCAL_DIR.'/'.LS_I18N_DIR."/$lang/$file");
}
}
else {

1
public_html/local/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.php

1
public_html/local/conf/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.php

View file

@ -0,0 +1 @@
*.php

2
public_html/local/css/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*
!.gitignore

2
public_html/local/images/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*
!.gitignore

1
public_html/local/includes/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.php

View file

@ -0,0 +1 @@
*.php

View file

@ -0,0 +1 @@
*.php

View file

@ -0,0 +1,2 @@
*
!.gitignore

2
public_html/local/lang/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*
!.gitignore

View file

@ -0,0 +1,2 @@
*
!.gitignore

1
public_html/templates/local Symbolic link
View file

@ -0,0 +1 @@
../local/templates/