From cd2a052f11286efbd7788a35cc95d165424dfcdd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 7 Nov 2020 17:46:44 +0100 Subject: [PATCH] Continued: - re-added $databaseInstance from monolithic BaseFrameworkSystem - BaseFrameworkSystem->hex2dec() has moved to StringUtils::hex2dec() - updated core framework MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- ...lass_NetworkPackageCompressorDecorator.php | 24 +++++++++++++++++++ .../package/class_NetworkPackageHandler.php | 24 +++++++++++++++++++ .../fragmenter/class_PackageFragmenter.php | 5 ++-- core | 2 +- 4 files changed, 52 insertions(+), 3 deletions(-) diff --git a/application/hub/classes/compressor/decorator/class_NetworkPackageCompressorDecorator.php b/application/hub/classes/compressor/decorator/class_NetworkPackageCompressorDecorator.php index d2a5ac585..927947d1a 100644 --- a/application/hub/classes/compressor/decorator/class_NetworkPackageCompressorDecorator.php +++ b/application/hub/classes/compressor/decorator/class_NetworkPackageCompressorDecorator.php @@ -32,6 +32,11 @@ use Org\Mxchange\CoreFramework\Compressor\Compressor; * along with this program. If not, see . */ class NetworkPackageCompressorDecorator extends BaseHubSystem implements Compressor { + /** + * A Compressor instance + */ + private $compressorInstance = NULL; + /** * Protected constructor * @@ -59,6 +64,25 @@ class NetworkPackageCompressorDecorator extends BaseHubSystem implements Compres return $compressorInstance; } + /** + * Setter for compressor instance + * + * @param $compressorInstance An instance of a Compressor class + * @return void + */ + protected final function setCompressorInstance (Compressor $compressorInstance) { + $this->compressorInstance = $compressorInstance; + } + + /** + * Getter for compressor instance + * + * @return $compressorInstance An instance of a Compressor class + */ + private final function getCompressorInstance () { + return $this->compressorInstance; + } + /** * A compression stream * diff --git a/application/hub/classes/handler/package/class_NetworkPackageHandler.php b/application/hub/classes/handler/package/class_NetworkPackageHandler.php index ab25ee015..8c6388360 100644 --- a/application/hub/classes/handler/package/class_NetworkPackageHandler.php +++ b/application/hub/classes/handler/package/class_NetworkPackageHandler.php @@ -309,6 +309,11 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei const EXCEPTION_UNEXPECTED_PACKAGE_STATUS = 0xff00; const EXCEPTION_INVALID_DATA_CHECKSUM = 0xff01; + /** + * A Compressor instance + */ + private $compressorInstance = NULL; + /** * Protected constructor * @@ -380,6 +385,25 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei return $packageInstance; } + /** + * Setter for compressor instance + * + * @param $compressorInstance An instance of a Compressor class + * @return void + */ + protected final function setCompressorInstance (Compressor $compressorInstance) { + $this->compressorInstance = $compressorInstance; + } + + /** + * Getter for compressor instance + * + * @return $compressorInstance An instance of a Compressor class + */ + private final function getCompressorInstance () { + return $this->compressorInstance; + } + /** * Initialize all stackers * diff --git a/application/hub/classes/package/fragmenter/class_PackageFragmenter.php b/application/hub/classes/package/fragmenter/class_PackageFragmenter.php index 5bfde6e7d..87ca2eb7f 100644 --- a/application/hub/classes/package/fragmenter/class_PackageFragmenter.php +++ b/application/hub/classes/package/fragmenter/class_PackageFragmenter.php @@ -13,6 +13,7 @@ use Org\Mxchange\CoreFramework\Assertion\AssertionException; use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap; use Org\Mxchange\CoreFramework\Factory\ObjectFactory; use Org\Mxchange\CoreFramework\Registry\Registerable; +use Org\Mxchange\CoreFramework\Utils\String\StringUtils; /** * A PackageFragmenter class to fragment package data into smaller chunks for @@ -154,7 +155,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera $this->chunkSize = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('package_chunk_size'); // - Maximum serial number - $this->maxSerialNumber = $this->hex2dec(str_repeat('f', self::MAX_SERIAL_LENGTH)); + $this->maxSerialNumber = StringUtils::hex2dec(str_repeat('f', self::MAX_SERIAL_LENGTH)); // Trace message //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER: EXIT!'); @@ -474,7 +475,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera // Encode the current serial number //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER: serialNumber[' . $finalHash . ']=' . $this->serialNumber[$finalHash]); - $encodedSerialNumber = $this->dec2Hex($this->serialNumber[$finalHash], self::MAX_SERIAL_LENGTH); + $encodedSerialNumber = StringUtils::dec2hex($this->serialNumber[$finalHash], self::MAX_SERIAL_LENGTH); // Count one up $this->serialNumber[$finalHash]++; diff --git a/core b/core index 3b182d163..dd1cef387 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 3b182d1633e936618e118773da67fa41b24a6109 +Subproject commit dd1cef3878259d544e9853b1c0f5abca1f0d99b1 -- 2.39.5