Merge remote-tracking branch 'origin/support/2.7' into support/3.0

# Conflicts:
#	core/config.class.inc.php
#	setup/itopdesignformat.class.inc.php
This commit is contained in:
Pierre Goiffon
2022-01-26 16:07:34 +01:00
5 changed files with 62 additions and 6 deletions

View File

@@ -26,6 +26,7 @@ require_once (__DIR__.DIRECTORY_SEPARATOR.'update.classes.inc.php');
$aFilesUpdaters = array(
new iTopVersionFileUpdater(),
new DatamodelsModulesFiles(),
new ConstantFileUpdater('ITOP_CORE_VERSION', 'core/config.class.inc.php'),
);
if (count($argv) === 1)

View File

@@ -69,6 +69,40 @@ abstract class AbstractSingleFileVersionUpdater extends FileVersionUpdater
}
}
/**
* @since 2.7.7 3.0.1 3.1.0 N°4714
*/
class ConstantFileUpdater extends AbstractSingleFileVersionUpdater {
/** @var string */
private $sConstantName;
/**
* @param $sConstantName constant to search, for example `ITOP_CORE_VERSION`
* @param $sFileToUpdate file containing constant definition
*/
public function __construct($sConstantName, $sFileToUpdate)
{
$this->sConstantName = $sConstantName;
parent::__construct($sFileToUpdate);
}
/**
* @inheritDoc
*/
public function UpdateFileContent($sVersionLabel, $sFileContent, $sFileFullPath)
{
$sConstantSearchPattern = <<<REGEXP
/define\('{$this->sConstantName}', ?'[^']+'\);/
REGEXP;
return preg_replace(
$sConstantSearchPattern,
"define('{$this->sConstantName}', '{$sVersionLabel}');",
$sFileContent
);
}
}
class iTopVersionFileUpdater extends AbstractSingleFileVersionUpdater
{
public function __construct()

View File

@@ -5,9 +5,11 @@ define('APPCONF', APPROOT.'conf/');
/**
* iTop Datamodel XML format version
* And also iTop core version
*
* To test for iTop core version use this constant instead of {@link ITOP_VERSION} !
* It was also used in iTop 3.0.0 to get iTop core version (instead of {@see ITOP_VERSION} which gives the application version).
* To address this need you should now use {@see ITOP_CORE_VERSION}
*
* @see ITOP_CORE_VERSION to get full iTop core version
*/
define('ITOP_DESIGN_LATEST_VERSION', '3.0');

View File

@@ -27,13 +27,21 @@ define('ITOP_APPLICATION_SHORT', 'iTop');
* Constant containing the application version
* Warning: this might be different from iTop core version!
*
* @see ITOP_DESIGN_LATEST_VERSION for iTop core version
*
* @used-by utils::GetItopPatchVersion
* @see ITOP_CORE_VERSION to get iTop core version
*/
define('ITOP_VERSION', '3.0.1-dev');
define('ITOP_VERSION_NAME', 'Fullmoon');
/**
* Constant containing the iTop core version, whatever application was built
*
* Note that in iTop 3.0.0 we used {@see ITOP_DESIGN_LATEST_VERSION} to get core version.
* When releasing, both constants should be updated : see `.make/release/update-versions.php` for that !
*
* @since 2.7.7 3.0.1 3.1.1 N°4714 constant creation
* @used-by utils::GetItopPatchVersion
*/
define('ITOP_CORE_VERSION', '3.0.1');
define('ITOP_REVISION', 'svn');
define('ITOP_BUILD_DATE', '$WCNOW$');
define('ITOP_VERSION_FULL', ITOP_VERSION.'-'.ITOP_REVISION);
@@ -618,6 +626,13 @@ class Config
'source_of_value' => '',
'show_in_conf_sample' => false,
],
/**
* The timezone is automatically set using this parameter in \utils::InitTimeZone
* This method is called almost everywhere, cause it's called in \MetaModel::LoadConfig and exec.php... but you might
* need to get it yourself !
*
* @used-by utils::InitTimeZone()
*/
'timezone' => [
'type' => 'string',
'description' => 'Timezone (reference: http://php.net/manual/en/timezones.php). If empty, it will be left unchanged and MUST be explicitly configured in PHP',

View File

@@ -416,6 +416,10 @@ class DBObjectSearch extends DBSearch
* @param string $sFilterCode
* @param mixed $value
* @param string $sOpCode operator to use : 'IN', 'NOT IN', 'Contains',' Begins with', 'Finishes with', ...
* If no operator is specified then :
* * for id field we will use "="
* * for other fields we will call the corresponding {@link AttributeDefinition::GetSmartConditionExpression} method impl
* to generate the expression
* @param bool $bParseSearchString
*
* @throws \CoreException