N°3663 Group exception classes in /application/exceptions

Original files kept for compatibility issues :
- core/coreexception.class.inc.php

There are remaining exceptions in /core/oql, but those files are generated
This commit is contained in:
Pierre Goiffon
2021-01-26 10:46:49 +01:00
parent 5762ac38a7
commit b85b4d0067
52 changed files with 624 additions and 634 deletions

View File

@@ -1,27 +1,11 @@
<?php
// Copyright (C) 2010-2012 Combodo SARL
//
// This file is part of iTop.
//
// iTop 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, either version 3 of the License, or
// (at your option) any later version.
//
// iTop 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 iTop. If not, see <http://www.gnu.org/licenses/>
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Includes all the classes to have the application up and running
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
require_once(APPROOT.'/application/applicationcontext.class.inc.php');
@@ -31,9 +15,4 @@ require_once(APPROOT.'/application/audit.category.class.inc.php');
require_once(APPROOT.'/application/audit.rule.class.inc.php');
require_once(APPROOT.'/application/query.class.inc.php');
require_once(APPROOT.'/setup/moduleinstallation.class.inc.php');
//require_once(APPROOT.'/application/menunode.class.inc.php');
require_once(APPROOT.'/application/utils.inc.php');
class ApplicationException extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class ApplicationException extends CoreException
{
}

View File

@@ -0,0 +1,14 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Thrown when querying on an object that exists in the database but is archived
*
* @since 2.5.1 N°1108
*/
class ArchivedObjectException extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class BulkChangeException extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class CSVParserException extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class ConfigException extends CoreException
{
}

View File

@@ -0,0 +1,77 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Class CoreCannotSaveObjectException
*
* Specialized exception to raise if {@link DBObject::CheckToWrite()} fails, which allow easy data retrieval
*
* @see \DBObject::DBInsertNoReload()
* @see \DBObject::DBUpdate()
*
* @since 2.6.0 N°659 uniqueness constraint
*/
class CoreCannotSaveObjectException extends CoreException
{
/** @var string[] */
private $aIssues;
/** @var int */
private $iObjectId;
/** @var string */
private $sObjectClass;
/**
* CoreCannotSaveObjectException constructor.
*
* @param array $aContextData containing at least those keys : issues, id, class
*/
public function __construct($aContextData)
{
$this->aIssues = $aContextData['issues'];
$this->iObjectId = $aContextData['id'];
$this->sObjectClass = $aContextData['class'];
$sIssues = implode(', ', $this->aIssues);
parent::__construct($sIssues, $aContextData);
}
/**
* @return string
*/
public function getHtmlMessage()
{
$sTitle = Dict::S('UI:Error:SaveFailed');
$sContent = "<span><strong>{$sTitle}</strong></span>";
if (count($this->aIssues) == 1) {
$sIssue = reset($this->aIssues);
$sContent .= " <span>{$sIssue}</span>";
} else {
$sContent .= '<ul>';
foreach ($this->aIssues as $sError) {
$sContent .= "<li>$sError</li>";
}
$sContent .= '</ul>';
}
return $sContent;
}
public function getIssues()
{
return $this->aIssues;
}
public function getObjectId()
{
return $this->iObjectId;
}
public function getObjectClass()
{
return $this->sObjectClass;
}
}

View File

@@ -0,0 +1,108 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class CoreException extends Exception
{
/**
* CoreException constructor.
*
* @param string $sIssue error message
* @param array|null $aContextData key/value array, value MUST implements _toString
* @param string $sImpact
* @param Exception|null $oPrevious
*/
public function __construct($sIssue, $aContextData = null, $sImpact = '', $oPrevious = null)
{
$this->m_sIssue = $sIssue;
$this->m_sImpact = $sImpact;
if (is_array($aContextData)) {
$this->m_aContextData = $aContextData;
} else {
$this->m_aContextData = [];
}
$sMessage = $sIssue;
if (!empty($sImpact)) {
$sMessage .= "($sImpact)";
}
if (count($this->m_aContextData) > 0) {
$sMessage .= ": ";
$aContextItems = array();
foreach ($this->m_aContextData as $sKey => $value) {
if (is_array($value)) {
$aPairs = array();
foreach ($value as $key => $val) {
if (is_array($val)) {
$aPairs[] = $key.'=>('.implode(', ', $val).')';
} else {
$aPairs[] = $key.'=>'.$val;
}
}
$sValue = '{'.implode('; ', $aPairs).'}';
} else {
$sValue = $value;
}
$aContextItems[] = "$sKey = $sValue";
}
$sMessage .= implode(', ', $aContextItems);
}
parent::__construct($sMessage, 0, $oPrevious);
}
/**
* @return string code and message for log purposes
*/
public function getInfoLog()
{
return 'error_code='.$this->getCode().', message="'.$this->getMessage().'"';
}
public function getHtmlDesc($sHighlightHtmlBegin = '<b>', $sHighlightHtmlEnd = '</b>')
{
return $this->getMessage();
}
/**
* getTraceAsString() cannot be overrided and it is limited as only current exception stack is returned.
* we need stack of all previous exceptions
*
* @uses __tostring() already does the work.
* @since 2.7.2/ 3.0.0
*/
public function getFullStackTraceAsString()
{
return "".$this;
}
public function getTraceAsHtml()
{
$aBackTrace = $this->getTrace();
return MyHelpers::get_callstack_html(0, $this->getTrace());
// return "<pre>\n".$this->getTraceAsString()."</pre>\n";
}
public function addInfo($sKey, $value)
{
$this->m_aContextData[$sKey] = $value;
}
public function getIssue()
{
return $this->m_sIssue;
}
public function getImpact()
{
return $this->m_sImpact;
}
public function getContextData()
{
return $this->m_aContextData;
}
}

View File

@@ -0,0 +1,13 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* @since 2.7.0 N°2555
*/
class CorePortalInvalidActionRuleException extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class CoreUnexpectedValue extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class CoreWarning extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class DeleteException extends CoreException
{
}

View File

@@ -0,0 +1,14 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* A parameter stored in the {@link Config} is invalid
*
* @since 2.7.0
*/
class InvalidConfigParamException extends CoreException
{
}

View File

@@ -0,0 +1,14 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Thrown when the password is not valid
*
* @since 2.7.0
*/
class InvalidPasswordAttributeOneWayPassword extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class SecurityException extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class SynchroExceptionNotStarted extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class UserRightException extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class DictException extends CoreException
{
}

View File

@@ -0,0 +1,16 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class DictExceptionMissingString extends DictException
{
public function __construct($sLanguageCode, $sStringCode)
{
$aContext = array();
$aContext['language_code'] = $sLanguageCode;
$aContext['string_code'] = $sStringCode;
parent::__construct('Missing localized string', $aContext);
}
}

View File

@@ -0,0 +1,15 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class DictExceptionUnknownLanguage extends DictException
{
public function __construct($sLanguageCode)
{
$aContext = array();
$aContext['language_code'] = $sLanguageCode;
parent::__construct('Unknown localization language', $aContext);
}
}

View File

