From 1ab4e3afd012a79f7904857bf80cb573a5cdae50 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 9 Dec 2020 02:42:40 +0100 Subject: [PATCH] Continued: - renamed .htacces to .gitkeep and emptied them - no self::createObjectByConfiguredName() anymore, only as usual over ObjectFactory reference - ops createProtocolHandlerByType() is not ObjectFactory ... - updated core framework MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../factories/handler/class_ProtocolHandlerFactory.php | 4 ++-- .../factories/info/class_ConnectionInfoFactory.php | 3 ++- .../classes/factories/socket/class_SocketFactory.php | 10 +++++----- .../factories/states/dht/class_DhtStateFactory.php | 2 +- .../factories/states/peer/class_PeerStateFactory.php | 2 +- core | 2 +- data/.gitkeep | 0 data/.htaccess | 1 - data/stacks/.gitkeep | 0 data/stacks/.htaccess | 1 - data/url_lists/.gitkeep | 0 data/url_lists/.htaccess | 1 - db/.gitkeep | 0 db/.htaccess | 1 - db/cruncher_projects/.gitkeep | 0 db/cruncher_projects/.htaccess | 1 - db/cruncher_units/.gitkeep | 0 db/cruncher_units/.htaccess | 1 - db/news/.gitkeep | 0 db/news/.htaccess | 1 - db/node_data/.gitkeep | 0 db/node_data/.htaccess | 1 - db/node_dht/.gitkeep | 0 db/node_dht/.htaccess | 1 - db/node_states/.gitkeep | 0 db/node_states/.htaccess | 1 - db/peer_states/.gitkeep | 0 db/peer_states/.htaccess | 1 - 28 files changed, 12 insertions(+), 22 deletions(-) create mode 100644 data/.gitkeep delete mode 100644 data/.htaccess create mode 100644 data/stacks/.gitkeep delete mode 100644 data/stacks/.htaccess create mode 100644 data/url_lists/.gitkeep delete mode 100644 data/url_lists/.htaccess create mode 100644 db/.gitkeep delete mode 100644 db/.htaccess create mode 100644 db/cruncher_projects/.gitkeep delete mode 100644 db/cruncher_projects/.htaccess create mode 100644 db/cruncher_units/.gitkeep delete mode 100644 db/cruncher_units/.htaccess create mode 100644 db/news/.gitkeep delete mode 100644 db/news/.htaccess create mode 100644 db/node_data/.gitkeep delete mode 100644 db/node_data/.htaccess create mode 100644 db/node_dht/.gitkeep delete mode 100644 db/node_dht/.htaccess create mode 100644 db/node_states/.gitkeep delete mode 100644 db/node_states/.htaccess create mode 100644 db/peer_states/.gitkeep delete mode 100644 db/peer_states/.htaccess diff --git a/application/hub/classes/factories/handler/class_ProtocolHandlerFactory.php b/application/hub/classes/factories/handler/class_ProtocolHandlerFactory.php index a1fa7260f..289aaac6b 100644 --- a/application/hub/classes/factories/handler/class_ProtocolHandlerFactory.php +++ b/application/hub/classes/factories/handler/class_ProtocolHandlerFactory.php @@ -83,7 +83,7 @@ class ProtocolHandlerFactory extends BaseFactory { $protocolType = $helperInstance->determineProtocolType(); // Call super factory method - return ObjectFactory::createProtocolHandlerByType($protocolType); + return self::createProtocolHandlerByType($protocolType); } /** @@ -97,7 +97,7 @@ class ProtocolHandlerFactory extends BaseFactory { $protocolType = ProtocolDiscovery::discoverProtocolByPackageInstance($packageInstance); // Call super factory method - return ObjectFactory::createProtocolHandlerByType($protocolType); + return self::createProtocolHandlerByType($protocolType); } } diff --git a/application/hub/classes/factories/info/class_ConnectionInfoFactory.php b/application/hub/classes/factories/info/class_ConnectionInfoFactory.php index 156be16f3..1a2c7501d 100644 --- a/application/hub/classes/factories/info/class_ConnectionInfoFactory.php +++ b/application/hub/classes/factories/info/class_ConnectionInfoFactory.php @@ -7,6 +7,7 @@ use Org\Shipsimu\Hub\Container\Socket\StorableSocket; // Import framework stuff use Org\Mxchange\CoreFramework\Factory\BaseFactory; +use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory; use Org\Mxchange\CoreFramework\Registry\GenericRegistry; // Import SPL stuff @@ -95,7 +96,7 @@ class ConnectionInfoFactory extends BaseFactory { } else { // Get the info instance /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-INFO-FACTORY: Creating info instance for type=%s ...', $type)); - $infoInstance = self::createObjectByConfiguredName('connection_info_class', array($type)); + $infoInstance = ObjectFactory::createObjectByConfiguredName('connection_info_class', array($type)); // Add it to the registry /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-INFO-FACTORY: Adding key=%s,infoInstance=%s ...', $key, $infoInstance->__toString())); diff --git a/application/hub/classes/factories/socket/class_SocketFactory.php b/application/hub/classes/factories/socket/class_SocketFactory.php index 7bac10c43..b38026eec 100644 --- a/application/hub/classes/factories/socket/class_SocketFactory.php +++ b/application/hub/classes/factories/socket/class_SocketFactory.php @@ -87,7 +87,7 @@ class SocketFactory extends BaseFactory { /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-FACTORY: Using socketResource[%s]=%s from registry.', gettype($socketInstance->getSocketResource()), $socketInstance->getSocketResource())); } else { // Invoke inner factory - $socketInstance = self::createObjectByConfiguredName(sprintf('%s_connection_helper_class', $protocolInstance->getProtocolName()), array($packageInstance)); + $socketInstance = ObjectFactory::createObjectByConfiguredName(sprintf('%s_connection_helper_class', $protocolInstance->getProtocolName()), array($packageInstance)); // Register it with the registry GenericRegistry::getRegistry()->addInstance($registryKey, $socketInstance); @@ -131,7 +131,7 @@ class SocketFactory extends BaseFactory { $socketResource = socket_create(AF_UNIX, SOCK_STREAM, 0); // Get container from it - $socketInstance = self::createObjectByConfiguredName('socket_container_class', [ + $socketInstance = ObjectFactory::createObjectByConfiguredName('socket_container_class', [ $socketResource, StorableSocket::SOCKET_PROTOCOL_FILE, $packageInstance, @@ -270,7 +270,7 @@ class SocketFactory extends BaseFactory { $packageInstance = ObjectFactory::createObjectByConfiguredName('package_data_class'); // Create socket instance - $socketInstance = self::createObjectByConfiguredName('socket_container_class', [ + $socketInstance = ObjectFactory::createObjectByConfiguredName('socket_container_class', [ $socketResource, StorableSocket::SOCKET_PROTOCOL_TCP, $packageInstance, @@ -347,7 +347,7 @@ class SocketFactory extends BaseFactory { $packageInstance = ObjectFactory::createObjectByConfiguredName('package_data_class'); // Create socket instance - $socketInstance = self::createObjectByConfiguredName('socket_container_class', array( + $socketInstance = ObjectFactory::createObjectByConfiguredName('socket_container_class', array( $socketResource, StorableSocket::SOCKET_PROTOCOL_UDP, $packageInstance, @@ -485,7 +485,7 @@ class SocketFactory extends BaseFactory { $packageInstance = ObjectFactory::createObjectByConfiguredName('package_data_class'); // Create socket instance - $socketInstance = self::createObjectByConfiguredName('socket_container_class', array( + $socketInstance = ObjectFactory::createObjectByConfiguredName('socket_container_class', array( $socketResource, $socketProtocol, $packageInstance, diff --git a/application/hub/classes/factories/states/dht/class_DhtStateFactory.php b/application/hub/classes/factories/states/dht/class_DhtStateFactory.php index e100869af..24d508db4 100644 --- a/application/hub/classes/factories/states/dht/class_DhtStateFactory.php +++ b/application/hub/classes/factories/states/dht/class_DhtStateFactory.php @@ -62,7 +62,7 @@ class DhtStateFactory extends BaseFactory { } // Get a class from that configuration entry - $stateInstance = self::createObjectByConfiguredName('dht_' . $stateName . '_state_class', array($dhtInstance)); + $stateInstance = ObjectFactory::createObjectByConfiguredName('dht_' . $stateName . '_state_class', array($dhtInstance)); // Debug message self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-STATE-FACTORY: DHT state has changed from ' . $dhtInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); diff --git a/application/hub/classes/factories/states/peer/class_PeerStateFactory.php b/application/hub/classes/factories/states/peer/class_PeerStateFactory.php index 8d5ae6ac1..88a14a455 100644 --- a/application/hub/classes/factories/states/peer/class_PeerStateFactory.php +++ b/application/hub/classes/factories/states/peer/class_PeerStateFactory.php @@ -63,7 +63,7 @@ class PeerStateFactory extends BaseFactory { // Is the instance null? if (is_null(self::$tableInstance)) { // Get a new one - self::$tableInstance = self::createObjectByConfiguredName('peer_state_lookup_db_frontend_class'); + self::$tableInstance = ObjectFactory::createObjectByConfiguredName('peer_state_lookup_db_frontend_class'); } // Return it diff --git a/core b/core index da760e51c..64adf2e0b 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit da760e51cadd942ec2f28fc7ceaf3b2ccaf65f47 +Subproject commit 64adf2e0b8dc0f38717df467fe7a64c2ed39f32c diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/data/.htaccess b/data/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/data/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/data/stacks/.gitkeep b/data/stacks/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/data/stacks/.htaccess b/data/stacks/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/data/stacks/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/data/url_lists/.gitkeep b/data/url_lists/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/data/url_lists/.htaccess b/data/url_lists/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/data/url_lists/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/db/.gitkeep b/db/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/db/.htaccess b/db/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/db/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/db/cruncher_projects/.gitkeep b/db/cruncher_projects/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/db/cruncher_projects/.htaccess b/db/cruncher_projects/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/db/cruncher_projects/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/db/cruncher_units/.gitkeep b/db/cruncher_units/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/db/cruncher_units/.htaccess b/db/cruncher_units/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/db/cruncher_units/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/db/news/.gitkeep b/db/news/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/db/news/.htaccess b/db/news/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/db/news/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/db/node_data/.gitkeep b/db/node_data/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/db/node_data/.htaccess b/db/node_data/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/db/node_data/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/db/node_dht/.gitkeep b/db/node_dht/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/db/node_dht/.htaccess b/db/node_dht/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/db/node_dht/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/db/node_states/.gitkeep b/db/node_states/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/db/node_states/.htaccess b/db/node_states/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/db/node_states/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/db/peer_states/.gitkeep b/db/peer_states/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/db/peer_states/.htaccess b/db/peer_states/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/db/peer_states/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all -- 2.39.5