mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix: Code simpler and works even if script file has no path when called by php interpreter
This commit is contained in:
parent
3ffb11c53d
commit
9f722f671e
|
|
@ -26,8 +26,7 @@
|
|||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@
|
|||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@
|
|||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@
|
|||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@
|
|||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
|
|
|||
|
|
@ -27,8 +27,7 @@
|
|||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@
|
|||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test si mode batch
|
||||
$sapi_type = php_sapi_name();
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@
|
|||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@
|
|||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/php
|
||||
<?PHP
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -26,11 +26,9 @@
|
|||
* \version $Id$
|
||||
*/
|
||||
|
||||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
|
|
|||
|
|
@ -27,8 +27,7 @@
|
|||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test si mode batch
|
||||
$sapi_type = php_sapi_name();
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@
|
|||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@
|
|||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@
|
|||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@
|
|||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@
|
|||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@
|
|||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@
|
|||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('@[\\\/]+$@','',$path).'/';
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user