diff --git a/application/utils.inc.php b/application/utils.inc.php index 64f01f6a0..fee459751 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -1753,7 +1753,6 @@ SQL; * it at all (losing the direct access to the page) : * * ```php - * if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__)); * require_once(__DIR__.'/../../approot.inc.php'); * ``` * diff --git a/approot.inc.php b/approot.inc.php index 059ecc265..820ab0a6e 100644 --- a/approot.inc.php +++ b/approot.inc.php @@ -1,6 +1,6 @@ GetDefaultLanguage())); } - $sFileName = dirname(__FILE__)."/data/{$sLang}.data.itop-tickets.xml"; + $sFileName = __DIR__."/data/{$sLang}.data.itop-tickets.xml"; SetupLog::Info("Searching file: $sFileName"); if (!file_exists($sFileName)) { - $sFileName = dirname(__FILE__)."/data/en_us.data.itop-tickets.xml"; + $sFileName = __DIR__."/data/en_us.data.itop-tickets.xml"; } SetupLog::Info("Loading file: $sFileName"); $oDataLoader->StartSession($oMyChange); diff --git a/index.php b/index.php index c50fd8cbb..1b66a7dad 100644 --- a/index.php +++ b/index.php @@ -9,7 +9,7 @@ require_once('approot.inc.php'); * Check that the configuration file exists and has the appropriate access rights * If the file does not exist, launch the configuration wizard to create it */ -if (file_exists(dirname(__FILE__).'/'.$sConfigFile)) +if (file_exists(APPROOT.$sConfigFile)) { if (!is_readable($sConfigFile)) { diff --git a/setup/compiler.class.inc.php b/setup/compiler.class.inc.php index 696f26f4b..ecc89c2f3 100644 --- a/setup/compiler.class.inc.php +++ b/setup/compiler.class.inc.php @@ -1018,7 +1018,7 @@ EOF } else { - $sPHP = "dirname(__FILE__).'/$sPath'"; + $sPHP = "__DIR__.'/$sPath'"; } } return $sPHP; diff --git a/synchro/priv_sync_chunk.php b/synchro/priv_sync_chunk.php index ed83f0888..cf018950e 100644 --- a/synchro/priv_sync_chunk.php +++ b/synchro/priv_sync_chunk.php @@ -17,7 +17,6 @@ * You should have received a copy of the GNU Affero General Public License */ -if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__)); require_once(__DIR__.'/../approot.inc.php'); require_once(APPROOT.'/application/application.inc.php'); diff --git a/synchro/synchro_exec.php b/synchro/synchro_exec.php index ba0f901ae..ea8dabbe1 100644 --- a/synchro/synchro_exec.php +++ b/synchro/synchro_exec.php @@ -27,7 +27,6 @@ // - not outputing xml when a wrong input is given (class, attribute names) // -if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__)); require_once(__DIR__.'/../approot.inc.php'); require_once(APPROOT.'/application/application.inc.php'); diff --git a/synchro/synchro_import.php b/synchro/synchro_import.php index 935d824de..fc29492fa 100644 --- a/synchro/synchro_import.php +++ b/synchro/synchro_import.php @@ -22,11 +22,6 @@ // - reconciliation is made on the column primary_key // -if (!defined('__DIR__')) -{ - /** @noinspection DirectoryConstantCanBeUsedInspection */ - define('__DIR__', dirname(__FILE__)); -} require_once __DIR__.'/../approot.inc.php'; require_once APPROOT.'/application/application.inc.php'; require_once APPROOT.'/application/startup.inc.php'; diff --git a/webservices/createfrommail.php b/webservices/createfrommail.php index ae1d16d4c..8192862de 100644 --- a/webservices/createfrommail.php +++ b/webservices/createfrommail.php @@ -35,7 +35,6 @@ define('DEFAULT_SUBSERVICE_ID', 12); define('DEFAULT_PRODUCT', 'Request via eMail'); define('DEFAULT_WORKGROUP_ID', 5); -if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__)); require_once(__DIR__.'/../approot.inc.php'); require_once(APPROOT.'/application/application.inc.php'); require_once(APPROOT.'/application/startup.inc.php'); diff --git a/webservices/cron.php b/webservices/cron.php index b1c6da3e9..19378c688 100644 --- a/webservices/cron.php +++ b/webservices/cron.php @@ -17,7 +17,6 @@ * You should have received a copy of the GNU Affero General Public License */ -if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__)); require_once(__DIR__.'/../approot.inc.php'); const EXIT_CODE_ERROR = -1; diff --git a/webservices/export-v2.php b/webservices/export-v2.php index d7338a3cf..050549332 100644 --- a/webservices/export-v2.php +++ b/webservices/export-v2.php @@ -16,9 +16,6 @@ use Combodo\iTop\Application\UI\Base\Component\Input\TextArea; use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory; use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory; -if (!defined('__DIR__')) { - define('__DIR__', dirname(__FILE__)); -} require_once(__DIR__.'/../approot.inc.php'); require_once(APPROOT.'/application/application.inc.php'); require_once(APPROOT.'/application/excelexporter.class.inc.php'); diff --git a/webservices/export.php b/webservices/export.php index 074020018..ed370fd10 100644 --- a/webservices/export.php +++ b/webservices/export.php @@ -26,7 +26,6 @@ * @link https://www.itophub.io/wiki/page?id=latest:advancedtopics:exportdata_v1 script documentation */ -if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__)); require_once(__DIR__.'/../approot.inc.php'); require_once(APPROOT.'/application/application.inc.php'); require_once(APPROOT.'/application/excelexporter.class.inc.php'); diff --git a/webservices/import.php b/webservices/import.php index 26235b7ea..048edba4d 100644 --- a/webservices/import.php +++ b/webservices/import.php @@ -27,7 +27,6 @@ // - not outputing xml when a wrong input is given (class, attribute names) // -if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__)); require_once(__DIR__.'/../approot.inc.php'); require_once(APPROOT.'/application/application.inc.php'); diff --git a/webservices/rest.php b/webservices/rest.php index 61ab77db0..a70644340 100644 --- a/webservices/rest.php +++ b/webservices/rest.php @@ -17,7 +17,6 @@ * You should have received a copy of the GNU Affero General Public License */ -if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__)); require_once(__DIR__.'/../approot.inc.php'); require_once(APPROOT.'/application/application.inc.php'); require_once(APPROOT.'/application/loginwebpage.class.inc.php');