@@ -0,0 +1,34 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class MySQLException extends CoreException
{
/**
* MySQLException constructor.
*
* @param string $sIssue
* @param array $aContext
* @param \Exception $oException
* @param \mysqli $oMysqli to use when working with a custom mysqli instance
*/
public function __construct($sIssue, $aContext, $oException = null, $oMysqli = null)
{
if ($oException != null) {
$aContext['mysql_errno'] = $oException->getCode();
$this->code = $oException->getCode();
$aContext['mysql_error'] = $oException->getMessage();
} else if ($oMysqli != null) {
$aContext['mysql_errno'] = $oMysqli->errno;
$this->code = $oMysqli->errno;
$aContext['mysql_error'] = $oMysqli->error;
} else {
$aContext['mysql_errno'] = CMDBSource::GetErrNo();
$this->code = CMDBSource::GetErrNo();
$aContext['mysql_error'] = CMDBSource::GetError();
}
parent::__construct($sIssue, $aContext);
}
}

View File

@@ -0,0 +1,32 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Class MySQLHasGoneAwayException
*
* @see https://dev.mysql.com/doc/refman/5.7/en/gone-away.html
* @since 2.5.0 N°1195
*/
class MySQLHasGoneAwayException extends MySQLException
{
/**
* can not be a constant before PHP 5.6 (http://php.net/manual/fr/language.oop5.constants.php)
*
* @return int[]
*/
public static function getErrorCodes()
{
return array(
2006,
2013,
);
}
public function __construct($sIssue, $aContext)
{
parent::__construct($sIssue, $aContext, null);
}
}

View File

@@ -0,0 +1,13 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* @since 2.7.0 N°679
*/
class MySQLNoTransactionException extends MySQLException
{
}

View File

@@ -0,0 +1,15 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Class MySQLQueryHasNoResultException
*
* @since 2.5.0
*/
class MySQLQueryHasNoResultException extends MySQLException
{
}

View File

@@ -0,0 +1,13 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* @since 2.7.0 N°2555
*/
class CoreOqlException extends CoreException
{
}

View File

@@ -0,0 +1,13 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* @since 2.7.0 N°2555
*/
class CoreOqlMultipleResultsForbiddenException extends CoreOqlException
{
}

View File

@@ -0,0 +1,15 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Exception for {@link iProcess} implementations.<br>
* An error happened during the processing but we can go on with the next implementations.
*
* @since 2.5.0 N°1195
*/
class ProcessException extends CoreException
{
}

View File

@@ -0,0 +1,16 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Class ProcessFatalException
* Exception for iProcess implementations.<br>
* A big error occurred, we have to stop the iProcess processing.
*
* @since 2.5.0 N°1195
*/
class ProcessFatalException extends CoreException
{
}

View File

@@ -0,0 +1,12 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* @since 2.7.0 PR #89
*/
class ProcessInvalidConfigException extends ProcessException
{
}

View File

@@ -255,29 +255,3 @@ abstract class AbstractWeeklyScheduledProcess implements iScheduledProcess
*/
abstract public function Process($iUnixTimeLimit);
}
/**
* Exception for {@link iProcess} implementations.<br>
* An error happened during the processing but we can go on with the next implementations.
* @since 2.5.0 N°1195
*/
class ProcessException extends CoreException
{
}
/**
* @since 2.7.0 PR #89
*/
class ProcessInvalidConfigException extends ProcessException
{
}
/**
* Class ProcessFatalException
* Exception for iProcess implementations.<br>
* A big error occurred, we have to stop the iProcess processing.
* @since 2.5.0 N°1195
*/
class ProcessFatalException extends CoreException
{
}

View File

@@ -1,44 +1,13 @@
<?php
// Copyright (C) 2010-2017 Combodo SARL
//
// This file is part of iTop.
//
// iTop 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, either version 3 of the License, or
// (at your option) any later version.
//
// iTop 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 iTop. If not, see <http://www.gnu.org/licenses/>
/**
* Bulk change facility (common to interactive and batch usages)
*
* @copyright Copyright (C) 2010-2015 Combodo SARL
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
// The BOM is added at the head of exported UTF-8 CSV data, and removed (if present) from input UTF-8 data.
// This helps MS-Excel (Version > 2007, Windows only) in changing its interpretation of a CSV file (by default Excel reads data as ISO-8859-1 -not 100% sure!)
define('UTF8_BOM', chr(239).chr(187).chr(191)); // 0xEF, 0xBB, 0xBF
/**
* BulkChange
* Interpret a given data set and update the DB accordingly (fake mode avail.)
*
* @package iTopORM
*/
class BulkChangeException extends CoreException
{
}
/**
* CellChangeSpec
@@ -245,6 +214,7 @@ class RowStatus_Issue extends RowStatus
/**
* BulkChange
* Interpret a given data set and update the DB accordingly (fake mode avail.)
*
* @package iTopORM
*/

View File

@@ -32,8 +32,6 @@
* @package iTopORM
*/
require_once('coreexception.class.inc.php');
require_once('config.class.inc.php');
require_once('log.class.inc.php');
require_once('kpi.class.inc.php');

View File

