From 73fc20af00ab207c51a8eb8b57053d3cfef7923a Mon Sep 17 00:00:00 2001 From: Roly Gutierrez Date: Wed, 17 Aug 2022 09:19:35 -0400 Subject: [PATCH] PMCORE-3920 Create a PM table or Report Table are not working --- thirdparty/phing/IntrospectionHelper.php | 23 +++++++++++++++---- thirdparty/phing/listener/DefaultLogger.php | 4 ++-- thirdparty/phing/system/util/Properties.php | 5 +++- .../tasks/system/condition/ConditionBase.php | 10 ++++---- thirdparty/phing/util/StringHelper.php | 2 +- .../builder/sql/mysql/MysqlDDLBuilder.php | 6 ++++- .../engine/database/model/XMLElement.php | 1 + .../propel/engine/platform/MysqlPlatform.php | 4 +++- workflow/engine/classes/PmTable.php | 5 ++-- 9 files changed, 42 insertions(+), 18 deletions(-) diff --git a/thirdparty/phing/IntrospectionHelper.php b/thirdparty/phing/IntrospectionHelper.php index 2396d4c0e..e6917fc21 100644 --- a/thirdparty/phing/IntrospectionHelper.php +++ b/thirdparty/phing/IntrospectionHelper.php @@ -221,7 +221,7 @@ class IntrospectionHelper { $classname = null; - if (($hint = $params[0]->getClass()) !== null) { + if (($hint = $this->getClass($params[0])) !== null) { $classname = $hint->getName(); } @@ -249,7 +249,7 @@ class IntrospectionHelper { $classname = null; - if (($hint = $params[0]->getClass()) !== null) { + if (($hint = $this->getClass($params[0])) !== null) { $classname = $hint->getName(); } @@ -325,8 +325,8 @@ class IntrospectionHelper { $params = $method->getParameters(); $classname = null; - - if (($hint = $params[0]->getClass()) !== null) { + + if (($hint = $this->getClass($params[0])) !== null) { $classname = $hint->getName(); } @@ -412,7 +412,7 @@ class IntrospectionHelper { $classname = null; - if (($hint = $params[0]->getClass()) !== null) { + if (($hint = $this->getClass($params[0])) !== null) { $classname = $hint->getName(); } @@ -539,4 +539,17 @@ class IntrospectionHelper { } } + /** + * Get class + * @param object $param + * @return mixed + */ + private function getClass(object $param) + { + $name = null; + if ($param->getType() && !$param->getType()->isBuiltin()) { + $name = new ReflectionClass($param->getType()->getName()); + } + return $name; + } } diff --git a/thirdparty/phing/listener/DefaultLogger.php b/thirdparty/phing/listener/DefaultLogger.php index 2a706d9b0..be0cc6804 100644 --- a/thirdparty/phing/listener/DefaultLogger.php +++ b/thirdparty/phing/listener/DefaultLogger.php @@ -29,7 +29,7 @@ include_once 'phing/BuildEvent.php'; * any messages that get logged. * * @author Andreas Aderhold - * @copyright © 2001,2002 THYRELL. All rights reserved + * @copyright © 2001,2002 THYRELL. All rights reserved * @version $Revision: 1.11 $ $Date: 2005/08/25 19:33:43 $ * @see BuildEvent * @package phing.listener @@ -214,7 +214,7 @@ class DefaultLogger implements BuildListener { $minutes, ($minutes === 1 ? " " : "s "), $seconds - floor($seconds/60) * 60, ($seconds%60 === 1 ? "" : "s")); } else { - return sprintf("%0.4f second%s", $seconds, ($seconds%60 === 1 ? "" : "s")); + return sprintf("%0.4f second%s", $seconds, ((int) $seconds % 60 === 1 ? "" : "s")); } } diff --git a/thirdparty/phing/system/util/Properties.php b/thirdparty/phing/system/util/Properties.php index 4527a66c9..adcef55ac 100644 --- a/thirdparty/phing/system/util/Properties.php +++ b/thirdparty/phing/system/util/Properties.php @@ -215,7 +215,10 @@ class Properties { * @return mixed Old property value or NULL if none was set. */ function setProperty($key, $value) { - $oldValue = @$this->properties[$key]; + $oldValue = null; + if (array_key_exists($key, $this->properties)) { + $oldValue = $this->properties[$key]; + } $this->properties[$key] = $value; return $oldValue; } diff --git a/thirdparty/phing/tasks/system/condition/ConditionBase.php b/thirdparty/phing/tasks/system/condition/ConditionBase.php index 84a376bc7..e575fb2d8 100644 --- a/thirdparty/phing/tasks/system/condition/ConditionBase.php +++ b/thirdparty/phing/tasks/system/condition/ConditionBase.php @@ -31,7 +31,7 @@ include_once 'phing/tasks/system/condition/Condition.php'; * * @author Hans Lellelid * @author Andreas Aderhold - * @copyright © 2001,2002 THYRELL. All rights reserved + * @copyright © 2001,2002 THYRELL. All rights reserved * @version $Revision: 1.16 $ * @package phing.tasks.system.condition */ @@ -46,7 +46,7 @@ abstract class ConditionBase extends ProjectComponent implements IteratorAggrega /** * Required for IteratorAggregate */ - function getIterator() { + function getIterator(): \Traversable { return new ConditionEnumeration($this); } @@ -169,7 +169,7 @@ class ConditionEnumeration implements Iterator { $this->outer = $outer; } - public function valid() { + public function valid(): bool { return $this->outer->countConditions() > $this->num; } @@ -181,7 +181,7 @@ class ConditionEnumeration implements Iterator { return $o; } - function next() { + function next(): void { $this->num++; } @@ -189,7 +189,7 @@ class ConditionEnumeration implements Iterator { return $this->num; } - function rewind() { + function rewind(): void { $this->num = 0; } } diff --git a/thirdparty/phing/util/StringHelper.php b/thirdparty/phing/util/StringHelper.php index d23a8fcf5..ab1c2618c 100644 --- a/thirdparty/phing/util/StringHelper.php +++ b/thirdparty/phing/util/StringHelper.php @@ -167,7 +167,7 @@ class StringHelper { * a natural way of getting a subtring, php's circular string buffer and strange * return values suck if you want to program strict as of C or friends */ - public static function substring($string, $startpos, $endpos = -1) { + public static function substring(string $string, $startpos, $endpos = -1) { $len = strlen($string); $endpos = (int) (($endpos === -1) ? $len-1 : $endpos); if ($startpos > $len-1 || $startpos < 0) { diff --git a/thirdparty/propel-generator/classes/propel/engine/builder/sql/mysql/MysqlDDLBuilder.php b/thirdparty/propel-generator/classes/propel/engine/builder/sql/mysql/MysqlDDLBuilder.php index ff120a19c..8b3297907 100644 --- a/thirdparty/propel-generator/classes/propel/engine/builder/sql/mysql/MysqlDDLBuilder.php +++ b/thirdparty/propel-generator/classes/propel/engine/builder/sql/mysql/MysqlDDLBuilder.php @@ -148,7 +148,11 @@ CREATE TABLE ".$this->quoteIdentifier($table->getName())." // $script .= " DEFAULT CHARSET='". $platform->escapeText( $vendorSpecific['Collation'] )."'"; $script .= " DEFAULT CHARSET='utf8'"; } - if($vendorSpecific['Comment'] ) { + $value = null; + if (array_key_exists('Comment', $vendorSpecific)) { + $value = $vendorSpecific['Comment']; + } + if($value) { $script .= " COMMENT='". $platform->escapeText( $vendorSpecific['Comment'] )."'"; } // if($table->getDescription()) { diff --git a/thirdparty/propel-generator/classes/propel/engine/database/model/XMLElement.php b/thirdparty/propel-generator/classes/propel/engine/database/model/XMLElement.php index 61579e1b6..264baf8cf 100644 --- a/thirdparty/propel-generator/classes/propel/engine/database/model/XMLElement.php +++ b/thirdparty/propel-generator/classes/propel/engine/database/model/XMLElement.php @@ -81,6 +81,7 @@ abstract class XMLElement { if (is_numeric($val)) { return (bool) $val; } else { + $val = is_null($val) ? '' : $val; return (in_array(strtolower($val), array('true', 't', 'y', 'yes'), true) ? true : false); } } diff --git a/thirdparty/propel-generator/classes/propel/engine/platform/MysqlPlatform.php b/thirdparty/propel-generator/classes/propel/engine/platform/MysqlPlatform.php index 4dba73be4..bc81e6172 100644 --- a/thirdparty/propel-generator/classes/propel/engine/platform/MysqlPlatform.php +++ b/thirdparty/propel-generator/classes/propel/engine/platform/MysqlPlatform.php @@ -72,7 +72,9 @@ class MysqlPlatform extends DefaultPlatform { $usingInnoDB = false; if(class_exists('DataModelBuilder', false)) { - $usingInnoDB = strtolower(DataModelBuilder::getBuildProperty('mysqlTableType')) == 'innodb'; + $val = DataModelBuilder::getBuildProperty('mysqlTableType'); + $val = is_null($val) ? '' : $val; + $usingInnoDB = strtolower($val) == 'innodb'; } return $usingInnoDB || false; } diff --git a/workflow/engine/classes/PmTable.php b/workflow/engine/classes/PmTable.php index ed58dc0d8..71076ec17 100644 --- a/workflow/engine/classes/PmTable.php +++ b/workflow/engine/classes/PmTable.php @@ -821,7 +821,7 @@ class PmTable * * @return array contains all supported columns types provided by propel */ - public function getPropelSupportedColumnTypes() + public static function getPropelSupportedColumnTypes() { /** * http://www.propelorm.org/wiki/Documentation/1.2/Schema @@ -926,7 +926,8 @@ class PmTable $args[] = $target; } - if (DIRECTORY_SEPARATOR != '\\' && (function_exists('posix_isatty') && @posix_isatty(STDOUT))) { + $fd = defined('STDOUT') ? STDOUT : fopen('php://stdout', 'w'); + if (DIRECTORY_SEPARATOR != '\\' && (function_exists('posix_isatty') && posix_isatty($fd))) { $args[] = '-logger'; $args[] = 'phing.listener.AnsiColorLogger'; }