Work to externalize geoip library.
This commit is contained in:
parent
c56ecef2ff
commit
95709f9336
@ -5,7 +5,7 @@
|
|||||||
# This file is used by Dolibarr setup process to create true Dolibarr
|
# This file is used by Dolibarr setup process to create true Dolibarr
|
||||||
# config file called "conf.php".
|
# config file called "conf.php".
|
||||||
#
|
#
|
||||||
# $Id: conf.php.example,v 1.52 2011/08/14 17:17:19 eldy Exp $
|
# $Id: conf.php.example,v 1.53 2011/08/21 15:26:15 eldy Exp $
|
||||||
|
|
||||||
|
|
||||||
###################
|
###################
|
||||||
@ -254,6 +254,9 @@ $dolibarr_main_prod='0';
|
|||||||
# Path to external libraries #
|
# Path to external libraries #
|
||||||
##############################
|
##############################
|
||||||
|
|
||||||
|
# Value to overwrite path to use shared libraries instead of embedded one
|
||||||
|
#$dolibarr_lib_GEOIP_PATH='';
|
||||||
|
|
||||||
# Value to overwrite some path to use shared libraries instead of embedded one
|
# Value to overwrite some path to use shared libraries instead of embedded one
|
||||||
#$dolibarr_lib_ODTPHP_PATHTOPCLZIP="/usr/share/php/libphp-pclzip";
|
#$dolibarr_lib_ODTPHP_PATHTOPCLZIP="/usr/share/php/libphp-pclzip";
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
* \file htdocs/lib/dolgeoip.class.php
|
* \file htdocs/lib/dolgeoip.class.php
|
||||||
* \ingroup geoip
|
* \ingroup geoip
|
||||||
* \brief Library for managing module geoip
|
* \brief Library for managing module geoip
|
||||||
* \version $Id: dolgeoip.class.php,v 1.5 2011/07/31 23:26:01 eldy Exp $
|
* \version $Id: dolgeoip.class.php,v 1.6 2011/08/21 15:26:16 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@ -45,8 +45,16 @@ class DolGeoIP
|
|||||||
*/
|
*/
|
||||||
function DolGeoIP($type,$datfile)
|
function DolGeoIP($type,$datfile)
|
||||||
{
|
{
|
||||||
if ($type == 'country') require_once(DOL_DOCUMENT_ROOT."/includes/geoip/geoip.inc");
|
if ($type == 'country')
|
||||||
else if ($type == 'city') require_once(DOL_DOCUMENT_ROOT."/includes/geoip/geoipcity.inc");
|
{
|
||||||
|
// geoip may have been already included with PEAR
|
||||||
|
if (! function_exists('geoip_country_code_by_name')) $res=include_once(GEOIP_PATH."geoip.inc");
|
||||||
|
}
|
||||||
|
else if ($type == 'city')
|
||||||
|
{
|
||||||
|
// geoip may have been already included with PEAR
|
||||||
|
if (! function_exists('geoip_country_code_by_name')) $res=include_once(GEOIP_PATH."geoipcity.inc");
|
||||||
|
}
|
||||||
else { print 'ErrorBadParameterInConstructor'; return 0; }
|
else { print 'ErrorBadParameterInConstructor'; return 0; }
|
||||||
|
|
||||||
if (empty($type) || empty($datfile))
|
if (empty($type) || empty($datfile))
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
* \ingroup core
|
* \ingroup core
|
||||||
* \brief File that defines environment for all Dolibarr process (pages or scripts)
|
* \brief File that defines environment for all Dolibarr process (pages or scripts)
|
||||||
* This script reads the conf file, init $lang, $db and and empty $user
|
* This script reads the conf file, init $lang, $db and and empty $user
|
||||||
* \version $Id: master.inc.php,v 1.358 2011/08/18 22:26:02 eldy Exp $
|
* \version $Id: master.inc.php,v 1.359 2011/08/21 15:26:16 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@ -293,19 +293,20 @@ if (! defined('MAIN_LABEL_MENTION_NPR') ) define('MAIN_LABEL_MENTION_NPR','NPR')
|
|||||||
* constant to path. Use '' to use include class path autodetect.
|
* constant to path. Use '' to use include class path autodetect.
|
||||||
*/
|
*/
|
||||||
// Path to root libraries
|
// Path to root libraries
|
||||||
if (! defined('TCPDF_PATH')) { define('TCPDF_PATH', DOL_DOCUMENT_ROOT .'/includes/tcpdf/'); }
|
if (! defined('TCPDF_PATH')) { define('TCPDF_PATH', DOL_DOCUMENT_ROOT .'/includes/tcpdf/'); }
|
||||||
if (! defined('FPDFI_PATH')) { define('FPDFI_PATH', DOL_DOCUMENT_ROOT .'/includes/fpdfi/'); }
|
if (! defined('FPDFI_PATH')) { define('FPDFI_PATH', DOL_DOCUMENT_ROOT .'/includes/fpdfi/'); }
|
||||||
if (! defined('NUSOAP_PATH')) { define('NUSOAP_PATH', DOL_DOCUMENT_ROOT .'/includes/nusoap/lib/'); }
|
if (! defined('NUSOAP_PATH')) { define('NUSOAP_PATH', DOL_DOCUMENT_ROOT .'/includes/nusoap/lib/'); }
|
||||||
if (! defined('PHPEXCEL_PATH')) { define('PHPEXCEL_PATH', DOL_DOCUMENT_ROOT .'/includes/phpexcel/'); }
|
if (! defined('PHPEXCEL_PATH')) { define('PHPEXCEL_PATH', DOL_DOCUMENT_ROOT .'/includes/phpexcel/'); }
|
||||||
if (! defined('ODTPHP_PATH')) { define('ODTPHP_PATH', empty($dolibarr_lib_ODTPHP_PATH)?DOL_DOCUMENT_ROOT.'/includes/odtphp/':$dolibarr_lib_ODTPHP_PATH.'/'); }
|
if (! defined('GEOIP_PATH')) { define('GEOIP_PATH', (!isset($dolibarr_lib_GEOIP_PATH))?DOL_DOCUMENT_ROOT.'/includes/geoip/':(empty($dolibarr_lib_GEOIP_PATH)?'':$dolibarr_lib_GEOIP_PATH.'/')); }
|
||||||
if (! defined('ODTPHP_PATHTOPCLZIP')) { define('ODTPHP_PATHTOPCLZIP', empty($dolibarr_lib_ODTPHP_PATHTOPCLZIP)?DOL_DOCUMENT_ROOT.'/includes/odtphp/zip/pclzip/':$dolibarr_lib_ODTPHP_PATHTOPCLZIP.'/'); }
|
if (! defined('ODTPHP_PATH')) { define('ODTPHP_PATH', (!isset($dolibarr_lib_ODTPHP_PATH))?DOL_DOCUMENT_ROOT.'/includes/odtphp/':(empty($dolibarr_lib_GEOIP_PATH)?'':$dolibarr_lib_ODTPHP_PATH.'/')); }
|
||||||
if (! defined('ARTICHOW_FONT')) { define('ARTICHOW_FONT', empty($dolibarr_font_DOL_DEFAULT_TTF_BOLD)?DOL_DOCUMENT_ROOT.'/includes/artichow/font':dirname($dolibarr_font_DOL_DEFAULT_TTF_BOLD)); }
|
if (! defined('ODTPHP_PATHTOPCLZIP')) { define('ODTPHP_PATHTOPCLZIP', (!isset($dolibarr_lib_ODTPHP_PATHTOPCLZIP))?DOL_DOCUMENT_ROOT.'/includes/odtphp/zip/pclzip/':(empty($dolibarr_lib_GEOIP_PATH)?'':$dolibarr_lib_ODTPHP_PATHTOPCLZIP.'/')); }
|
||||||
|
if (! defined('ARTICHOW_FONT')) { define('ARTICHOW_FONT', (!isset($dolibarr_font_DOL_DEFAULT_TTF_BOLD))?DOL_DOCUMENT_ROOT.'/includes/artichow/font':dirname($dolibarr_font_DOL_DEFAULT_TTF_BOLD)); }
|
||||||
// Other required path
|
// Other required path
|
||||||
if (! defined('ARTICHOW_FONT_NAMES')) { define('ARTICHOW_FONT_NAMES', empty($dolibarr_font_DOL_DEFAULT_TTF_BOLD)?'Tuffy,TuffyBold,TuffyBoldItalic,TuffyItalic':'DejaVuSans,DejaVuSans-Bold,DejaVuSans-BoldOblique,DejaVuSans-Oblique'); }
|
if (! defined('ARTICHOW_FONT_NAMES')) { define('ARTICHOW_FONT_NAMES', (!isset($dolibarr_font_DOL_DEFAULT_TTF_BOLD))?'Tuffy,TuffyBold,TuffyBoldItalic,TuffyItalic':'DejaVuSans,DejaVuSans-Bold,DejaVuSans-BoldOblique,DejaVuSans-Oblique'); }
|
||||||
if (! defined('DOL_DEFAULT_TTF')) { define('DOL_DEFAULT_TTF', empty($dolibarr_font_DOL_DEFAULT_TTF)?DOL_DOCUMENT_ROOT.'/includes/barcode/php-barcode/fonts/Aerial.ttf':$dolibarr_font_DOL_DEFAULT_TTF); }
|
if (! defined('DOL_DEFAULT_TTF')) { define('DOL_DEFAULT_TTF', (!isset($dolibarr_font_DOL_DEFAULT_TTF))?DOL_DOCUMENT_ROOT.'/includes/barcode/php-barcode/fonts/Aerial.ttf':(empty($dolibarr_lib_GEOIP_PATH)?'':$dolibarr_font_DOL_DEFAULT_TTF)); }
|
||||||
if (! defined('DOL_DEFAULT_TTF_BOLD')) { define('DOL_DEFAULT_TTF_BOLD', empty($dolibarr_font_DOL_DEFAULT_TTF_BOLD)?DOL_DOCUMENT_ROOT.'/includes/barcode/php-barcode/fonts/AerialBd.ttf':$dolibarr_font_DOL_DEFAULT_TTF_BOLD); }
|
if (! defined('DOL_DEFAULT_TTF_BOLD')) { define('DOL_DEFAULT_TTF_BOLD', (!isset($dolibarr_font_DOL_DEFAULT_TTF_BOLD))?DOL_DOCUMENT_ROOT.'/includes/barcode/php-barcode/fonts/AerialBd.ttf':(empty($dolibarr_lib_GEOIP_PATH)?'':$dolibarr_font_DOL_DEFAULT_TTF_BOLD)); }
|
||||||
// Old path to root deprecated (not used). Kept for extensions.
|
// Old path to root deprecated (not used). Kept for extensions.
|
||||||
if (! defined('FPDF_PATH')) { define('FPDF_PATH', DOL_DOCUMENT_ROOT .'/includes/fpdf/fpdf/'); }
|
if (! defined('FPDF_PATH')) { define('FPDF_PATH', DOL_DOCUMENT_ROOT .'/includes/fpdf/fpdf/'); }
|
||||||
if (! defined('PHP_WRITEEXCEL_PATH')) { define('PHP_WRITEEXCEL_PATH',DOL_DOCUMENT_ROOT .'/includes/php_writeexcel/'); }
|
if (! defined('PHP_WRITEEXCEL_PATH')) { define('PHP_WRITEEXCEL_PATH', DOL_DOCUMENT_ROOT .'/includes/php_writeexcel/'); }
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user