@@ -27,86 +27,6 @@
require_once('MyHelpers.class.inc.php');
require_once(APPROOT.'core/kpi.class.inc.php');
class MySQLException extends CoreException
{
/**
* MySQLException constructor.
*
* @param string $sIssue
* @param array $aContext
* @param \Exception $oException
* @param \mysqli $oMysqli to use when working with a custom mysqli instance
*/
public function __construct($sIssue, $aContext, $oException = null, $oMysqli = null)
{
if ($oException != null)
{
$aContext['mysql_errno'] = $oException->getCode();
$this->code = $oException->getCode();
$aContext['mysql_error'] = $oException->getMessage();
}
else if ($oMysqli != null)
{
$aContext['mysql_errno'] = $oMysqli->errno;
$this->code = $oMysqli->errno;
$aContext['mysql_error'] = $oMysqli->error;
}
else
{
$aContext['mysql_errno'] = CMDBSource::GetErrNo();
$this->code = CMDBSource::GetErrNo();
$aContext['mysql_error'] = CMDBSource::GetError();
}
parent::__construct($sIssue, $aContext);
}
}
/**
* Class MySQLQueryHasNoResultException
*
* @since 2.5.0
*/
class MySQLQueryHasNoResultException extends MySQLException
{
}
/**
* Class MySQLHasGoneAwayException
*
* @since 2.5.0
* @see itop bug 1195
* @see https://dev.mysql.com/doc/refman/5.7/en/gone-away.html
*/
class MySQLHasGoneAwayException extends MySQLException
{
/**
* can not be a constant before PHP 5.6 (http://php.net/manual/fr/language.oop5.constants.php)
*
* @return int[]
*/
public static function getErrorCodes()
{
return array(
2006,
2013
);
}
public function __construct($sIssue, $aContext)
{
parent::__construct($sIssue, $aContext, null);
}
}
/**
* @since 2.7.0 N°679
*/
class MySQLNoTransactionException extends MySQLException
{
}
/**
* CMDBSource
@@ -1420,13 +1340,14 @@ class CMDBSource
}
/**
* @see https://dev.mysql.com/doc/refman/5.7/en/charset-table.html
*
* @param string $sTableName
*
* @return string query to upgrade table charset and collation if needed, null if not
* @throws \MySQLException
*
* @since 2.5.0 N°1001 switch to utf8mb4
* @see https://dev.mysql.com/doc/refman/5.7/en/charset-table.html
*/
public static function DBCheckTableCharsetAndCollation($sTableName)
{
@@ -1572,11 +1493,11 @@ class CMDBSource
}
/**
* @see https://dev.mysql.com/doc/refman/5.7/en/charset-database.html
* @return string query to upgrade database charset and collation if needed, null if not
* @throws \MySQLException
*
* @since 2.5.0 N°1001 switch to utf8mb4
* @see https://dev.mysql.com/doc/refman/5.7/en/charset-database.html
*/
public static function DBCheckCharsetAndCollation()
{

View File

@@ -39,14 +39,9 @@ define('ACCESS_READONLY', 0);
* @license http://opensource.org/licenses/AGPL-3.0
*/
require_once('coreexception.class.inc.php');
require_once('attributedef.class.inc.php'); // For the defines
require_once('simplecrypt.class.inc.php');
class ConfigException extends CoreException
{
}
// was utf8 but it only supports BMP chars (https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html)
// so we switched to utf8mb4 in iTop 2.5, adding dependency to MySQL 5.5.3
// The config params db_character_set and db_collation were introduced as a temporary workaround and removed in iTop 2.5

View File

@@ -1,267 +1,6 @@
<?php
// Copyright (C) 2010-2012 Combodo SARL
//
// This file is part of iTop.
//
// iTop 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, either version 3 of the License, or
// (at your option) any later version.
//
// iTop 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 iTop. If not, see <http://www.gnu.org/licenses/>
/**
* Exception management
* This file is only here for compatibility issues. Will be removed in iTop 3.1.0 (N°3664)
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class CoreException extends Exception
{
/**
* CoreException constructor.
*
* @param string $sIssue error message
* @param array|null $aContextData key/value array, value MUST implements _toString
* @param string $sImpact
* @param Exception|null $oPrevious
*/
public function __construct($sIssue, $aContextData = null, $sImpact = '', $oPrevious = null)
{
$this->m_sIssue = $sIssue;
$this->m_sImpact = $sImpact;
if (is_array($aContextData)) {
$this->m_aContextData = $aContextData;
} else {
$this->m_aContextData = [];
}
$sMessage = $sIssue;
if (!empty($sImpact)) {
$sMessage .= "($sImpact)";
}
if (count($this->m_aContextData) > 0) {
$sMessage .= ": ";
$aContextItems = array();
foreach ($this->m_aContextData as $sKey => $value) {
if (is_array($value)) {
$aPairs = array();
foreach ($value as $key => $val) {
if (is_array($val)) {
$aPairs[] = $key.'=>('.implode(', ', $val).')';
} else {
$aPairs[] = $key.'=>'.$val;
}
}
$sValue = '{'.implode('; ', $aPairs).'}';
}
else
{
$sValue = $value;
}
$aContextItems[] = "$sKey = $sValue";
}
$sMessage .= implode(', ', $aContextItems);
}
parent::__construct($sMessage, 0, $oPrevious);
}
/**
* @return string code and message for log purposes
*/
public function getInfoLog()
{
return 'error_code='.$this->getCode().', message="'.$this->getMessage().'"';
}
public function getHtmlDesc($sHighlightHtmlBegin = '<b>', $sHighlightHtmlEnd = '</b>')
{
return $this->getMessage();
}
/**
* getTraceAsString() cannot be overrided and it is limited as only current exception stack is returned.
* we need stack of all previous exceptions
* @uses __tostring() already does the work.
* @since 2.7.2/ 3.0.0
*/
public function getFullStackTraceAsString(){
return "" . $this;
}
public function getTraceAsHtml()
{
$aBackTrace = $this->getTrace();
return MyHelpers::get_callstack_html(0, $this->getTrace());
// return "<pre>\n".$this->getTraceAsString()."</pre>\n";
}
public function addInfo($sKey, $value)
{
$this->m_aContextData[$sKey] = $value;
}
public function getIssue()
{
return $this->m_sIssue;
}
public function getImpact()
{
return $this->m_sImpact;
}
public function getContextData()
{
return $this->m_aContextData;
}
}
/**
* Class CoreCannotSaveObjectException
*
* Specialized exception to raise if {@link DBObject::CheckToWrite()} fails, which allow easy data retrieval
*
* @see \DBObject::DBInsertNoReload()
* @see \DBObject::DBUpdate()
*
* @since 2.6.0 N°659 uniqueness constraint
*/
class CoreCannotSaveObjectException extends CoreException
{
/** @var string[] */
private $aIssues;
/** @var int */
private $iObjectId;
/** @var string */
private $sObjectClass;
/**
* CoreCannotSaveObjectException constructor.
*
* @param array $aContextData containing at least those keys : issues, id, class
*/
public function __construct($aContextData)
{
$this->aIssues = $aContextData['issues'];
$this->iObjectId = $aContextData['id'];
$this->sObjectClass = $aContextData['class'];
$sIssues = implode(', ', $this->aIssues);
parent::__construct($sIssues, $aContextData);
}
/**
* @return string
*/
public function getHtmlMessage()
{
$sTitle = Dict::S('UI:Error:SaveFailed');
$sContent = "<span><strong>{$sTitle}</strong></span>";
if (count($this->aIssues) == 1)
{
$sIssue = reset($this->aIssues);
$sContent .= " <span>{$sIssue}</span>";
}
else
{
$sContent .= '<ul>';
foreach ($this->aIssues as $sError)
{
$sContent .= "<li>$sError</li>";
}
$sContent .= '</ul>';
}
return $sContent;
}
public function getIssues()
{
return $this->aIssues;
}
public function getObjectId()
{
return $this->iObjectId;
}
public function getObjectClass()
{
return $this->sObjectClass;
}
}
/**
* @since 2.7.0 N°2555
*/
class CorePortalInvalidActionRuleException extends CoreException
{
}
/**
* @since 2.7.0 N°2555
*/
class CoreOqlException extends CoreException
{
}
/**
* @since 2.7.0 N°2555
*/
class CoreOqlMultipleResultsForbiddenException extends CoreOqlException
{
}
class CoreWarning extends CoreException
{
}
class CoreUnexpectedValue extends CoreException
{
}
class SecurityException extends CoreException
{
}
/**
* Throwned when querying on an object that exists in the database but is archived
*
* @see N.1108
* @since 2.5.1
*/
class ArchivedObjectException extends CoreException
{
}
/**
* A parameter stored in the {@link Config} is invalid
*
* @since 2.7.0
*/
class InvalidConfigParamException extends CoreException
{
}
/**
* Throwned when the password is not valid
*
* @since 2.7.0
*/
class InvalidPasswordAttributeOneWayPassword extends CoreException
{
}
* @deprecated 3.0.0 N°3663 Exception classes were moved to `/application/exceptions`, use autoloader instead of require !
*/

View File

