mirror of
https://github.com/Combodo/iTop.git
synced 2026-08-22 22:28:19 +02:00
N°6105 - Cleanup unnecessary use of dirname(__FILE__) (#453)
This commit is contained in:
@@ -1753,7 +1753,6 @@ SQL;
|
|||||||
* it at all (losing the direct access to the page) :
|
* it at all (losing the direct access to the page) :
|
||||||
*
|
*
|
||||||
* ```php
|
* ```php
|
||||||
* if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__));
|
|
||||||
* require_once(__DIR__.'/../../approot.inc.php');
|
* require_once(__DIR__.'/../../approot.inc.php');
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
define('APPROOT', dirname(__FILE__).'/');
|
define('APPROOT', __DIR__.'/');
|
||||||
define('APPCONF', APPROOT.'conf/');
|
define('APPCONF', APPROOT.'conf/');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__));
|
|
||||||
if (!defined('APPROOT')) require_once(__DIR__.'/../../approot.inc.php');
|
if (!defined('APPROOT')) require_once(__DIR__.'/../../approot.inc.php');
|
||||||
require_once(APPROOT.'/application/application.inc.php');
|
require_once(APPROOT.'/application/application.inc.php');
|
||||||
|
|
||||||
@@ -166,7 +165,7 @@ JS
|
|||||||
require_once(APPROOT."setup/runtimeenv.class.inc.php");
|
require_once(APPROOT."setup/runtimeenv.class.inc.php");
|
||||||
require_once(APPROOT.'/application/utils.inc.php');
|
require_once(APPROOT.'/application/utils.inc.php');
|
||||||
require_once(APPROOT.'/setup/backup.class.inc.php');
|
require_once(APPROOT.'/setup/backup.class.inc.php');
|
||||||
require_once(dirname(__FILE__).'/dbrestore.class.inc.php');
|
require_once(__DIR__.'/dbrestore.class.inc.php');
|
||||||
|
|
||||||
$sEnvironment = utils::ReadParam('environment', 'production', false, 'raw_data');
|
$sEnvironment = utils::ReadParam('environment', 'production', false, 'raw_data');
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__));
|
|
||||||
if (!defined('APPROOT'))
|
if (!defined('APPROOT'))
|
||||||
{
|
{
|
||||||
if (file_exists(__DIR__.'/../../approot.inc.php'))
|
if (file_exists(__DIR__.'/../../approot.inc.php'))
|
||||||
@@ -155,4 +154,4 @@ function ExecuteMainOperation($oP){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once(dirname(__FILE__).'/common.cli-execution.php');
|
require_once(__DIR__.'/common.cli-execution.php');
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__));
|
|
||||||
if (!defined('APPROOT'))
|
if (!defined('APPROOT'))
|
||||||
{
|
{
|
||||||
if (file_exists(__DIR__.'/../../approot.inc.php'))
|
if (file_exists(__DIR__.'/../../approot.inc.php'))
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__));
|
|
||||||
if (!defined('APPROOT'))
|
if (!defined('APPROOT'))
|
||||||
{
|
{
|
||||||
if (file_exists(__DIR__.'/../../approot.inc.php'))
|
if (file_exists(__DIR__.'/../../approot.inc.php'))
|
||||||
@@ -32,7 +31,7 @@ if (!defined('APPROOT'))
|
|||||||
require_once(APPROOT.'application/application.inc.php');
|
require_once(APPROOT.'application/application.inc.php');
|
||||||
require_once(APPROOT.'core/log.class.inc.php');
|
require_once(APPROOT.'core/log.class.inc.php');
|
||||||
require_once(APPROOT.'application/startup.inc.php');
|
require_once(APPROOT.'application/startup.inc.php');
|
||||||
require_once(dirname(__FILE__).'/dbrestore.class.inc.php');
|
require_once(__DIR__.'/dbrestore.class.inc.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 3.0.0 N°4227 new class to handle iTop restore manually via a CLI command
|
* @since 3.0.0 N°4227 new class to handle iTop restore manually via a CLI command
|
||||||
@@ -146,4 +145,4 @@ function ExecuteMainOperation($oP){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once(dirname(__FILE__).'/common.cli-execution.php');
|
require_once(__DIR__.'/common.cli-execution.php');
|
||||||
|
|||||||
@@ -27,9 +27,6 @@ use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
|
|||||||
use Combodo\iTop\Application\UI\Base\UIBlock;
|
use Combodo\iTop\Application\UI\Base\UIBlock;
|
||||||
use Combodo\iTop\Renderer\BlockRenderer;
|
use Combodo\iTop\Renderer\BlockRenderer;
|
||||||
|
|
||||||
if (!defined('__DIR__')) {
|
|
||||||
define('__DIR__', dirname(__FILE__));
|
|
||||||
}
|
|
||||||
if (!defined('APPROOT')) {
|
if (!defined('APPROOT')) {
|
||||||
require_once(__DIR__.'/../../approot.inc.php');
|
require_once(__DIR__.'/../../approot.inc.php');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,9 +22,6 @@
|
|||||||
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
if (!defined('__DIR__')) {
|
|
||||||
define('__DIR__', dirname(__FILE__));
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once(APPROOT.'application/utils.inc.php');
|
require_once(APPROOT.'application/utils.inc.php');
|
||||||
require_once(APPROOT.'core/log.class.inc.php');
|
require_once(APPROOT.'core/log.class.inc.php');
|
||||||
|
|||||||
@@ -94,10 +94,10 @@ class TicketsInstaller extends ModuleInstallerAPI
|
|||||||
$sLang = str_replace(' ', '_', strtolower($oConfiguration->GetDefaultLanguage()));
|
$sLang = str_replace(' ', '_', strtolower($oConfiguration->GetDefaultLanguage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sFileName = dirname(__FILE__)."/data/{$sLang}.data.itop-tickets.xml";
|
$sFileName = __DIR__."/data/{$sLang}.data.itop-tickets.xml";
|
||||||
SetupLog::Info("Searching file: $sFileName");
|
SetupLog::Info("Searching file: $sFileName");
|
||||||
if (!file_exists($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");
|
SetupLog::Info("Loading file: $sFileName");
|
||||||
$oDataLoader->StartSession($oMyChange);
|
$oDataLoader->StartSession($oMyChange);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ require_once('approot.inc.php');
|
|||||||
* Check that the configuration file exists and has the appropriate access rights
|
* 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 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))
|
if (!is_readable($sConfigFile))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1018,7 +1018,7 @@ EOF
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sPHP = "dirname(__FILE__).'/$sPath'";
|
$sPHP = "__DIR__.'/$sPath'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $sPHP;
|
return $sPHP;
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* 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(__DIR__.'/../approot.inc.php');
|
||||||
require_once(APPROOT.'/application/application.inc.php');
|
require_once(APPROOT.'/application/application.inc.php');
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
// - not outputing xml when a wrong input is given (class, attribute names)
|
// - 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(__DIR__.'/../approot.inc.php');
|
||||||
require_once(APPROOT.'/application/application.inc.php');
|
require_once(APPROOT.'/application/application.inc.php');
|
||||||
|
|
||||||
|
|||||||
@@ -22,11 +22,6 @@
|
|||||||
// - reconciliation is made on the column primary_key
|
// - 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 __DIR__.'/../approot.inc.php';
|
||||||
require_once APPROOT.'/application/application.inc.php';
|
require_once APPROOT.'/application/application.inc.php';
|
||||||
require_once APPROOT.'/application/startup.inc.php';
|
require_once APPROOT.'/application/startup.inc.php';
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ define('DEFAULT_SUBSERVICE_ID', 12);
|
|||||||
define('DEFAULT_PRODUCT', 'Request via eMail');
|
define('DEFAULT_PRODUCT', 'Request via eMail');
|
||||||
define('DEFAULT_WORKGROUP_ID', 5);
|
define('DEFAULT_WORKGROUP_ID', 5);
|
||||||
|
|
||||||
if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__));
|
|
||||||
require_once(__DIR__.'/../approot.inc.php');
|
require_once(__DIR__.'/../approot.inc.php');
|
||||||
require_once(APPROOT.'/application/application.inc.php');
|
require_once(APPROOT.'/application/application.inc.php');
|
||||||
require_once(APPROOT.'/application/startup.inc.php');
|
require_once(APPROOT.'/application/startup.inc.php');
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* 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(__DIR__.'/../approot.inc.php');
|
||||||
|
|
||||||
const EXIT_CODE_ERROR = -1;
|
const EXIT_CODE_ERROR = -1;
|
||||||
|
|||||||
@@ -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\Component\Panel\PanelUIBlockFactory;
|
||||||
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
|
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
|
||||||
|
|
||||||
if (!defined('__DIR__')) {
|
|
||||||
define('__DIR__', dirname(__FILE__));
|
|
||||||
}
|
|
||||||
require_once(__DIR__.'/../approot.inc.php');
|
require_once(__DIR__.'/../approot.inc.php');
|
||||||
require_once(APPROOT.'/application/application.inc.php');
|
require_once(APPROOT.'/application/application.inc.php');
|
||||||
require_once(APPROOT.'/application/excelexporter.class.inc.php');
|
require_once(APPROOT.'/application/excelexporter.class.inc.php');
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
* @link https://www.itophub.io/wiki/page?id=latest:advancedtopics:exportdata_v1 script documentation
|
* @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(__DIR__.'/../approot.inc.php');
|
||||||
require_once(APPROOT.'/application/application.inc.php');
|
require_once(APPROOT.'/application/application.inc.php');
|
||||||
require_once(APPROOT.'/application/excelexporter.class.inc.php');
|
require_once(APPROOT.'/application/excelexporter.class.inc.php');
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
// - not outputing xml when a wrong input is given (class, attribute names)
|
// - 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(__DIR__.'/../approot.inc.php');
|
||||||
require_once(APPROOT.'/application/application.inc.php');
|
require_once(APPROOT.'/application/application.inc.php');
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* 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(__DIR__.'/../approot.inc.php');
|
||||||
require_once(APPROOT.'/application/application.inc.php');
|
require_once(APPROOT.'/application/application.inc.php');
|
||||||
require_once(APPROOT.'/application/loginwebpage.class.inc.php');
|
require_once(APPROOT.'/application/loginwebpage.class.inc.php');
|
||||||
|
|||||||
Reference in New Issue
Block a user