* Handles socket error 'connection timed out', but does not clear it for
* later debugging purposes.
*
- * @param $unlData A valid UNL data array
+ * @param $socketData Valid socket data array
* @return void
* @throws SocketConnectionException The connection attempts fails with a time-out
*/
- protected function handleSocketErrorConnectionTimedOut (array $unlData) {
+ protected function handleSocketErrorConnectionTimedOut (array $socketData) {
// Get socket error code for verification
$socketError = $this->getLastSocketError();
* Handles socket error 'resource temporary unavailable', but does not
* clear it for later debugging purposes.
*
- * @param $unlData A valid UNL data array
+ * @param $socketData Valid socket data array
* @return void
* @throws SocketConnectionException The connection attempts fails with a time-out
*/
- protected function handleSocketErrorResourceUnavailable (array $unlData) {
+ protected function handleSocketErrorResourceUnavailable (array $socketData) {
// Get socket error code for verification
$socketError = $this->getLastSocketError();
* Handles socket error 'connection refused', but does not clear it for
* later debugging purposes.
*
- * @param $unlData A valid UNL data array
+ * @param $socketData Valid socket data array
* @return void
* @throws SocketConnectionException The connection attempts fails with a time-out
*/
- protected function handleSocketErrorConnectionRefused (array $unlData) {
+ protected function handleSocketErrorConnectionRefused (array $socketData) {
// Get socket error code for verification
$socketError = $this->getLastSocketError();
* Handles socket error 'no route to host', but does not clear it for later
* debugging purposes.
*
- * @param $unlData A valid UNL data array
+ * @param $socketData Valid socket data array
* @return void
* @throws SocketConnectionException The connection attempts fails with a time-out
*/
- protected function handleSocketErrorNoRouteToHost (array $unlData) {
+ protected function handleSocketErrorNoRouteToHost (array $socketData) {
// Get socket error code for verification
$socketError = $this->getLastSocketError();
/**
* Handles socket error 'operation already in progress' which happens in
- * method connectToPeerByUnlData() on timed out connection
+ * method connectToPeerByUnlInstance() on timed out connection
* attempts.
*
- * @param $unlData A valid UNL data array
+ * @param $socketData Valid socket data array
* @return void
* @throws SocketConnectionException The connection attempts fails with a time-out
*/
- protected function handleSocketErrorOperationAlreadyProgress (array $unlData) {
+ protected function handleSocketErrorOperationAlreadyProgress (array $socketData) {
// Get socket error code for verification
$socketError = $this->getLastSocketError();
* Handles socket error 'connection reset by peer', but does not clear it for
* later debugging purposes.
*
- * @param $unlData A valid UNL data array
+ * @param $socketData Valid socket data array
* @return void
* @throws SocketConnectionException The connection attempts fails with a time-out
*/
- protected function handleSocketErrorConnectionResetByPeer (array $unlData) {
+ protected function handleSocketErrorConnectionResetByPeer (array $socketData) {
// Get socket error code for verification
$socketError = $this->getLastSocketError();
* Handles socket error 'operation not supported', but does not clear it for
* later debugging purposes.
*
- * @param $unlData A valid UNL data array
+ * @param $socketData Valid socket data array
* @return void
* @throws SocketOperationException The connection attempts fails with a time-out
*/
- protected function handleSocketErrorOperationNotSupported (array $unlData) {
+ protected function handleSocketErrorOperationNotSupported (array $socketData) {
// Get socket error code for verification
$socketError = $this->getLastSocketError();
* Handles socket "error" 'operation now in progress' which can be safely
* passed on with non-blocking connections.
*
- * @param $unlData A valid UNL data array
+ * @param $socketData Valid socket data array
* @return void
*/
- protected function handleSocketErrorOperationInProgress (array $unlData) {
+ protected function handleSocketErrorOperationInProgress (array $socketData) {
self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: Operation is now in progress, this is usual for non-blocking connections and is no bug.');
}
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('UNL-DISCOVERY:configKey=' . $configKey . ',unl=' . $GLOBALS[__METHOD__][$configKey] . ' - EXIT!');
return $GLOBALS[__METHOD__][$configKey];
}
-}
-// [EOF]
-?>
+}
// Init instance
$socketInstance = NULL;
- // Get an instance
- $factoryInstance = new SocketFactory();
-
// Construct registry key
$registryKey = 'socket_' . $protocolInstance->getProtocolName() . '_' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT];
//*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FACTORY: Going to use class ' . $className . ' for creating a socket resource ...');
// And call the static method
- $socketResource = call_user_func($className . '::createConnectionFromPackageData', $packageData);
-
- // Debug message
- //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FACTORY: Created socket ' . $socketResource . '(' . gettype($socketResource) . ') from class ' . $className . '.');
-
- // Construct container class, this won't be reached if an exception is thrown
- $socketInstance = self::createObjectByConfiguredName('socket_container_class', array($socketResource, NULL, $packageData));
+ $socketInstance = call_user_func($className . '::createConnectionFromPackageData', $packageData);
// Register it with the registry
Registry::getRegistry()->addInstance($registryKey, $socketInstance);
// Import application-specific sutff
use Hub\Handler\Protocol\HandleableProtocol;
-use Hub\Locator\Node\UniversalNodeLocator;
+use Hub\Locator\Node\LocateableNode;
use Hub\Tools\HubTools;
/**
* 'extra' => 'port'
* )
*
- * The value for 'extra' then must be handled by parseUniversalNodeLocator()
- * of the individual protocol handler as this is protocol-specific.
+ * The value for 'extra' then must be handled by the overwriting
+ * parseUniversalNodeLocator() method of the individual protocol handler as
+ * this is protocol-specific.
*
* @param $unl Universal Node Locator (UNL) to "parse"
- * @return $unlData Array with all components of the UNL
+ * @return $unlInstance An instance of a LocateableNode class
*/
- protected function parseGenericUniversalNodeLocator ($unl) {
+ protected function parseUniversalNodeLocator ($unl) {
// Debug message
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(': unl=' . $unl . ' - CALLED!');
// Now there is an almost useable array which then can be copied to the "real" array.
$unlData = array(
- UniversalNodeLocator::UNL_PART_PROTOCOL => $unlParts[0],
- UniversalNodeLocator::UNL_PART_ADDRESS => $unlParts[1][0],
- UniversalNodeLocator::UNL_PART_EXTRA => $unlParts[1][1]
+ LocateableNode::UNL_PART_PROTOCOL => $unlParts[0],
+ LocateableNode::UNL_PART_ADDRESS => $unlParts[1][0],
+ LocateableNode::UNL_PART_EXTRA => $unlParts[1][1]
);
// Debug message
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(': unlData=' . print_r($unlData, TRUE) . ' - EXIT!');
- // Return the generic array
- return $unlData;
+ // Create instance from it
+ //$unlInstance = ;
+ $this->partialStub('Please rewrite this part.');
+
+ // Return instance
+ return $unlInstance;
}
/**
*/
public function getAddressPart () {
// Return it
- return $this->getUniversalNodeLocatorDataElement(UniversalNodeLocator::UNL_PART_ADDRESS);
+ return $this->getUniversalNodeLocatorDataElement(LocateableNode::UNL_PART_ADDRESS);
}
/**
namespace Hub\Handler\Protocol\;
// Import application-specific stuff
+use Hub\Handler\Protocol\Network\IpV4\BaseIpV4Handler;
// Import framework stuff
namespace Hub\Handler\Protocol\Network\IpV4;
// Import application-specific stuff
-use Hub\Locator\Node\UniversalNodeLocator;
+use Hub\Locator\Node\LocateableNode;
use Hub\Network\Package\NetworkPackage;
/**
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class BaseIpV4ProtocolHandler extends BaseProtocolHandler {
- // Regular expression for validating IP:port UNLs
- const UNL_REGEX = '/^([a-z]{1,}):\/\/\b(([01]?\d?\d|2[0-4]\d|25[0-5])\.){3}([01]?\d?\d|2[0-4]\d|25[0-5])\b:(6553[0-5]|655[0-2][0-9]\d|65[0-4](\d){2}|6[0-4](\d){3}|[1-5](\d){4}|[1-9](\d){0,3})$/';
-
/**
* Port number
*/
parent::__construct($className);
// Set regex
- $this->setRegularExpression(self::UNL_REGEX);
+ $this->setRegularExpression(LocateableNode::UNL_REGEX);
}
/**
return $this->port;
}
- /**
- * Parses the given UNL by splitting it up in its components. The UNL ...
- *
- * protocol://address[:port]
- *
- * ... becomes:
- *
- * array(
- * 'protocol' => 'value',
- * 'address' => 'value',
- * 'port' => 123
- * )
- *
- * @param $unl Universal Node Locator (UNL) to "parse"
- * @return $unlData Array with all components of the UNL
- */
- protected function parseUniversalNodeLocator ($unl) {
- // Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(': unl=' . $unl . ' - CALLED!');
-
- // First generic parse
- $unlData = parent::parseGenericUniversalNodeLocator($unl);
-
- /*
- * Make sure the generic parts are all there. In case of a rewrite,
- * these assertitions will bail out on badly formed arrays.
- */
- assert(isset($unlData[UniversalNodeLocator::UNL_PART_PROTOCOL]));
- assert(isset($unlData[UniversalNodeLocator::UNL_PART_ADDRESS]));
- assert(isset($unlData[UniversalNodeLocator::UNL_PART_EXTRA]));
-
- // Copy 'extra' -> 'port' ...
- $unlData[UniversalNodeLocator::UNL_PART_PORT] = $unlData[UniversalNodeLocator::UNL_PART_EXTRA];
-
- // ... and drop 'extra'
- unset($unlData[UniversalNodeLocator::UNL_PART_EXTRA]);
-
- // Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(': unlData=' . print_r($unlData, TRUE) . ' - EXIT!');
- return $unlData;
- }
-
/**
* Validates given 'recipient' if it is a valid UNL. This means that the UNL
* can be parsed by the protocol handler.
// If this doesn't fail, continue validating the IP:port combination
if ($isValid === TRUE) {
// ... and validate IP:port, first "parse" the UNL
- $unlInstance = $this->parseUniversalNodeLocator($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]);
+ $unlInstance = UniversalNodeLocatorFactory::createUnlInstanceFromString($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]);
- // Set whole UNL data array
+ // Set whole UNL instance
+ // @TODO don't do this in a isValidFoo() method
$this->setUniversalNodeLocatorInstance($unlInstance);
// Set port
// Import application-specific stuff
use Hub\Container\Socket\StorableSocket;
use Hub\Helper\Connection\BaseConnectionHelper;
-use Hub\Locator\Node\UniversalNodeLocator;
+use Hub\Locator\Node\LocateableNode;
/**
* A ??? connection helper class
}
/**
- * Attempts to connect to a peer by given IP number and port from a valid
- * unlData array with currently configured timeout.
+ * Attempts to connect to a peer by given IP number and port from an UNL
+ * instance with currently configured timeout.
*
- * @param $unlData Valid UNL data array
+ * @param $unlInstance An instance of a LocateableNode class
* @return $isConnected Whether the connection went fine
* @see Please see http://de.php.net/manual/en/function.socket-connect.php#84465 for original code
* @todo Rewrite the while() loop to a iterator to not let the software stay very long here
*/
- protected function connectToPeerByUnlData (array $unlData) {
+ protected function connectToPeerByUnlInstance (LocateableNode $unlInstance) {
// Only call this if the connection is initialized by initConnection()
assert($this->isInitialized());
- // Is unlData complete?
- assert(isset($unlData[UniversalNodeLocator::UNL_PART_PROTOCOL]));
- assert(isset($unlData[UniversalNodeLocator::UNL_PART_ADDRESS]));
- assert(isset($unlData[UniversalNodeLocator::UNL_PART_PORT]));
+ // Is the UNL data complete?
+ assert($unlInstance->isValidUnl());
// "Cache" socket resource and timeout config
$timeout = $this->getConfigInstance()->getConfigEntry('socket_timeout_seconds');
// Debug output
- self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: Trying to connect to ' . $unlData[UniversalNodeLocator::UNL_PART_ADDRESS] . ':' . $unlData[UniversalNodeLocator::UNL_PART_PORT] . ' with socketResource[' . gettype($this->getSocketInstance()->getSocketResource() . ']=' . $this->getSocketInstance()->getSocketResource() . ' ...');
+ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: Trying to connect to ' . $unlInstance->getUnlAddress() . ':' . $unlInstance->getUnlPort() . ' with socketResource[' . gettype($this->getSocketInstance()->getSocketResource() . ']=' . $this->getSocketInstance()->getSocketResource() . ' ...');
// Get current time
$hasTimedOut = FALSE;
$time = time();
+ $this->partialStub('Please rewrite this part.');
+ return;
// Try to connect until it is connected
- while ($isConnected = !@socket_connect($this->getSocketInstance(), $unlData[UniversalNodeLocator::UNL_PART_ADDRESS], $unlData[UniversalNodeLocator::UNL_PART_PORT])) {
+ while ($isConnected = !@socket_connect($this->getSocketInstance(), $unlData[LocateableNode::UNL_PART_ADDRESS], $unlData[LocateableNode::UNL_PART_PORT])) {
// Get last socket error
$socketError = socket_last_error($this->getSocketInstance());
// Import application-specific stuff
use Hub\Helper\Connection\ConnectionHelper;
-use Hub\Locator\Node\UniversalNodeLocator;
+use Hub\Locator\Node\LocateableNode;
use Hub\Network\Package\NetworkPackage;
use Hub\Tools\HubTools;
+// Import framework stuff
+use CoreFramework\Factory\ObjectFactory;
+
/**
* A TCP connection helper class
*
// Create a socket instance
$socketResource = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
+ // Debug message
+ //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FACTORY: Created socket ' . $socketResource . '(' . gettype($socketResource) . ') from class ' . $className . '.');
+
+ // Construct container class, this won't be reached if an exception is thrown
+ $socketInstance = ObjectFactory::createObjectByConfiguredName('socket_container_class', array($socketResource, NULL, $packageData));
+
// Is the socket resource valid?
- if (!is_resource($socketResource)) {
+ if (!$socketInstance->isValidSocket()) {
/*
* Something bad happened, calling handleSocketError() is not
* possible here because that method would throw an
} // END - if
// Get socket error code for verification
- $socketError = socket_last_error($socketResource);
+ $socketError = $socketInstance->getLastSocketError();
// Check if there was an error else
if ($socketError > 0) {
// Handle this socket error with a faked recipientData array
- $helperInstance->handleSocketError(__METHOD__, __LINE__, $socketResource, array('0.0.0.0', '0'));
+ $helperInstance->handleSocketError(__METHOD__, __LINE__, $socketInstance, array('0.0.0.0', '0'));
// Then throw again
throw new SocketCreationException(array($helperInstance, gettype($socketResource), $socketError, socket_strerror($socketError)), StorableSocket::EXCEPTION_SOCKET_CREATION_FAILED);
} // END - if
// Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HELPER: Setting socket resource ... (' . gettype($socketResource) . ')');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HELPER: Setting socket instance ... (' . $socketInstance->__toString() . ')');
// Set the resource
- $helperInstance->setSocketResource($socketResource);
+ $helperInstance->setSocketInstance($socketInstance);
// Init connection
$helperInstance->initConnection();
// Is the recipient equal as configured IP
if (substr($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT], 0, strlen($helperInstance->getConfigInstance()->getConfigEntry('external_address'))) == $helperInstance->getConfigInstance()->getConfigEntry('external_address')) {
// This may connect to shipsimu.org and requests 'ip.php' which will return our external IP address
- $unlData[UniversalNodeLocator::UNL_PART_ADDRESS] = HubTools::determineExternalAddress();
+ $unlAddress = HubTools::determineExternalAddress();
// Do we have ip:port match?
// @TODO Rewrite this test for UNLs
$recipientArray = explode(':', $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]);
// Add the port
- $unlData[UniversalNodeLocator::UNL_PART_PORT] = $recipientArray[UniversalNodeLocator::UNL_PART_PORT];
+ $unlPort = $recipientArray[LocateableNode::UNL_PART_PORT];
+
+ // Create UNL instance
+ $this->partialStub('Please rewrite this part.');
+ //$unlInstance =;
} else {
// It doesn't match, we need to take care of this later
$helperInstance->debugInstance($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . '!=' . $helperInstance->getConfigInstance()->getConfigEntry('external_address'));
$helperInstance->setConnectionPort($unlInstance->getUnlPort());
// Now connect to it
- if (!$helperInstance->connectToPeerByUnlData($unlData)) {
+ if (!$helperInstance->connectToPeerByUnlInstance($unlData)) {
// Debug message
self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HELPER: helperInstance=' . $helperInstance->__toString() . ',unlData=' . print_r($unlData, TRUE));
use Hub\Helper\Connection\ConnectionHelper;
use Hub\Information\BaseInfo;
use Hub\Information\ShareableInfo;
-use Hub\Locator\Node\UniversalNodeLocator;
+use Hub\Locator\Node\LocateableNode;
// Import framework stuff
use CoreFramework\Listener\Listenable;
// Fill the generic array with several data from the listener:
$this->setProtocolName($listenerInstance->getProtocolName());
- $this->setGenericArrayElement('connection', 'dummy', 'dummy', UniversalNodeLocator::UNL_PART_ADDRESS , $listenerInstance->getListenAddress());
- $this->setGenericArrayElement('connection', 'dummy', 'dummy', UniversalNodeLocator::UNL_PART_PORT , $listenerInstance->getListenPort());
+ $this->setGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_ADDRESS , $listenerInstance->getListenAddress());
+ $this->setGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_PORT , $listenerInstance->getListenPort());
// Set listener here
$this->setListenerInstance($listenerInstance);
// Fill the generic array with several data from the listener:
$this->setProtocolName($helperInstance->getProtocolName());
- $this->setGenericArrayElement('connection', 'dummy', 'dummy', UniversalNodeLocator::UNL_PART_ADDRESS , $helperInstance->getAddress());
- $this->setGenericArrayElement('connection', 'dummy', 'dummy', UniversalNodeLocator::UNL_PART_PORT , $helperInstance->getConnectionPort());
+ $this->setGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_ADDRESS , $helperInstance->getAddress());
+ $this->setGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_PORT , $helperInstance->getConnectionPort());
// Set helper here
$this->setHelperInstance($helperInstance);
*/
public final function getAddress () {
// Return it from generic array
- return $this->getGenericArrayElement('connection', 'dummy', 'dummy', UniversalNodeLocator::UNL_PART_ADDRESS);
+ return $this->getGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_ADDRESS);
}
/**
*/
public final function getPort () {
// Return it from generic array
- return $this->getGenericArrayElement('connection', 'dummy', 'dummy', UniversalNodeLocator::UNL_PART_PORT);
+ return $this->getGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_PORT);
}
}
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class UniversalNodeLocator extends BaseHubSystem implements LocateableNode {
- //------- UNL parts -------
- // Protocol
- const UNL_PART_PROTOCOL = 'protocol';
- // Address
- const UNL_PART_ADDRESS = 'address';
- // Extra part
- const UNL_PART_EXTRA = 'extra';
- // Port (if any)
- const UNL_PART_PORT = 'port';
-
/**
* UNL data array
*/
// Import application-specific stuff
use Hub\Container\Socket\StorableSocket;
-use Hub\Locator\Node\UniversalNodeLocator;
+use Hub\Locator\Node\LocateableNode;
use Hub\Network\Package\NetworkPackage;
use Hub\Pool\BasePool;
use Hub\Pool\Peer\PoolablePeer;
$unlData = $handlerInstance->getUniversalNodeLocatorDataArray();
// Make sure it is a valid Universal Node Locator array (3 elements)
- assert(isset($unlData[UniversalNodeLocator::UNL_PART_PROTOCOL]));
- assert(isset($unlData[UniversalNodeLocator::UNL_PART_ADDRESS]));
- assert(isset($unlData[UniversalNodeLocator::UNL_PART_PORT]));
+ assert(isset($unlData[LocateableNode::UNL_PART_PROTOCOL]));
+ assert(isset($unlData[LocateableNode::UNL_PART_ADDRESS]));
+ assert(isset($unlData[LocateableNode::UNL_PART_PORT]));
// Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL: Checking ' . count($this->getAllSockets()) . ' socket(s),unlData[' . UniversalNodeLocator::UNL_PART_ADDRESS . ']=' . $unlData[UniversalNodeLocator::UNL_PART_ADDRESS] . ',unlData[' . UniversalNodeLocator::UNL_PART_PORT . ']=' . $unlData[UniversalNodeLocator::UNL_PART_PORT] . ' ...');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL: Checking ' . count($this->getAllSockets()) . ' socket(s),unlData[' . LocateableNode::UNL_PART_ADDRESS . ']=' . $unlData[LocateableNode::UNL_PART_ADDRESS] . ',unlData[' . LocateableNode::UNL_PART_PORT . ']=' . $unlData[LocateableNode::UNL_PART_PORT] . ' ...');
// Default is all sockets
$sockets = $this->getAllSockets();
// Get
// If the "peer" IP and recipient is same, use it
- if ($peerAddress == $unlData[UniversalNodeLocator::UNL_PART_ADDRESS]) {
+ if ($peerAddress == $unlData[LocateableNode::UNL_PART_ADDRESS]) {
// IPs match, so take the socket and quit this loop
$socketInstance = $socketArray[self::SOCKET_ARRAY_INSTANCE];
/**
* Getter for UNL instance
*
- * @return $unlData An instance of a LocateableNode class
+ * @return $unlInstance An instance of a LocateableNode class
*/
function getUniversalNodeLocatorInstance ();
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
interface LocateableNode extends HubInterface {
+ //------- UNL parts -------
+ // Protocol
+ const UNL_PART_PROTOCOL = 'protocol';
+ // Address
+ const UNL_PART_ADDRESS = 'address';
+ // Extra part
+ const UNL_PART_EXTRA = 'extra';
+ // Port (if any)
+ const UNL_PART_PORT = 'port';
+
+ /**
+ * Regular expression for validating IP:port UNLs
+ */
+ const UNL_REGEX = '/^([a-z]{1,}):\/\/\b(([01]?\d?\d|2[0-4]\d|25[0-5])\.){3}([01]?\d?\d|2[0-4]\d|25[0-5])\b:(6553[0-5]|655[0-2][0-9]\d|65[0-4](\d){2}|6[0-4](\d){3}|[1-5](\d){4}|[1-9](\d){0,3})$/';
+
/**
* Getter for external UNL
*
* @return $unl Universal node locator
*/
function resolveUniversalNodeLocatorFromConfigKey ($configKey);
-}
-// [EOF]
-?>
+}