From acc4d115462b12707cbdb38bdbcce7f71dd40d72 Mon Sep 17 00:00:00 2001 From: llaffont <llaffont@git-test.afi-sa.fr> Date: Mon, 22 Apr 2013 14:40:14 +0000 Subject: [PATCH] correction config cosmogramme --- cosmogramme/php/_init.php | 11 ++++--- cosmogramme/storm_init.php | 66 ++++++++++++++++++++------------------ 2 files changed, 41 insertions(+), 36 deletions(-) diff --git a/cosmogramme/php/_init.php b/cosmogramme/php/_init.php index 0fa68bd7c75..c72d73fb809 100644 --- a/cosmogramme/php/_init.php +++ b/cosmogramme/php/_init.php @@ -3,11 +3,9 @@ define("VERSION_COSMOGRAMME","6.31"); define("PATCH_LEVEL","156"); define("APPLI","cosmogramme"); +define("COSMOPATH", "/var/www/html/vhosts/opac2/www/htdocs"); define("CRLF", chr(13) . chr(10)); define("BR","<br />"); -define("COSMOPATH", "/var/www/html/vhosts/opac2/www/htdocs"); - - if (!function_exists('xdebug_break')) { function xdebug_break(){}; @@ -37,14 +35,17 @@ define("URL_IMG", URL_BASE ."images/"); // Includes set_include_path(get_include_path().PATH_SEPARATOR.'./php/' . PATH_SEPARATOR . "./php/classes/"); -require("classe_sql.php"); -require("fonctions/sql.php"); require("fonctions/fonctions_base.php"); require("fonctions/string.php"); require("fonctions/erreur.php"); require("fonctions/date_heure.php"); require("fonctions/variables.php"); + require_once(realpath(dirname(__FILE__)).'/../storm_init.php'); + +require("classe_sql.php"); +require("fonctions/sql.php"); + // Lire la config $cfg=lireConfig($cfgfile); diff --git a/cosmogramme/storm_init.php b/cosmogramme/storm_init.php index 148f9fdfe0b..7879eb112c0 100644 --- a/cosmogramme/storm_init.php +++ b/cosmogramme/storm_init.php @@ -1,51 +1,55 @@ <?php -/** - * Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved. - * - * AFI-OPAC 2.0 is free software; you can redistribute it and/or modify - * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by - * the Free Software Foundation. - * - * There are special exceptions to the terms and conditions of the AGPL as it - * is applied to this software (see README file). - * - * AFI-OPAC 2.0 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU AFFERO GENERAL PUBLIC LICENSE for more details. - * - * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE - * along with AFI-OPAC 2.0; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - + /** + * Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved. + * + * AFI-OPAC 2.0 is free software; you can redistribute it and/or modify + * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by + * the Free Software Foundation. + * + * There are special exceptions to the terms and conditions of the AGPL as it + * is applied to this software (see README file). + * + * AFI-OPAC 2.0 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE + * along with AFI-OPAC 2.0; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ include_once (realpath(dirname(__FILE__)).'/local.php'); -if (!defined('OPAC_PATH')) - define('OPAC_PATH',realpath(dirname(__FILE__).'/../')); -if (!defined('ZEND_FRAMEWORK_PATH')) - define ('ZEND_FRAMEWORK_PATH', PATH_SEPARATOR . '../../ZendFramework-1.6.2/library'); +if (!defined('OPAC_PATH')) + define('OPAC_PATH',realpath(dirname(__FILE__).'/../')); +if (!defined('LANG_DIR')) + define('LANG_DIR', OPAC_PATH.'/library/translation/'); -set_include_path( - ZEND_FRAMEWORK_PATH - . PATH_SEPARATOR . get_include_path() - . PATH_SEPARATOR.OPAC_PATH . '/library' -); +set_include_path(get_include_path().PATH_SEPARATOR.OPAC_PATH.'/library'); // Includes de base include_once "fonctions/array.php"; include_once OPAC_PATH."/local.php"; +if (!defined('ZEND_FRAMEWORK_PATH')) + define ('ZEND_FRAMEWORK_PATH', PATH_SEPARATOR . '../../ZendFramework-1.6.2/library'); + +set_include_path(ZEND_FRAMEWORK_PATH.PATH_SEPARATOR.get_include_path()); + require_once "Zend/Loader.php"; require_once "startup.php"; Zend_Loader::registerAutoload(); -$cfg_file = file_exists('../config.ini') ? '../config.ini' : OPAC_PATH.'/config.ini'; +$base_dir = $_SERVER['DOCUMENT_ROOT'].'/'.explode('/', $_SERVER['SCRIPT_NAME'])[1]; +if (!file_exists($cfg_file = $base_dir.'/config.ini')) { + $cfg_file = file_exists('../config.ini') ? '../config.ini' : OPAC_PATH.'/config.ini'; +} + $cfg = loadConfig($cfg_file); setupDatabase($cfg); setupDevOptions($cfg); -defineConstant('LANG_DIR', realpath(dirname(__FILE__)).'/../library/translation/'); + setupLanguage(); ?> \ No newline at end of file -- GitLab