@@ -1,34 +1,10 @@
<?php
// Copyright (C) 2010-2012 Combodo SARL
//
// This file is part of iTop.
//
// iTop 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, either version 3 of the License, or
// (at your option) any later version.
//
// iTop 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 iTop. If not, see <http://www.gnu.org/licenses/>
/**
* CSV parser
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class CSVParserException extends CoreException
{
}
define('stSTARTING', 1); //grey zone: the type is undetermined
define('stRAW', 2); //building a non-qualified string
define('stQUALIFIED', 3); //building qualified string

View File

@@ -1,32 +1,12 @@
<?php
// Copyright (C) 2010-2013 Combodo SARL
//
// This file is part of iTop.
//
// iTop 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, either version 3 of the License, or
// (at your option) any later version.
//
// iTop 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 iTop. If not, see <http://www.gnu.org/licenses/>
/**
* Algorithm to delete object(s) and maintain data integrity
*
* @copyright Copyright (C) 2010-2013 Combodo SARL
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class DeleteException extends CoreException
{
}
/**
* Algorithm to delete object(s) and maintain data integrity
*/
/**
* Deletion plan (other objects to be deleted/modified, eventual issues, etc.)

View File

@@ -16,45 +16,16 @@
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
/**
* Class Dict
* Management of localizable strings
*
* @copyright Copyright (C) 2010-2018 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class DictException extends CoreException
{
}
class DictExceptionUnknownLanguage extends DictException
{
public function __construct($sLanguageCode)
{
$aContext = array();
$aContext['language_code'] = $sLanguageCode;
parent::__construct('Unknown localization language', $aContext);
}
}
class DictExceptionMissingString extends DictException
{
public function __construct($sLanguageCode, $sStringCode)
{
$aContext = array();
$aContext['language_code'] = $sLanguageCode;
$aContext['string_code'] = $sStringCode;
parent::__construct('Missing localized string', $aContext);
}
}
define('DICT_ERR_STRING', 1); // when a string is missing, return the identifier
define('DICT_ERR_EXCEPTION', 2); // when a string is missing, throw an exception
//define('DICT_ERR_LOG', 3); // when a string is missing, log an error
/**
* Class Dict
* Management of localizable strings
*/
class Dict
{
protected static $m_iErrorMode = DICT_ERR_STRING;

View File

@@ -1,27 +1,4 @@
<?php
/**
* Copyright (C) 2013-2020 Combodo SARL
*
* This file is part of iTop.
*
* iTop 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, either version 3 of the License, or
* (at your option) any later version.
*
* iTop 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
*/
class UserRightException extends CoreException
{
}
define('UR_ALLOWED_NO', 0);
define('UR_ALLOWED_YES', 1);
define('UR_ALLOWED_DEPENDS', 2);

View File

@@ -20,11 +20,11 @@ return array(
'ActionNotification' => $baseDir . '/core/action.class.inc.php',
'AjaxPage' => $baseDir . '/sources/application/WebPage/AjaxPage.php',
'ApplicationContext' => $baseDir . '/application/applicationcontext.class.inc.php',
'ApplicationException' => $baseDir . '/application/application.inc.php',
'ApplicationException' => $baseDir . '/application/exceptions/ApplicationException.php',
'ApplicationMenu' => $baseDir . '/application/menunode.class.inc.php',
'ApplicationPopupMenuItem' => $baseDir . '/application/applicationextension.inc.php',
'Archive_Tar' => $vendorDir . '/pear/archive_tar/Archive/Tar.php',
'ArchivedObjectException' => $baseDir . '/core/coreexception.class.inc.php',
'ArchivedObjectException' => $baseDir . '/application/exceptions/ArchivedObjectException.php',
'ArithmeticError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php',
'AssertionError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/AssertionError.php',
'AsyncSendEmail' => $baseDir . '/core/asynctask.class.inc.php',
@@ -93,7 +93,7 @@ return array(
'BinaryExpression' => $baseDir . '/core/oql/expression.class.inc.php',
'BinaryOqlExpression' => $baseDir . '/core/oql/oqlquery.class.inc.php',
'BulkChange' => $baseDir . '/core/bulkchange.class.inc.php',
'BulkChangeException' => $baseDir . '/core/bulkchange.class.inc.php',
'BulkChangeException' => $baseDir . '/application/exceptions/BulkChangeException.php',
'BulkExport' => $baseDir . '/core/bulkexport.class.inc.php',
'BulkExportException' => $baseDir . '/core/bulkexport.class.inc.php',
'BulkExportMissingParameterException' => $baseDir . '/core/bulkexport.class.inc.php',
@@ -127,7 +127,7 @@ return array(
'CSVBulkExport' => $baseDir . '/core/csvbulkexport.class.inc.php',
'CSVPage' => $baseDir . '/sources/application/WebPage/CSVPage.php',
'CSVParser' => $baseDir . '/core/csvparser.class.inc.php',
'CSVParserException' => $baseDir . '/core/csvparser.class.inc.php',
'CSVParserException' => $baseDir . '/application/exceptions/CSVParserException.php',
'CaptureWebPage' => $baseDir . '/sources/application/WebPage/CaptureWebPage.php',
'CellChangeSpec' => $baseDir . '/core/bulkchange.class.inc.php',
'CellStatus_Ambiguous' => $baseDir . '/core/bulkchange.class.inc.php',
@@ -148,7 +148,7 @@ return array(
'Combodo\\iTop\\Application\\Search\\CriterionParser' => $baseDir . '/sources/application/search/criterionparser.class.inc.php',
'Combodo\\iTop\\Application\\Search\\SearchForm' => $baseDir . '/sources/application/search/searchform.class.inc.php',
'Combodo\\iTop\\Application\\TwigBase\\Controller\\Controller' => $baseDir . '/sources/application/TwigBase/Controller/Controller.php',
'Combodo\\iTop\\Application\\TwigBase\\Controller\\PageNotFoundException' => $baseDir . '/sources/application/TwigBase/Controller/Controller.php',
'Combodo\\iTop\\Application\\TwigBase\\Controller\\PageNotFoundException' => $baseDir . '/application/exceptions/PageNotFoundException.php',
'Combodo\\iTop\\Application\\TwigBase\\Twig\\Extension' => $baseDir . '/sources/application/TwigBase/Twig/Extension.php',
'Combodo\\iTop\\Application\\TwigBase\\Twig\\TwigHelper' => $baseDir . '/sources/application/TwigBase/Twig/TwigHelper.php',
'Combodo\\iTop\\Application\\TwigBase\\UI\\UIBlockExtension' => $baseDir . '/sources/application/TwigBase/UI/UIBlockExtension.php',
@@ -328,18 +328,18 @@ return array(
'CompileCSSService' => $baseDir . '/application/themehandler.class.inc.php',
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'Config' => $baseDir . '/core/config.class.inc.php',
'ConfigException' => $baseDir . '/core/config.class.inc.php',
'ConfigException' => $baseDir . '/application/exceptions/ConfigException.php',
'ConfigPlaceholdersResolver' => $baseDir . '/core/config.class.inc.php',
'Console_Getopt' => $vendorDir . '/pear/console_getopt/Console/Getopt.php',
'ContextTag' => $baseDir . '/core/contexttag.class.inc.php',
'CoreCannotSaveObjectException' => $baseDir . '/core/coreexception.class.inc.php',
'CoreException' => $baseDir . '/core/coreexception.class.inc.php',
'CoreOqlException' => $baseDir . '/core/coreexception.class.inc.php',
'CoreOqlMultipleResultsForbiddenException' => $baseDir . '/core/coreexception.class.inc.php',
'CorePortalInvalidActionRuleException' => $baseDir . '/core/coreexception.class.inc.php',
'CoreCannotSaveObjectException' => $baseDir . '/application/exceptions/CoreCannotSaveObjectException.php',
'CoreException' => $baseDir . '/application/exceptions/CoreException.php',
'CoreOqlException' => $baseDir . '/application/exceptions/oql/CoreOqlException.php',
'CoreOqlMultipleResultsForbiddenException' => $baseDir . '/application/exceptions/oql/CoreOqlMultipleResultsForbiddenException.php',
'CorePortalInvalidActionRuleException' => $baseDir . '/application/exceptions/CorePortalInvalidActionRuleException.php',
'CoreServices' => $baseDir . '/core/restservices.class.inc.php',
'CoreUnexpectedValue' => $baseDir . '/core/coreexception.class.inc.php',
'CoreWarning' => $baseDir . '/core/coreexception.class.inc.php',
'CoreUnexpectedValue' => $baseDir . '/application/exceptions/CoreUnexpectedValue.php',
'CoreWarning' => $baseDir . '/application/exceptions/CoreWarning.php',
'CryptEngine' => $baseDir . '/core/simplecrypt.class.inc.php',
'CustomFieldsHandler' => $baseDir . '/core/customfieldshandler.class.inc.php',
'DBObject' => $baseDir . '/core/dbobject.class.php',
@@ -377,7 +377,7 @@ return array(
'DefaultLogFileNameBuilder' => $baseDir . '/core/log.class.inc.php',
'DefaultMetricComputer' => $baseDir . '/core/computing.inc.php',
'DefaultWorkingTimeComputer' => $baseDir . '/core/computing.inc.php',
'DeleteException' => $baseDir . '/core/deletionplan.class.inc.php',
'DeleteException' => $baseDir . '/application/exceptions/DeleteException.php',
'DeletionPlan' => $baseDir . '/core/deletionplan.class.inc.php',
'DesignerBooleanField' => $baseDir . '/application/forms.class.inc.php',
'DesignerComboField' => $baseDir . '/application/forms.class.inc.php',
@@ -395,9 +395,9 @@ return array(
'DesignerTabularForm' => $baseDir . '/application/forms.class.inc.php',
'DesignerTextField' => $baseDir . '/application/forms.class.inc.php',
'Dict' => $baseDir . '/core/dict.class.inc.php',
'DictException' => $baseDir . '/core/dict.class.inc.php',
'DictExceptionMissingString' => $baseDir . '/core/dict.class.inc.php',
'DictExceptionUnknownLanguage' => $baseDir . '/core/dict.class.inc.php',
'DictException' => $baseDir . '/application/exceptions/dict/DictException.php',
'DictExceptionMissingString' => $baseDir . '/application/exceptions/dict/DictExceptionMissingString.php',
'DictExceptionUnknownLanguage' => $baseDir . '/application/exceptions/dict/DictExceptionUnknownLanguage.php',
'DisplayBlock' => $baseDir . '/application/displayblock.class.inc.php',
'DisplayTemplate' => $baseDir . '/application/template.class.inc.php',
'DisplayableEdge' => $baseDir . '/core/displayablegraph.class.inc.php',
@@ -452,8 +452,8 @@ return array(
'IntervalExpression' => $baseDir . '/core/oql/expression.class.inc.php',
'IntervalOqlExpression' => $baseDir . '/core/oql/oqlquery.class.inc.php',
'Introspection' => $baseDir . '/core/introspection.class.inc.php',
'InvalidConfigParamException' => $baseDir . '/core/coreexception.class.inc.php',
'InvalidPasswordAttributeOneWayPassword' => $baseDir . '/core/coreexception.class.inc.php',
'InvalidConfigParamException' => $baseDir . '/application/exceptions/InvalidConfigParamException.php',
'InvalidPasswordAttributeOneWayPassword' => $baseDir . '/application/exceptions/InvalidPasswordAttributeOneWayPassword.php',
'IssueLog' => $baseDir . '/core/log.class.inc.php',
'ItopCounter' => $baseDir . '/core/counter.class.inc.php',
'JSButtonItem' => $baseDir . '/application/applicationextension.inc.php',
@@ -483,10 +483,10 @@ return array(
'ModuleHandlerApiInterface' => $baseDir . '/core/modulehandler.class.inc.php',
'MonthlyRotatingLogFileNameBuilder' => $baseDir . '/core/log.class.inc.php',
'MyHelpers' => $baseDir . '/core/MyHelpers.class.inc.php',
'MySQLException' => $baseDir . '/core/cmdbsource.class.inc.php',
'MySQLHasGoneAwayException' => $baseDir . '/core/cmdbsource.class.inc.php',
'MySQLNoTransactionException' => $baseDir . '/core/cmdbsource.class.inc.php',
'MySQLQueryHasNoResultException' => $baseDir . '/core/cmdbsource.class.inc.php',
'MySQLException' => $baseDir . '/application/exceptions/mysql/MySQLException.php',
'MySQLHasGoneAwayException' => $baseDir . '/application/exceptions/mysql/MySQLHasGoneAwayException.php',
'MySQLNoTransactionException' => $baseDir . '/application/exceptions/mysql/MySQLNoTransactionException.php',
'MySQLQueryHasNoResultException' => $baseDir . '/application/exceptions/mysql/MySQLQueryHasNoResultException.php',
'NestedQueryExpression' => $baseDir . '/core/oql/expression.class.inc.php',
'NestedQueryOqlExpression' => $baseDir . '/core/oql/oqlquery.class.inc.php',
'NewObjectMenuNode' => $baseDir . '/application/menunode.class.inc.php',
@@ -744,9 +744,9 @@ return array(
'PortalDispatcher' => $baseDir . '/application/portaldispatcher.class.inc.php',
'PortalURLMaker' => $baseDir . '/application/applicationcontext.class.inc.php',
'PrintableDataTable' => $baseDir . '/application/datatable.class.inc.php',
'ProcessException' => $baseDir . '/core/backgroundprocess.inc.php',
'ProcessFatalException' => $baseDir . '/core/backgroundprocess.inc.php',
'ProcessInvalidConfigException' => $baseDir . '/core/backgroundprocess.inc.php',
'ProcessException' => $baseDir . '/application/exceptions/process/ProcessException.php',
'ProcessFatalException' => $baseDir . '/application/exceptions/process/ProcessFatalException.php',
'ProcessInvalidConfigException' => $baseDir . '/application/exceptions/process/ProcessInvalidConfigException.php',
'Psr\\Cache\\CacheException' => $vendorDir . '/psr/cache/src/CacheException.php',
'Psr\\Cache\\CacheItemInterface' => $vendorDir . '/psr/cache/src/CacheItemInterface.php',
'Psr\\Cache\\CacheItemPoolInterface' => $vendorDir . '/psr/cache/src/CacheItemPoolInterface.php',
@@ -824,7 +824,7 @@ return array(
'ScssPhp\\ScssPhp\\Util' => $vendorDir . '/scssphp/scssphp/src/Util.php',
'ScssPhp\\ScssPhp\\Version' => $vendorDir . '/scssphp/scssphp/src/Version.php',
'SearchMenuNode' => $baseDir . '/application/menunode.class.inc.php',
'SecurityException' => $baseDir . '/core/coreexception.class.inc.php',
'SecurityException' => $baseDir . '/application/exceptions/SecurityException.php',
'SeparatorPopupMenuItem' => $baseDir . '/application/applicationextension.inc.php',
'SessionUpdateTimestampHandlerInterface' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php',
'SetupLog' => $baseDir . '/core/log.class.inc.php',
@@ -1829,6 +1829,7 @@ return array(
'Symfony\\Polyfill\\Util\\TestListenerForV6' => $vendorDir . '/symfony/polyfill-util/TestListenerForV6.php',
'Symfony\\Polyfill\\Util\\TestListenerForV7' => $vendorDir . '/symfony/polyfill-util/TestListenerForV7.php',
'Symfony\\Polyfill\\Util\\TestListenerTrait' => $vendorDir . '/symfony/polyfill-util/TestListenerTrait.php',
'SynchroExceptionNotStarted' => $baseDir . '/application/exceptions/SynchroExceptionNotStarted.php',
'System' => $vendorDir . '/pear/pear-core-minimal/src/System.php',
'TCPDF' => $vendorDir . '/combodo/tcpdf/tcpdf.php',
'TCPDF2DBarcode' => $vendorDir . '/combodo/tcpdf/tcpdf_barcodes_2d.php',
@@ -2246,7 +2247,7 @@ return array(
'User' => $baseDir . '/core/userrights.class.inc.php',
'UserDashboard' => $baseDir . '/application/user.dashboard.class.inc.php',
'UserInternal' => $baseDir . '/core/userrights.class.inc.php',
'UserRightException' => $baseDir . '/core/userrights.class.inc.php',
'UserRightException' => $baseDir . '/application/exceptions/UserRightException.php',
'UserRights' => $baseDir . '/core/userrights.class.inc.php',
'UserRightsAddOnAPI' => $baseDir . '/core/userrights.class.inc.php',
'ValueSetDefinition' => $baseDir . '/core/valuesetdef.class.inc.php',

View File

@@ -250,11 +250,11 @@ class ComposerStaticInit0018331147de7601e7552f7da8e3bb8b
'ActionNotification' => __DIR__ . '/../..' . '/core/action.class.inc.php',
'AjaxPage' => __DIR__ . '/../..' . '/sources/application/WebPage/AjaxPage.php',
'ApplicationContext' => __DIR__ . '/../..' . '/application/applicationcontext.class.inc.php',
'ApplicationException' => __DIR__ . '/../..' . '/application/application.inc.php',
'ApplicationException' => __DIR__ . '/../..' . '/application/exceptions/ApplicationException.php',
'ApplicationMenu' => __DIR__ . '/../..' . '/application/menunode.class.inc.php',
'ApplicationPopupMenuItem' => __DIR__ . '/../..' . '/application/applicationextension.inc.php',
'Archive_Tar' => __DIR__ . '/..' . '/pear/archive_tar/Archive/Tar.php',
'ArchivedObjectException' => __DIR__ . '/../..' . '/core/coreexception.class.inc.php',
'ArchivedObjectException' => __DIR__ . '/../..' . '/application/exceptions/ArchivedObjectException.php',
'ArithmeticError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php',
'AssertionError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/AssertionError.php',
'AsyncSendEmail' => __DIR__ . '/../..' . '/core/asynctask.class.inc.php',
@@ -323,7 +323,7 @@ class ComposerStaticInit0018331147de7601e7552f7da8e3bb8b
'BinaryExpression' => __DIR__ . '/../..' . '/core/oql/expression.class.inc.php',
'BinaryOqlExpression' => __DIR__ . '/../..' . '/core/oql/oqlquery.class.inc.php',
'BulkChange' => __DIR__ . '/../..' . '/core/bulkchange.class.inc.php',
'BulkChangeException' => __DIR__ . '/../..' . '/core/bulkchange.class.inc.php',
'BulkChangeException' => __DIR__ . '/../..' . '/application/exceptions/BulkChangeException.php',
'BulkExport' => __DIR__ . '/../..' . '/core/bulkexport.class.inc.php',
'BulkExportException' => __DIR__ . '/../..' . '/core/bulkexport.class.inc.php',
'BulkExportMissingParameterException' => __DIR__ . '/../..' . '/core/bulkexport.class.inc.php',
@@ -357,7 +357,7 @@ class ComposerStaticInit0018331147de7601e7552f7da8e3bb8b
'CSVBulkExport' => __DIR__ . '/../..' . '/core/csvbulkexport.class.inc.php',
'CSVPage' => __DIR__ . '/../..' . '/sources/application/WebPage/CSVPage.php',
'CSVParser' => __DIR__ . '/../..' . '/core/csvparser.class.inc.php',
'CSVParserException' => __DIR__ . '/../..' . '/core/csvparser.class.inc.php',
'CSVParserException' => __DIR__ . '/../..' . '/application/exceptions/CSVParserException.php',
'CaptureWebPage' => __DIR__ . '/../..' . '/sources/application/WebPage/CaptureWebPage.php',
'CellChangeSpec' => __DIR__ . '/../..' . '/core/bulkchange.class.inc.php',
'CellStatus_Ambiguous' => __DIR__ . '/../..' . '/core/bulkchange.class.inc.php',
@@ -378,7 +378,7 @@ class ComposerStaticInit0018331147de7601e7552f7da8e3bb8b
'Combodo\\iTop\\Application\\Search\\CriterionParser' => __DIR__ . '/../..' . '/sources/application/search/criterionparser.class.inc.php',
'Combodo\\iTop\\Application\\Search\\SearchForm' => __DIR__ . '/../..' . '/sources/application/search/searchform.class.inc.php',
'Combodo\\iTop\\Application\\TwigBase\\Controller\\Controller' => __DIR__ . '/../..' . '/sources/application/TwigBase/Controller/Controller.php',
'Combodo\\iTop\\Application\\TwigBase\\Controller\\PageNotFoundException' => __DIR__ . '/../..' . '/sources/application/TwigBase/Controller/Controller.php',
'Combodo\\iTop\\Application\\TwigBase\\Controller\\PageNotFoundException' => __DIR__ . '/../..' . '/application/exceptions/PageNotFoundException.php',
'Combodo\\iTop\\Application\\TwigBase\\Twig\\Extension' => __DIR__ . '/../..' . '/sources/application/TwigBase/Twig/Extension.php',
'Combodo\\iTop\\Application\\TwigBase\\Twig\\TwigHelper' => __DIR__ . '/../..' . '/sources/application/TwigBase/Twig/TwigHelper.php',
'Combodo\\iTop\\Application\\TwigBase\\UI\\UIBlockExtension' => __DIR__ . '/../..' . '/sources/application/TwigBase/UI/UIBlockExtension.php',
@@ -558,18 +558,18 @@ class ComposerStaticInit0018331147de7601e7552f7da8e3bb8b
'CompileCSSService' => __DIR__ . '/../..' . '/application/themehandler.class.inc.php',
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'Config' => __DIR__ . '/../..' . '/core/config.class.inc.php',
'ConfigException' => __DIR__ . '/../..' . '/core/config.class.inc.php',
'ConfigException' => __DIR__ . '/../..' . '/application/exceptions/ConfigException.php',
'ConfigPlaceholdersResolver' => __DIR__ . '/../..' . '/core/config.class.inc.php',
'Console_Getopt' => __DIR__ . '/..' . '/pear/console_getopt/Console/Getopt.php',
'ContextTag' => __DIR__ . '/../..' . '/core/contexttag.class.inc.php',
'CoreCannotSaveObjectException' => __DIR__ . '/../..' . '/core/coreexception.class.inc.php',
'CoreException' => __DIR__ . '/../..' . '/core/coreexception.class.inc.php',
'CoreOqlException' => __DIR__ . '/../..' . '/core/coreexception.class.inc.php',
'CoreOqlMultipleResultsForbiddenException' => __DIR__ . '/../..' . '/core/coreexception.class.inc.php',
'CorePortalInvalidActionRuleException' => __DIR__ . '/../..' . '/core/coreexception.class.inc.php',
'CoreCannotSaveObjectException' => __DIR__ . '/../..' . '/application/exceptions/CoreCannotSaveObjectException.php',
'CoreException' => __DIR__ . '/../..' . '/application/exceptions/CoreException.php',
'CoreOqlException' => __DIR__ . '/../..' . '/application/exceptions/oql/CoreOqlException.php',
'CoreOqlMultipleResultsForbiddenException' => __DIR__ . '/../..' . '/application/exceptions/oql/CoreOqlMultipleResultsForbiddenException.php',
'CorePortalInvalidActionRuleException' => __DIR__ . '/../..' . '/application/exceptions/CorePortalInvalidActionRuleException.php',
'CoreServices' => __DIR__ . '/../..' . '/core/restservices.class.inc.php',
'CoreUnexpectedValue' => __DIR__ . '/../..' . '/core/coreexception.class.inc.php',
'CoreWarning' => __DIR__ . '/../..' . '/core/coreexception.class.inc.php',
'CoreUnexpectedValue' => __DIR__ . '/../..' . '/application/exceptions/CoreUnexpectedValue.php',
'CoreWarning' => __DIR__ . '/../..' . '/application/exceptions/CoreWarning.php',
'CryptEngine' => __DIR__ . '/../..' . '/core/simplecrypt.class.inc.php',
'CustomFieldsHandler' => __DIR__ . '/../..' . '/core/customfieldshandler.class.inc.php',
'DBObject' => __DIR__ . '/../..' . '/core/dbobject.class.php',
@@ -607,7 +607,7 @@ class ComposerStaticInit0018331147de7601e7552f7da8e3bb8b
'DefaultLogFileNameBuilder' => __DIR__ . '/../..' . '/core/log.class.inc.php',
'DefaultMetricComputer' => __DIR__ . '/../..' . '/core/computing.inc.php',
'DefaultWorkingTimeComputer' => __DIR__ . '/../..' . '/core/computing.inc.php',
'DeleteException' => __DIR__ . '/../..' . '/core/deletionplan.class.inc.php',
'DeleteException' => __DIR__ . '/../..' . '/application/exceptions/DeleteException.php',
'DeletionPlan' => __DIR__ . '/../..' . '/core/deletionplan.class.inc.php',
'DesignerBooleanField' => __DIR__ . '/../..' . '/application/forms.class.inc.php',
'DesignerComboField' => __DIR__ . '/../..' . '/application/forms.class.inc.php',
@@ -625,9 +625,9 @@ class ComposerStaticInit0018331147de7601e7552f7da8e3bb8b
'DesignerTabularForm' => __DIR__ . '/../..' . '/application/forms.class.inc.php',
'DesignerTextField' => __DIR__ . '/../..' . '/application/forms.class.inc.php',
'Dict' => __DIR__ . '/../..' . '/core/dict.class.inc.php',
'DictException' => __DIR__ . '/../..' . '/core/dict.class.inc.php',
'DictExceptionMissingString' => __DIR__ . '/../..' . '/core/dict.class.inc.php',
'DictExceptionUnknownLanguage' => __DIR__ . '/../..' . '/core/dict.class.inc.php',
'DictException' => __DIR__ . '/../..' . '/application/exceptions/dict/DictException.php',
'DictExceptionMissingString' => __DIR__ . '/../..' . '/application/exceptions/dict/DictExceptionMissingString.php',
'DictExceptionUnknownLanguage' => __DIR__ . '/../..' . '/application/exceptions/dict/DictExceptionUnknownLanguage.php',
'DisplayBlock' => __DIR__ . '/../..' . '/application/displayblock.class.inc.php',
'DisplayTemplate' => __DIR__ . '/../..' . '/application/template.class.inc.php',
'DisplayableEdge' => __DIR__ . '/../..' . '/core/displayablegraph.class.inc.php',
@@ -682,8 +682,8 @@ class ComposerStaticInit0018331147de7601e7552f7da8e3bb8b
'IntervalExpression' => __DIR__ . '/../..' . '/core/oql/expression.class.inc.php',
'IntervalOqlExpression' => __DIR__ . '/../..' . '/core/oql/oqlquery.class.inc.php',
'Introspection' => __DIR__ . '/../..' . '/core/introspection.class.inc.php',
'InvalidConfigParamException' => __DIR__ . '/../..' . '/core/coreexception.class.inc.php',
'InvalidPasswordAttributeOneWayPassword' => __DIR__ . '/../..' . '/core/coreexception.class.inc.php',
'InvalidConfigParamException' => __DIR__ . '/../..' . '/application/exceptions/InvalidConfigParamException.php',
'InvalidPasswordAttributeOneWayPassword' => __DIR__ . '/../..' . '/application/exceptions/InvalidPasswordAttributeOneWayPassword.php',
'IssueLog' => __DIR__ . '/../..' . '/core/log.class.inc.php',
'ItopCounter' => __DIR__ . '/../..' . '/core/counter.class.inc.php',
'JSButtonItem' => __DIR__ . '/../..' . '/application/applicationextension.inc.php',
@@ -713,10 +713,10 @@ class ComposerStaticInit0018331147de7601e7552f7da8e3bb8b
'ModuleHandlerApiInterface' => __DIR__ . '/../..' . '/core/modulehandler.class.inc.php',
'MonthlyRotatingLogFileNameBuilder' => __DIR__ . '/../..' . '/core/log.class.inc.php',
'MyHelpers' => __DIR__ . '/../..' . '/core/MyHelpers.class.inc.php',
'MySQLException' => __DIR__ . '/../..' . '/core/cmdbsource.class.inc.php',
'MySQLHasGoneAwayException' => __DIR__ . '/../..' . '/core/cmdbsource.class.inc.php',
'MySQLNoTransactionException' => __DIR__ . '/../..' . '/core/cmdbsource.class.inc.php',
'MySQLQueryHasNoResultException' => __DIR__ . '/../..' . '/core/cmdbsource.class.inc.php',
'MySQLException' => __DIR__ . '/../..' . '/application/exceptions/mysql/MySQLException.php',
'MySQLHasGoneAwayException' => __DIR__ . '/../..' . '/application/exceptions/mysql/MySQLHasGoneAwayException.php',
'MySQLNoTransactionException' => __DIR__ . '/../..' . '/application/exceptions/mysql/MySQLNoTransactionException.php',
'MySQLQueryHasNoResultException' => __DIR__ . '/../..' . '/application/exceptions/mysql/MySQLQueryHasNoResultException.php',
'NestedQueryExpression' => __DIR__ . '/../..' . '/core/oql/expression.class.inc.php',
'NestedQueryOqlExpression' => __DIR__ . '/../..' . '/core/oql/oqlquery.class.inc.php',
'NewObjectMenuNode' => __DIR__ . '/../..' . '/application/menunode.class.inc.php',
@@ -974,9 +974,9 @@ class ComposerStaticInit0018331147de7601e7552f7da8e3bb8b
'PortalDispatcher' => __DIR__ . '/../..' . '/application/portaldispatcher.class.inc.php',
'PortalURLMaker' => __DIR__ . '/../..' . '/application/applicationcontext.class.inc.php',
'PrintableDataTable' => __DIR__ . '/../..' . '/application/datatable.class.inc.php',
'ProcessException' => __DIR__ . '/../..' . '/core/backgroundprocess.inc.php',
'ProcessFatalException' => __DIR__ . '/../..' . '/core/backgroundprocess.inc.php',
'ProcessInvalidConfigException' => __DIR__ . '/../..' . '/core/backgroundprocess.inc.php',
'ProcessException' => __DIR__ . '/../..' . '/application/exceptions/process/ProcessException.php',
'ProcessFatalException' => __DIR__ . '/../..' . '/application/exceptions/process/ProcessFatalException.php',
'ProcessInvalidConfigException' => __DIR__ . '/../..' . '/application/exceptions/process/ProcessInvalidConfigException.php',
'Psr\\Cache\\CacheException' => __DIR__ . '/..' . '/psr/cache/src/CacheException.php',
'Psr\\Cache\\CacheItemInterface' => __DIR__ . '/..' . '/psr/cache/src/CacheItemInterface.php',
'Psr\\Cache\\CacheItemPoolInterface' => __DIR__ . '/..' . '/psr/cache/src/CacheItemPoolInterface.php',
@@ -1054,7 +1054,7 @@ class ComposerStaticInit0018331147de7601e7552f7da8e3bb8b
'ScssPhp\\ScssPhp\\Util' => __DIR__ . '/..' . '/scssphp/scssphp/src/Util.php',
'ScssPhp\\ScssPhp\\Version' => __DIR__ . '/..' . '/scssphp/scssphp/src/Version.php',
'SearchMenuNode' => __DIR__ . '/../..' . '/application/menunode.class.inc.php',
'SecurityException' => __DIR__ . '/../..' . '/core/coreexception.class.inc.php',
'SecurityException' => __DIR__ . '/../..' . '/application/exceptions/SecurityException.php',
'SeparatorPopupMenuItem' => __DIR__ . '/../..' . '/application/applicationextension.inc.php',
'SessionUpdateTimestampHandlerInterface' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php',
'SetupLog' => __DIR__ . '/../..' . '/core/log.class.inc.php',
@@ -2059,6 +2059,7 @@ class ComposerStaticInit0018331147de7601e7552f7da8e3bb8b
'Symfony\\Polyfill\\Util\\TestListenerForV6' => __DIR__ . '/..' . '/symfony/polyfill-util/TestListenerForV6.php',
'Symfony\\Polyfill\\Util\\TestListenerForV7' => __DIR__ . '/..' . '/symfony/polyfill-util/TestListenerForV7.php',
'Symfony\\Polyfill\\Util\\TestListenerTrait' => __DIR__ . '/..' . '/symfony/polyfill-util/TestListenerTrait.php',
'SynchroExceptionNotStarted' => __DIR__ . '/../..' . '/application/exceptions/SynchroExceptionNotStarted.php',
'System' => __DIR__ . '/..' . '/pear/pear-core-minimal/src/System.php',
'TCPDF' => __DIR__ . '/..' . '/combodo/tcpdf/tcpdf.php',
'TCPDF2DBarcode' => __DIR__ . '/..' . '/combodo/tcpdf/tcpdf_barcodes_2d.php',
@@ -2476,7 +2477,7 @@ class ComposerStaticInit0018331147de7601e7552f7da8e3bb8b
'User' => __DIR__ . '/../..' . '/core/userrights.class.inc.php',
'UserDashboard' => __DIR__ . '/../..' . '/application/user.dashboard.class.inc.php',
'UserInternal' => __DIR__ . '/../..' . '/core/userrights.class.inc.php',
'UserRightException' => __DIR__ . '/../..' . '/core/userrights.class.inc.php',
'UserRightException' => __DIR__ . '/../..' . '/application/exceptions/UserRightException.php',
'UserRights' => __DIR__ . '/../..' . '/core/userrights.class.inc.php',
'UserRightsAddOnAPI' => __DIR__ . '/../..' . '/core/userrights.class.inc.php',
'ValueSetDefinition' => __DIR__ . '/../..' . '/core/valuesetdef.class.inc.php',

View File

@@ -1517,7 +1517,6 @@ JS
*/
public static function GetAvailableLanguages($sDir)
{
require_once(APPROOT.'/core/coreexception.class.inc.php');
require_once(APPROOT.'/core/dict.class.inc.php');
$aFiles = scandir($sDir);

View File

@@ -1,26 +1,9 @@
<?php
/**
* Copyright (C) 2013-2020 Combodo SARL
*
* This file is part of iTop.
*
* iTop 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, either version 3 of the License, or
* (at your option) any later version.
*
* iTop 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
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class SynchroExceptionNotStarted extends CoreException
{
}
class SynchroDataSource extends cmdbAbstractObject
{
public static function Init()

View File

@@ -2,8 +2,8 @@
namespace Combodo\iTop\Test\UnitTest\Core;
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
use CMDBSource;
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
use MetaModel;
/**
@@ -16,7 +16,6 @@ class BulkChangeTest extends ItopDataTestCase {
protected function setUp() {
parent::setUp();
require_once(APPROOT.'core/coreexception.class.inc.php');
require_once(APPROOT.'core/bulkchange.class.inc.php');
}

View File

@@ -13,7 +13,6 @@ class CSVParserTest extends ItopTestCase
parent::setUp();
require_once(APPROOT.'core/csvparser.class.inc.php');
require_once(APPROOT.'core/coreexception.class.inc.php');
}
public function testFile()

View File

@@ -25,11 +25,11 @@ use Combodo\iTop\Test\UnitTest\ItopTestCase;
use Config;
use PHPUnit\Framework\TestCase;
/**
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
* @backupGlobals disabled
*/
/**
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
* @backupGlobals disabled
*/
class ConfigTest extends ItopTestCase
{
protected function setUp()

View File

@@ -42,7 +42,6 @@ class DBObjectTest extends ItopDataTestCase
protected function setUp()
{
parent::setUp();
require_once(APPROOT.'core/coreexception.class.inc.php');
require_once(APPROOT.'core/dbobject.class.php');
}

View File

@@ -28,7 +28,6 @@ class MetaModelTest extends ItopDataTestCase
{
parent::setUp();
require_once APPROOT.'/core/metamodel.class.php';
require_once APPROOT.'/core/coreexception.class.inc.php';
}
/**

View File

@@ -24,7 +24,6 @@ use MetaModel;
{
parent::setUp();
require_once(APPROOT.'/core/metamodel.class.php');
require_once(APPROOT.'/core/coreexception.class.inc.php');
}
/**

View File

@@ -41,7 +41,6 @@ class dictTest extends ItopTestCase
protected function setUp()
{
parent::setUp();
require_once (APPROOT.'core/coreexception.class.inc.php');
require_once (APPROOT.'core/dict.class.inc.php');
require_once 'mockDict.incphp';
}

View File

@@ -24,7 +24,6 @@
*/
require_once(APPROOT.'/core/coreexception.class.inc.php');
require_once(APPROOT.'/core/attributedef.class.inc.php');
require_once(APPROOT.'/core/filterdef.class.inc.php');
require_once(APPROOT.'/core/stimulus.class.inc.php');