From 28c06221da077c7fab8642550f5cad7eb2921172 Mon Sep 17 00:00:00 2001 From: Tim Wagner Date: Wed, 26 Jun 2019 14:56:35 +0200 Subject: [PATCH] Pre-Initialize LDAP configuration encryption parameter + Add Doctrine cache factories for APCu and Filesystem --- CHANGELOG.md | 13 ++++- UPGRADE-1.1.24.md | 3 ++ build.default.properties | 2 +- composer.lock | 10 ++-- .../Doctrine/Utils/ConnectionUtil.php | 3 +- .../V2/CacheFactories/ApcuCacheFactory.php | 51 +++++++++++++++++++ .../Doctrine/V2/CacheFactories/CacheKeys.php | 7 +++ .../CacheFactories/FilesystemCacheFactory.php | 49 ++++++++++++++++++ 8 files changed, 130 insertions(+), 8 deletions(-) create mode 100644 UPGRADE-1.1.24.md create mode 100644 src/AppserverIo/Appserver/PersistenceContainer/Doctrine/V2/CacheFactories/ApcuCacheFactory.php create mode 100644 src/AppserverIo/Appserver/PersistenceContainer/Doctrine/V2/CacheFactories/FilesystemCacheFactory.php diff --git a/CHANGELOG.md b/CHANGELOG.md index e73af8851..e1c75fd1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +# Version 1.1.24 + +## Bugfixes + +* Pre-Initialize LDAP configuration encryption parameter + +## Features + +* Add Doctrine cache factories for APCu and Filesystem +* Update to appserver-io/description version 13.0.1 + # Version 1.1.23 ## Bugfixes @@ -9,7 +20,7 @@ * Extend error handling with exception support * Add encryption support for LDAP functionality * Update to appserver-io/ldap version 3.0.* -* Update to appserver-io/description version 33.0.* +* Update to appserver-io/description version 13.0.* * Update to appserver-io/provisioning version 2.0.* * Update to appserver-io-psr/cli version 2.0.* * Update to appserver-io-psr/application-server version 2.0.* diff --git a/UPGRADE-1.1.24.md b/UPGRADE-1.1.24.md new file mode 100644 index 000000000..55e224f05 --- /dev/null +++ b/UPGRADE-1.1.24.md @@ -0,0 +1,3 @@ +# Upgrade from 1.1.23 to 1.1.24 + +Updating from 1.1.23 to 1.1.24 doesn't have any impacts. Please read the apropriate UPGRADE-1.x.x files for updates from older versions to 1.1.24. \ No newline at end of file diff --git a/build.default.properties b/build.default.properties index 2d413fa99..d3201c1dc 100644 --- a/build.default.properties +++ b/build.default.properties @@ -8,7 +8,7 @@ ;-------------------------------------------------------------------------------- ; ---- Module Release Settings -------------------------------------------------- -release.version = 1.1.23 +release.version = 1.1.24 release.name = Iron Knight ; ---- PHPCPD Settings ---------------------------------------------------------- diff --git a/composer.lock b/composer.lock index da4376d3a..eefe7242a 100644 --- a/composer.lock +++ b/composer.lock @@ -1003,16 +1003,16 @@ }, { "name": "appserver-io/description", - "version": "13.0.0", + "version": "13.0.1", "source": { "type": "git", "url": "https://github.com/appserver-io/description.git", - "reference": "6d922cdd2a22c42ba267646e199b68e1aa83ac9f" + "reference": "7ccc9d4eeab8348f4123500ec6ad5f6d75651231" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appserver-io/description/zipball/6d922cdd2a22c42ba267646e199b68e1aa83ac9f", - "reference": "6d922cdd2a22c42ba267646e199b68e1aa83ac9f", + "url": "https://api.github.com/repos/appserver-io/description/zipball/7ccc9d4eeab8348f4123500ec6ad5f6d75651231", + "reference": "7ccc9d4eeab8348f4123500ec6ad5f6d75651231", "shasum": "" }, "require": { @@ -1055,7 +1055,7 @@ "keywords": [ "deployment descriptor implementation" ], - "time": "2019-06-21T15:24:31+00:00" + "time": "2019-06-26T12:36:46+00:00" }, { "name": "appserver-io/dnsserver", diff --git a/src/AppserverIo/Appserver/Doctrine/Utils/ConnectionUtil.php b/src/AppserverIo/Appserver/Doctrine/Utils/ConnectionUtil.php index 21b145d2a..ee4a87f11 100644 --- a/src/AppserverIo/Appserver/Doctrine/Utils/ConnectionUtil.php +++ b/src/AppserverIo/Appserver/Doctrine/Utils/ConnectionUtil.php @@ -98,7 +98,8 @@ public function fromDatabaseNode(DatabaseConfigurationInterface $databaseNode) // initialize the connection parameters with the mandatory driver $connectionParameters = array( - 'driver' => $databaseNode->getDriver()->getNodeValue()->__toString() + 'driver' => $databaseNode->getDriver()->getNodeValue()->__toString(), + 'encryption' => 'none' ); // initialize the path/memory to the database when we use sqlite for example diff --git a/src/AppserverIo/Appserver/PersistenceContainer/Doctrine/V2/CacheFactories/ApcuCacheFactory.php b/src/AppserverIo/Appserver/PersistenceContainer/Doctrine/V2/CacheFactories/ApcuCacheFactory.php new file mode 100644 index 000000000..a6a9bd3b5 --- /dev/null +++ b/src/AppserverIo/Appserver/PersistenceContainer/Doctrine/V2/CacheFactories/ApcuCacheFactory.php @@ -0,0 +1,51 @@ + + * @copyright 2015 TechDivision GmbH + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + * @link https://github.com/appserver-io/rmi + * @link http://www.appserver.io + */ + +namespace AppserverIo\Appserver\PersistenceContainer\Doctrine\V2\CacheFactories; + +use Doctrine\Common\Cache\ApcuCache; + +/** + * The factory implementation for an ApcuCache cache instance. + * + * @author Tim Wagner + * @author Bernhard Wick + * @copyright 2015 TechDivision GmbH + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + * @link https://github.com/appserver-io/rmi + * @link http://www.appserver.io + */ +class ApcuCacheFactory implements CacheFactoryInterface +{ + + /** + * Return's the new cache instance. + * + * @param array $configuration The cache configuration + * + * @return \Doctrine\Common\Cache\CacheProvider The cache instance + */ + public static function get(array $configuration = array()) + { + if (extension_loaded('apcu')) { + return new ApcuCache(); + } + } +} diff --git a/src/AppserverIo/Appserver/PersistenceContainer/Doctrine/V2/CacheFactories/CacheKeys.php b/src/AppserverIo/Appserver/PersistenceContainer/Doctrine/V2/CacheFactories/CacheKeys.php index 1b3378ac7..fc57249a6 100644 --- a/src/AppserverIo/Appserver/PersistenceContainer/Doctrine/V2/CacheFactories/CacheKeys.php +++ b/src/AppserverIo/Appserver/PersistenceContainer/Doctrine/V2/CacheFactories/CacheKeys.php @@ -37,4 +37,11 @@ class CacheKeys * @var string */ const HOST = 'host'; + + /** + * The key for the directory value. + * + * @var string + */ + const DIRECTORY = 'directory'; } diff --git a/src/AppserverIo/Appserver/PersistenceContainer/Doctrine/V2/CacheFactories/FilesystemCacheFactory.php b/src/AppserverIo/Appserver/PersistenceContainer/Doctrine/V2/CacheFactories/FilesystemCacheFactory.php new file mode 100644 index 000000000..fe3147139 --- /dev/null +++ b/src/AppserverIo/Appserver/PersistenceContainer/Doctrine/V2/CacheFactories/FilesystemCacheFactory.php @@ -0,0 +1,49 @@ + + * @copyright 2015 TechDivision GmbH + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + * @link https://github.com/appserver-io/rmi + * @link http://www.appserver.io + */ + +namespace AppserverIo\Appserver\PersistenceContainer\Doctrine\V2\CacheFactories; + +use Doctrine\Common\Cache\FilesystemCache; + +/** + * The factory implementation for a FilesystemCache cache instance. + * + * @author Tim Wagner + * @author Bernhard Wick + * @copyright 2015 TechDivision GmbH + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + * @link https://github.com/appserver-io/rmi + * @link http://www.appserver.io + */ +class FilesystemCacheFactory implements CacheFactoryInterface +{ + + /** + * Return's the new cache instance. + * + * @param array $configuration The cache configuration + * + * @return \Doctrine\Common\Cache\CacheProvider The cache instance + */ + public static function get(array $configuration = array()) + { + return new FilesystemCache($configuration[CacheKeys::DIRECTORY]); + } +}