From 12a160a280dcaa5dec2bbe257c03a3753f2254af Mon Sep 17 00:00:00 2001 From: Domenico Lupinetti Date: Mon, 28 Sep 2015 01:44:13 +0200 Subject: [PATCH] Implemented Hi Availability for OrientDB Distributed Configuration --- docs/ApiIndex.md | 4 +- docs/Home.md | 4 +- docs/PhpOrient-Configuration-Constants.md | 6 +- docs/PhpOrient-PhpOrient | 4 +- docs/PhpOrient-PhpOrient.md | 46 ++++- ...nt-Protocols-Binary-Abstracts-Operation.md | 49 ++++-- docs/PhpOrient-Protocols-Binary-Data-Bag.md | 54 +++++- .../PhpOrient-Protocols-Binary-Data-Record.md | 22 +-- ...ent-Protocols-Binary-Operations-Command.md | 52 ++++-- ...ent-Protocols-Binary-Operations-Connect.md | 52 ++++-- ...tocols-Binary-Operations-DataClusterAdd.md | 52 ++++-- ...cols-Binary-Operations-DataClusterCount.md | 52 ++++-- ...-Binary-Operations-DataClusterDataRange.md | 52 ++++-- ...ocols-Binary-Operations-DataClusterDrop.md | 52 ++++-- ...ent-Protocols-Binary-Operations-DbClose.md | 52 ++++-- ...tocols-Binary-Operations-DbCountRecords.md | 52 ++++-- ...nt-Protocols-Binary-Operations-DbCreate.md | 52 ++++-- ...ient-Protocols-Binary-Operations-DbDrop.md | 52 ++++-- ...nt-Protocols-Binary-Operations-DbExists.md | 52 ++++-- ...nt-Protocols-Binary-Operations-DbFreeze.md | 52 ++++-- ...ient-Protocols-Binary-Operations-DbList.md | 52 ++++-- ...ient-Protocols-Binary-Operations-DbOpen.md | 52 ++++-- ...t-Protocols-Binary-Operations-DbRelease.md | 52 ++++-- ...nt-Protocols-Binary-Operations-DbReload.md | 52 ++++-- ...ient-Protocols-Binary-Operations-DbSize.md | 52 ++++-- ...rotocols-Binary-Operations-RecordCreate.md | 52 ++++-- ...rotocols-Binary-Operations-RecordDelete.md | 52 ++++-- ...-Protocols-Binary-Operations-RecordLoad.md | 68 +++++--- ...rotocols-Binary-Operations-RecordUpdate.md | 52 ++++-- ...nt-Protocols-Binary-Operations-ShutDown.md | 52 ++++-- ...PhpOrient-Protocols-Binary-SocketTransport | 10 +- ...Orient-Protocols-Binary-SocketTransport.md | 141 ++++++++++++++- ...t-Protocols-Binary-Transaction-TxCommit.md | 52 ++++-- ...pOrient-Protocols-Common-AbstractTransport | 10 +- ...ient-Protocols-Common-AbstractTransport.md | 124 ++++++++++++- docs/PhpOrient-Protocols-Common-ClusterMap | 38 ++-- ...PhpOrient-Protocols-Common-ClustersMap.md} | 62 ++----- docs/PhpOrient-Protocols-Common-OrientNode.md | 106 +++++++++++ ...hpOrient-Protocols-Common-OrientVersion.md | 164 ++++++++++++++++++ src/PhpOrient/PhpOrient.php | 8 +- .../Protocols/Binary/Abstracts/Operation.php | 48 +++-- .../Protocols/Binary/Operations/DbClose.php | 4 +- .../Protocols/Binary/Operations/DbOpen.php | 20 ++- .../Protocols/Binary/Operations/DbReload.php | 4 +- .../Protocols/Binary/Operations/ShutDown.php | 4 +- .../Protocols/Binary/OrientSocket.php | 5 +- .../Protocols/Binary/SocketTransport.php | 57 +++++- .../Protocols/Common/AbstractTransport.php | 67 ++++++- .../{ClusterMap.php => ClustersMap.php} | 71 +------- src/PhpOrient/Protocols/Common/OrientNode.php | 78 +++++++++ .../Protocols/Common/OrientVersion.php | 112 ++++++++++++ tests/PhpOrient/Abstracts/TestCase.php | 4 +- tests/PhpOrient/RecordCommandsTest.php | 11 +- tests/PhpOrient/TestClusterMap.php | 1 - tests/PhpOrient/TestOrientNode.php | 40 +++++ 55 files changed, 1938 insertions(+), 652 deletions(-) rename docs/{PhpOrient-Protocols-Common-ClusterMap.md => PhpOrient-Protocols-Common-ClustersMap.md} (72%) create mode 100644 docs/PhpOrient-Protocols-Common-OrientNode.md create mode 100644 docs/PhpOrient-Protocols-Common-OrientVersion.md rename src/PhpOrient/Protocols/Common/{ClusterMap.php => ClustersMap.php} (84%) create mode 100644 src/PhpOrient/Protocols/Common/OrientNode.php create mode 100644 src/PhpOrient/Protocols/Common/OrientVersion.php create mode 100644 tests/PhpOrient/TestOrientNode.php diff --git a/docs/ApiIndex.md b/docs/ApiIndex.md index 69d62d7..16cc45b 100644 --- a/docs/ApiIndex.md +++ b/docs/ApiIndex.md @@ -52,10 +52,12 @@ API Index * PhpOrient\Protocols\Binary\Transaction * [TxCommit](PhpOrient-Protocols-Binary-Transaction-TxCommit) * PhpOrient\Protocols\Common + * [OrientVersion](PhpOrient-Protocols-Common-OrientVersion) * [AbstractTransport](PhpOrient-Protocols-Common-AbstractTransport) * [ConfigurableInterface](PhpOrient-Protocols-Common-ConfigurableInterface) - * [ClusterMap](PhpOrient-Protocols-Common-ClusterMap) + * [OrientNode](PhpOrient-Protocols-Common-OrientNode) * [TransportInterface](PhpOrient-Protocols-Common-TransportInterface) + * [ClustersMap](PhpOrient-Protocols-Common-ClustersMap) * [Constants](PhpOrient-Protocols-Common-Constants) * [PhpOrient](PhpOrient-PhpOrient) diff --git a/docs/Home.md b/docs/Home.md index 69d62d7..16cc45b 100644 --- a/docs/Home.md +++ b/docs/Home.md @@ -52,10 +52,12 @@ API Index * PhpOrient\Protocols\Binary\Transaction * [TxCommit](PhpOrient-Protocols-Binary-Transaction-TxCommit) * PhpOrient\Protocols\Common + * [OrientVersion](PhpOrient-Protocols-Common-OrientVersion) * [AbstractTransport](PhpOrient-Protocols-Common-AbstractTransport) * [ConfigurableInterface](PhpOrient-Protocols-Common-ConfigurableInterface) - * [ClusterMap](PhpOrient-Protocols-Common-ClusterMap) + * [OrientNode](PhpOrient-Protocols-Common-OrientNode) * [TransportInterface](PhpOrient-Protocols-Common-TransportInterface) + * [ClustersMap](PhpOrient-Protocols-Common-ClustersMap) * [Constants](PhpOrient-Protocols-Common-Constants) * [PhpOrient](PhpOrient-PhpOrient) diff --git a/docs/PhpOrient-Configuration-Constants.md b/docs/PhpOrient-Configuration-Constants.md index cf0e324..e441dd5 100644 --- a/docs/PhpOrient-Configuration-Constants.md +++ b/docs/PhpOrient-Configuration-Constants.md @@ -17,7 +17,7 @@ Constants ### VERSION ```php - const VERSION = "v1.1.2" + const VERSION = "v1.2.1" ``` @@ -33,7 +33,7 @@ Constants ### NAME ```php - const NAME = "PhpOrient - PHP binary client for OrientDB" + const NAME = "PhpOrient - Php driver based on the binary protocol of OrientDB." ``` @@ -41,7 +41,7 @@ Constants ### SUPPORTED_PROTOCOL ```php - const SUPPORTED_PROTOCOL = 28 + const SUPPORTED_PROTOCOL = 32 ``` diff --git a/docs/PhpOrient-PhpOrient b/docs/PhpOrient-PhpOrient index c8a5ca0..75a776a 100644 --- a/docs/PhpOrient-PhpOrient +++ b/docs/PhpOrient-PhpOrient @@ -461,7 +461,7 @@ A callback function is needed ### dbReload ```php - \PhpOrient\Protocols\Common\ClusterMap PhpOrient\PhpOrient::dbReload() + \PhpOrient\Protocols\Common\ClustersMap PhpOrient\PhpOrient::dbReload() ``` ##### Reload the structure of a Database @@ -491,7 +491,7 @@ A callback function is needed ### dbOpen ```php - \PhpOrient\Protocols\Common\ClusterMap PhpOrient\PhpOrient::dbOpen(string $database, string $username, string $password, array $params) + \PhpOrient\Protocols\Common\ClustersMap PhpOrient\PhpOrient::dbOpen(string $database, string $username, string $password, array $params) ``` ##### Open a Database and perform a connection
if it is not established before diff --git a/docs/PhpOrient-PhpOrient.md b/docs/PhpOrient-PhpOrient.md index 2086765..df2ffa9 100644 --- a/docs/PhpOrient-PhpOrient.md +++ b/docs/PhpOrient-PhpOrient.md @@ -146,6 +146,18 @@ Properties * Visibility: **protected** +#### $fetchClass +```php + protected boolean $fetchClass = null +``` + + + + +* Visibility: **protected** +* This property is **static**. + + Methods ------- @@ -461,7 +473,7 @@ A callback function is needed ### dbReload ```php - \PhpOrient\Protocols\Common\ClusterMap PhpOrient\PhpOrient::dbReload() + \PhpOrient\Protocols\Common\ClustersMap PhpOrient\PhpOrient::dbReload() ``` ##### Reload the structure of a Database @@ -491,7 +503,7 @@ A callback function is needed ### dbOpen ```php - \PhpOrient\Protocols\Common\ClusterMap PhpOrient\PhpOrient::dbOpen(string $database, string $username, string $password, array $params) + \PhpOrient\Protocols\Common\ClustersMap PhpOrient\PhpOrient::dbOpen(string $database, string $username, string $password, array $params) ``` ##### Open a Database and perform a connection
if it is not established before @@ -686,6 +698,36 @@ Flushes all cached content to the disk storage and allows to perform only read c +### setFetchClass +```php + \PhpOrient\PhpOrient PhpOrient\PhpOrient::setFetchClass(boolean|string $className) +``` +##### Allow the next query to be fetched in a custom class + + + +* Visibility: **public** + + +##### Arguments +* $className **boolean|string** + + + +### getFetchClass +```php + string|boolean PhpOrient\PhpOrient::getFetchClass() +``` +##### Get the current value of the fetch custom class name + + + +* Visibility: **public** +* This method is **static**. + + + + ### configure ```php \PhpOrient\Protocols\Common\ConfigurableInterface PhpOrient\Protocols\Common\ConfigurableInterface::configure(array $options) diff --git a/docs/PhpOrient-Protocols-Binary-Abstracts-Operation.md b/docs/PhpOrient-Protocols-Binary-Abstracts-Operation.md index 091c621..e4b61db 100644 --- a/docs/PhpOrient-Protocols-Binary-Abstracts-Operation.md +++ b/docs/PhpOrient-Protocols-Binary-Abstracts-Operation.md @@ -86,13 +86,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -185,6 +185,36 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -469,19 +499,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Data-Bag.md b/docs/PhpOrient-Protocols-Binary-Data-Bag.md index b7a33e7..46ae20e 100644 --- a/docs/PhpOrient-Protocols-Binary-Data-Bag.md +++ b/docs/PhpOrient-Protocols-Binary-Data-Bag.md @@ -8,7 +8,7 @@ PhpOrient\Protocols\Binary\Data\Bag * Class name: Bag * Namespace: PhpOrient\Protocols\Binary\Data -* This class implements: Countable, ArrayAccess, Iterator +* This class implements: Countable, ArrayAccess, Iterator, JsonSerializable Constants @@ -35,9 +35,9 @@ Properties ---------- -#### $serialized +#### $base64Content ```php - protected string $serialized + protected string $base64Content ``` @@ -46,9 +46,9 @@ Properties * Visibility: **protected** -#### $deserialized +#### $binaryContent ```php - protected string $deserialized + protected string $binaryContent ``` @@ -184,7 +184,7 @@ Methods ### __construct ```php - mixed PhpOrient\Protocols\Binary\Data\Bag::__construct(string $serialized) + mixed PhpOrient\Protocols\Binary\Data\Bag::__construct(string $base64Content) ``` ##### # RIDBag Constructor @@ -194,7 +194,7 @@ Methods ##### Arguments -* $serialized **string**

the base64 encoded bag

+* $base64Content **string**

the base64 encoded bag

@@ -224,6 +224,46 @@ Methods +### getRids +```php + array PhpOrient\Protocols\Binary\Data\Bag::getRids() +``` +##### Get the list of contained RIDs + + + +* Visibility: **public** + + + + +### getRawBagContent +```php + string PhpOrient\Protocols\Binary\Data\Bag::getRawBagContent() +``` +##### Get the original raw content for the Bag + + + +* Visibility: **public** + + + + +### jsonSerialize +```php + mixed PhpOrient\Protocols\Binary\Data\Bag::jsonSerialize() +``` +##### (PHP 5 >= 5.4.0)
+Specify data which should be serialized to JSON + + + +* Visibility: **public** + + + + ### parse ```php mixed PhpOrient\Protocols\Binary\Data\Bag::parse() diff --git a/docs/PhpOrient-Protocols-Binary-Data-Record.md b/docs/PhpOrient-Protocols-Binary-Data-Record.md index e178456..f6d807b 100644 --- a/docs/PhpOrient-Protocols-Binary-Data-Record.md +++ b/docs/PhpOrient-Protocols-Binary-Data-Record.md @@ -154,7 +154,7 @@ Methods ### setOData ```php - \PhpOrient\Protocols\Binary\Data\Record PhpOrient\Protocols\Binary\Data\Record::setOData(array $oData) + \PhpOrient\Protocols\Binary\Data\Record PhpOrient\Protocols\Binary\Data\Record::setOData(array|null $oData) ``` ##### Sets the Orient Record Content @@ -164,7 +164,7 @@ Methods ##### Arguments -* $oData **array** +* $oData **array|null** @@ -337,35 +337,35 @@ content as property -### configure +### fromConfig ```php - \PhpOrient\Protocols\Binary\Data\Record PhpOrient\Protocols\Binary\Data\Record::configure(array $options) + static PhpOrient\Protocols\Binary\Data\Record::fromConfig(array $options) ``` -##### Configure the object. +##### Return a new class instance configured from the given options. * Visibility: **public** +* This method is **static**. ##### Arguments -* $options **array**

The options for the object.

+* $options **array**

The options for the newly created class instance.

-### fromConfig +### configure ```php - static PhpOrient\Protocols\Binary\Data\Record::fromConfig(array $options) + \PhpOrient\Protocols\Binary\Data\Record PhpOrient\Protocols\Binary\Data\Record::configure(array $options) ``` -##### Return a new class instance configured from the given options. +##### Configure the object. * Visibility: **public** -* This method is **static**. ##### Arguments -* $options **array**

The options for the newly created class instance.

+* $options **array**

The options for the object.

diff --git a/docs/PhpOrient-Protocols-Binary-Operations-Command.md b/docs/PhpOrient-Protocols-Binary-Operations-Command.md index 111ab34..952d739 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-Command.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-Command.md @@ -232,13 +232,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -337,6 +337,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -641,20 +673,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-Connect.md b/docs/PhpOrient-Protocols-Binary-Operations-Connect.md index 04473f7..02c3a21 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-Connect.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-Connect.md @@ -152,13 +152,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -257,6 +257,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -561,20 +593,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-DataClusterAdd.md b/docs/PhpOrient-Protocols-Binary-Operations-DataClusterAdd.md index f616f91..2be93c6 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-DataClusterAdd.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-DataClusterAdd.md @@ -141,13 +141,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -246,6 +246,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -550,20 +582,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-DataClusterCount.md b/docs/PhpOrient-Protocols-Binary-Operations-DataClusterCount.md index 1192511..4bbc39e 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-DataClusterCount.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-DataClusterCount.md @@ -108,13 +108,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -213,6 +213,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -517,20 +549,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-DataClusterDataRange.md b/docs/PhpOrient-Protocols-Binary-Operations-DataClusterDataRange.md index db8dd42..1e484c3 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-DataClusterDataRange.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-DataClusterDataRange.md @@ -97,13 +97,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -202,6 +202,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -506,20 +538,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-DataClusterDrop.md b/docs/PhpOrient-Protocols-Binary-Operations-DataClusterDrop.md index 1bf6d7d..effda4a 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-DataClusterDrop.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-DataClusterDrop.md @@ -97,13 +97,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -202,6 +202,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -506,20 +538,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-DbClose.md b/docs/PhpOrient-Protocols-Binary-Operations-DbClose.md index 7bc71a7..f45bd82 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-DbClose.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-DbClose.md @@ -86,13 +86,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -205,6 +205,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -495,20 +527,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-DbCountRecords.md b/docs/PhpOrient-Protocols-Binary-Operations-DbCountRecords.md index 795ba35..9537a48 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-DbCountRecords.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-DbCountRecords.md @@ -97,13 +97,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -202,6 +202,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -506,20 +538,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-DbCreate.md b/docs/PhpOrient-Protocols-Binary-Operations-DbCreate.md index a3148de..0322322 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-DbCreate.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-DbCreate.md @@ -119,13 +119,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -224,6 +224,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -528,20 +560,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-DbDrop.md b/docs/PhpOrient-Protocols-Binary-Operations-DbDrop.md index b330538..6f182e4 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-DbDrop.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-DbDrop.md @@ -108,13 +108,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -213,6 +213,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -517,20 +549,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-DbExists.md b/docs/PhpOrient-Protocols-Binary-Operations-DbExists.md index 889c222..c369034 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-DbExists.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-DbExists.md @@ -108,13 +108,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -213,6 +213,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -517,20 +549,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-DbFreeze.md b/docs/PhpOrient-Protocols-Binary-Operations-DbFreeze.md index a626f0d..0ac6535 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-DbFreeze.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-DbFreeze.md @@ -108,13 +108,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -213,6 +213,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -517,20 +549,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-DbList.md b/docs/PhpOrient-Protocols-Binary-Operations-DbList.md index 410c9d2..ef5a732 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-DbList.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-DbList.md @@ -86,13 +86,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -191,6 +191,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -495,20 +527,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-DbOpen.md b/docs/PhpOrient-Protocols-Binary-Operations-DbOpen.md index f6cbdb7..1ef0623 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-DbOpen.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-DbOpen.md @@ -174,13 +174,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -279,6 +279,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -583,20 +615,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-DbRelease.md b/docs/PhpOrient-Protocols-Binary-Operations-DbRelease.md index 35bf47b..fcee10d 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-DbRelease.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-DbRelease.md @@ -108,13 +108,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -213,6 +213,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -517,20 +549,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-DbReload.md b/docs/PhpOrient-Protocols-Binary-Operations-DbReload.md index 7899897..59eb06f 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-DbReload.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-DbReload.md @@ -86,13 +86,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -191,6 +191,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -495,20 +527,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-DbSize.md b/docs/PhpOrient-Protocols-Binary-Operations-DbSize.md index 9e87add..225e751 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-DbSize.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-DbSize.md @@ -86,13 +86,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -191,6 +191,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -495,20 +527,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-RecordCreate.md b/docs/PhpOrient-Protocols-Binary-Operations-RecordCreate.md index 0a94792..91c16bb 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-RecordCreate.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-RecordCreate.md @@ -141,13 +141,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -246,6 +246,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -550,20 +582,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-RecordDelete.md b/docs/PhpOrient-Protocols-Binary-Operations-RecordDelete.md index 10db493..2630bdd 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-RecordDelete.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-RecordDelete.md @@ -165,13 +165,13 @@ cluster_id and cluster_position separately #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -270,6 +270,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -574,20 +606,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-RecordLoad.md b/docs/PhpOrient-Protocols-Binary-Operations-RecordLoad.md index c258828..8bf8183 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-RecordLoad.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-RecordLoad.md @@ -18,17 +18,6 @@ Properties ---------- -#### $_callback -```php - public \Closure $_callback -``` - - - - -* Visibility: **public** - - #### $opCode ```php protected integer $opCode @@ -158,6 +147,17 @@ Properties +* Visibility: **protected** + + +#### $_callback +```php + protected \Closure $_callback +``` + Callback function to apply on Async records when they are fetched + + + * Visibility: **protected** @@ -257,6 +257,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -561,20 +593,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-RecordUpdate.md b/docs/PhpOrient-Protocols-Binary-Operations-RecordUpdate.md index 932b550..0b53c96 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-RecordUpdate.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-RecordUpdate.md @@ -222,13 +222,13 @@ NOT USED before protocol 23 #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -327,6 +327,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -631,20 +663,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-Operations-ShutDown.md b/docs/PhpOrient-Protocols-Binary-Operations-ShutDown.md index a26d6ff..9ffb2c5 100644 --- a/docs/PhpOrient-Protocols-Binary-Operations-ShutDown.md +++ b/docs/PhpOrient-Protocols-Binary-Operations-ShutDown.md @@ -108,13 +108,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -213,6 +213,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -517,20 +549,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Binary-SocketTransport b/docs/PhpOrient-Protocols-Binary-SocketTransport index a9b477c..88d4708 100644 --- a/docs/PhpOrient-Protocols-Binary-SocketTransport +++ b/docs/PhpOrient-Protocols-Binary-SocketTransport @@ -152,7 +152,7 @@ Properties #### $clusterList ```php - protected \PhpOrient\Protocols\Common\ClusterMap $clusterList + protected \PhpOrient\Protocols\Common\ClustersMap $clusterList ``` @@ -411,7 +411,7 @@ with non-viewable characters. ### getClusterMap ```php - \PhpOrient\Protocols\Common\ClusterMap PhpOrient\Protocols\Common\AbstractTransport::getClusterMap() + \PhpOrient\Protocols\Common\ClustersMap PhpOrient\Protocols\Common\AbstractTransport::getClusterMap() ``` ##### @@ -423,9 +423,9 @@ with non-viewable characters. -### setClusterMap +### setClustersMap ```php - mixed PhpOrient\Protocols\Common\AbstractTransport::setClusterMap(\PhpOrient\Protocols\Common\ClusterMap $clusterList) + mixed PhpOrient\Protocols\Common\AbstractTransport::setClustersMap(\PhpOrient\Protocols\Common\ClustersMap $clusterList) ``` ##### @@ -436,7 +436,7 @@ with non-viewable characters. ##### Arguments -* $clusterList **[PhpOrient\Protocols\Common\ClusterMap](PhpOrient-Protocols-Common-ClusterMap)** +* $clusterList **[PhpOrient\Protocols\Common\ClustersMap](PhpOrient-Protocols-Common-ClustersMap)** diff --git a/docs/PhpOrient-Protocols-Binary-SocketTransport.md b/docs/PhpOrient-Protocols-Binary-SocketTransport.md index a9b477c..b306d29 100644 --- a/docs/PhpOrient-Protocols-Binary-SocketTransport.md +++ b/docs/PhpOrient-Protocols-Binary-SocketTransport.md @@ -37,6 +37,17 @@ Properties +* Visibility: **public** + + +#### $databaseName +```php + public string $databaseName +``` + The database actually open + + + * Visibility: **public** @@ -150,9 +161,20 @@ Properties * Visibility: **protected** -#### $clusterList +#### $clusterMap +```php + protected \PhpOrient\Protocols\Common\ClustersMap $clusterMap +``` + + + + +* Visibility: **protected** + + +#### $nodesList ```php - protected \PhpOrient\Protocols\Common\ClusterMap $clusterList + protected array $nodesList ``` @@ -170,7 +192,17 @@ Properties * Visibility: **protected** -* This property is **static**. + + +#### $orientVersion +```php + protected \PhpOrient\Protocols\Common\OrientVersion $orientVersion +``` + + + + +* Visibility: **protected** Methods @@ -392,11 +424,39 @@ with non-viewable characters. +### setLogger +```php + mixed PhpOrient\Protocols\Common\AbstractTransport::setLogger() +``` +##### Set the client Logger + + + +* Visibility: **public** +* This method is defined by [PhpOrient\Protocols\Common\AbstractTransport](PhpOrient-Protocols-Common-AbstractTransport) + + + + +### getLogger +```php + \Psr\Log\LoggerInterface PhpOrient\Protocols\Common\AbstractTransport::getLogger() +``` +##### Get the Logger from transport + + + +* Visibility: **public** +* This method is defined by [PhpOrient\Protocols\Common\AbstractTransport](PhpOrient-Protocols-Common-AbstractTransport) + + + + ### debug ```php mixed PhpOrient\Protocols\Common\AbstractTransport::debug($message) ``` -##### +##### Debug method @@ -411,7 +471,7 @@ with non-viewable characters. ### getClusterMap ```php - \PhpOrient\Protocols\Common\ClusterMap PhpOrient\Protocols\Common\AbstractTransport::getClusterMap() + \PhpOrient\Protocols\Common\ClustersMap PhpOrient\Protocols\Common\AbstractTransport::getClusterMap() ``` ##### @@ -423,9 +483,9 @@ with non-viewable characters. -### setClusterMap +### setClustersMap ```php - mixed PhpOrient\Protocols\Common\AbstractTransport::setClusterMap(\PhpOrient\Protocols\Common\ClusterMap $clusterList) + mixed PhpOrient\Protocols\Common\AbstractTransport::setClustersMap(\PhpOrient\Protocols\Common\ClustersMap $clusterList) ``` ##### @@ -436,7 +496,7 @@ with non-viewable characters. ##### Arguments -* $clusterList **[PhpOrient\Protocols\Common\ClusterMap](PhpOrient-Protocols-Common-ClusterMap)** +* $clusterList **[PhpOrient\Protocols\Common\ClustersMap](PhpOrient-Protocols-Common-ClustersMap)** @@ -454,6 +514,71 @@ with non-viewable characters. +### getNodesList +```php + array PhpOrient\Protocols\Common\AbstractTransport::getNodesList(boolean|false $filterActualNode) +``` +##### Retrieve the nodes list, optionally filter excluding the actual one + +//TODO Improve with different protocol types handler if another transport protocol are implemented + +* Visibility: **public** +* This method is defined by [PhpOrient\Protocols\Common\AbstractTransport](PhpOrient-Protocols-Common-AbstractTransport) + + +##### Arguments +* $filterActualNode **boolean|false** + + + +### setNodesList +```php + mixed PhpOrient\Protocols\Common\AbstractTransport::setNodesList(array $nodesList) +``` +##### + + + +* Visibility: **public** +* This method is defined by [PhpOrient\Protocols\Common\AbstractTransport](PhpOrient-Protocols-Common-AbstractTransport) + + +##### Arguments +* $nodesList **array<mixed,\PhpOrient\Protocols\Common\OrientNode>** + + + +### getOrientVersion +```php + \PhpOrient\Protocols\Common\OrientVersion PhpOrient\Protocols\Common\AbstractTransport::getOrientVersion() +``` +##### + + + +* Visibility: **public** +* This method is defined by [PhpOrient\Protocols\Common\AbstractTransport](PhpOrient-Protocols-Common-AbstractTransport) + + + + +### setOrientVersion +```php + mixed PhpOrient\Protocols\Common\AbstractTransport::setOrientVersion(\PhpOrient\Protocols\Common\OrientVersion $orientVersion) +``` +##### + + + +* Visibility: **public** +* This method is defined by [PhpOrient\Protocols\Common\AbstractTransport](PhpOrient-Protocols-Common-AbstractTransport) + + +##### Arguments +* $orientVersion **[PhpOrient\Protocols\Common\OrientVersion](PhpOrient-Protocols-Common-OrientVersion)** + + + ### configure ```php \PhpOrient\Protocols\Common\ConfigurableInterface PhpOrient\Protocols\Common\ConfigurableInterface::configure(array $options) diff --git a/docs/PhpOrient-Protocols-Binary-Transaction-TxCommit.md b/docs/PhpOrient-Protocols-Binary-Transaction-TxCommit.md index d48b7cb..8c29a2d 100644 --- a/docs/PhpOrient-Protocols-Binary-Transaction-TxCommit.md +++ b/docs/PhpOrient-Protocols-Binary-Transaction-TxCommit.md @@ -183,13 +183,13 @@ Properties #### $_callback ```php - public \Closure $_callback + protected \Closure $_callback ``` - + Callback function to apply on Async records when they are fetched -* Visibility: **public** +* Visibility: **protected** Methods @@ -356,6 +356,38 @@ Methods +### _pushReceived +```php + mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_pushReceived($command_id, $payload) +``` +##### Default callback for received push Notices + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + +##### Arguments +* $command_id **mixed** +* $payload **mixed** + + + +### _readError +```php + \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() +``` +##### Read an error from the remote server and turn it into an exception. + + + +* Visibility: **protected** +* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) + + + + ### prepare ```php \PhpOrient\Protocols\Binary\Abstracts\Operation PhpOrient\Protocols\Binary\Abstracts\Operation::prepare() @@ -660,20 +692,6 @@ Methods -### _readError -```php - \PhpOrient\Exceptions\PhpOrientException PhpOrient\Protocols\Binary\Abstracts\Operation::_readError() -``` -##### Read an error from the remote server and turn it into an exception. - - - -* Visibility: **protected** -* This method is defined by [PhpOrient\Protocols\Binary\Abstracts\Operation](PhpOrient-Protocols-Binary-Abstracts-Operation) - - - - ### _readSerialized ```php mixed PhpOrient\Protocols\Binary\Abstracts\Operation::_readSerialized() diff --git a/docs/PhpOrient-Protocols-Common-AbstractTransport b/docs/PhpOrient-Protocols-Common-AbstractTransport index 270599a..94be422 100644 --- a/docs/PhpOrient-Protocols-Common-AbstractTransport +++ b/docs/PhpOrient-Protocols-Common-AbstractTransport @@ -64,7 +64,7 @@ Properties #### $clusterList ```php - protected \PhpOrient\Protocols\Common\ClusterMap $clusterList + protected \PhpOrient\Protocols\Common\ClustersMap $clusterList ``` @@ -120,7 +120,7 @@ Methods ### getClusterMap ```php - \PhpOrient\Protocols\Common\ClusterMap PhpOrient\Protocols\Common\AbstractTransport::getClusterMap() + \PhpOrient\Protocols\Common\ClustersMap PhpOrient\Protocols\Common\AbstractTransport::getClusterMap() ``` ##### @@ -131,9 +131,9 @@ Methods -### setClusterMap +### setClustersMap ```php - mixed PhpOrient\Protocols\Common\AbstractTransport::setClusterMap(\PhpOrient\Protocols\Common\ClusterMap $clusterList) + mixed PhpOrient\Protocols\Common\AbstractTransport::setClustersMap(\PhpOrient\Protocols\Common\ClustersMap $clusterList) ``` ##### @@ -143,7 +143,7 @@ Methods ##### Arguments -* $clusterList **[PhpOrient\Protocols\Common\ClusterMap](PhpOrient-Protocols-Common-ClusterMap)** +* $clusterList **[PhpOrient\Protocols\Common\ClustersMap](PhpOrient-Protocols-Common-ClustersMap)** diff --git a/docs/PhpOrient-Protocols-Common-AbstractTransport.md b/docs/PhpOrient-Protocols-Common-AbstractTransport.md index 270599a..6c1133a 100644 --- a/docs/PhpOrient-Protocols-Common-AbstractTransport.md +++ b/docs/PhpOrient-Protocols-Common-AbstractTransport.md @@ -62,9 +62,20 @@ Properties * Visibility: **protected** -#### $clusterList +#### $clusterMap ```php - protected \PhpOrient\Protocols\Common\ClusterMap $clusterList + protected \PhpOrient\Protocols\Common\ClustersMap $clusterMap +``` + + + + +* Visibility: **protected** + + +#### $nodesList +```php + protected array $nodesList ``` @@ -82,7 +93,17 @@ Properties * Visibility: **protected** -* This property is **static**. + + +#### $orientVersion +```php + protected \PhpOrient\Protocols\Common\OrientVersion $orientVersion +``` + + + + +* Visibility: **protected** Methods @@ -102,11 +123,37 @@ Methods +### setLogger +```php + mixed PhpOrient\Protocols\Common\AbstractTransport::setLogger() +``` +##### Set the client Logger + + + +* Visibility: **public** + + + + +### getLogger +```php + \Psr\Log\LoggerInterface PhpOrient\Protocols\Common\AbstractTransport::getLogger() +``` +##### Get the Logger from transport + + + +* Visibility: **public** + + + + ### debug ```php mixed PhpOrient\Protocols\Common\AbstractTransport::debug($message) ``` -##### +##### Debug method @@ -120,7 +167,7 @@ Methods ### getClusterMap ```php - \PhpOrient\Protocols\Common\ClusterMap PhpOrient\Protocols\Common\AbstractTransport::getClusterMap() + \PhpOrient\Protocols\Common\ClustersMap PhpOrient\Protocols\Common\AbstractTransport::getClusterMap() ``` ##### @@ -131,9 +178,9 @@ Methods -### setClusterMap +### setClustersMap ```php - mixed PhpOrient\Protocols\Common\AbstractTransport::setClusterMap(\PhpOrient\Protocols\Common\ClusterMap $clusterList) + mixed PhpOrient\Protocols\Common\AbstractTransport::setClustersMap(\PhpOrient\Protocols\Common\ClustersMap $clusterList) ``` ##### @@ -143,7 +190,7 @@ Methods ##### Arguments -* $clusterList **[PhpOrient\Protocols\Common\ClusterMap](PhpOrient-Protocols-Common-ClusterMap)** +* $clusterList **[PhpOrient\Protocols\Common\ClustersMap](PhpOrient-Protocols-Common-ClustersMap)** @@ -160,6 +207,67 @@ Methods +### getNodesList +```php + array PhpOrient\Protocols\Common\AbstractTransport::getNodesList(boolean|false $filterActualNode) +``` +##### Retrieve the nodes list, optionally filter excluding the actual one + +//TODO Improve with different protocol types handler if another transport protocol are implemented + +* Visibility: **public** + + +##### Arguments +* $filterActualNode **boolean|false** + + + +### setNodesList +```php + mixed PhpOrient\Protocols\Common\AbstractTransport::setNodesList(array $nodesList) +``` +##### + + + +* Visibility: **public** + + +##### Arguments +* $nodesList **array<mixed,\PhpOrient\Protocols\Common\OrientNode>** + + + +### getOrientVersion +```php + \PhpOrient\Protocols\Common\OrientVersion PhpOrient\Protocols\Common\AbstractTransport::getOrientVersion() +``` +##### + + + +* Visibility: **public** + + + + +### setOrientVersion +```php + mixed PhpOrient\Protocols\Common\AbstractTransport::setOrientVersion(\PhpOrient\Protocols\Common\OrientVersion $orientVersion) +``` +##### + + + +* Visibility: **public** + + +##### Arguments +* $orientVersion **[PhpOrient\Protocols\Common\OrientVersion](PhpOrient-Protocols-Common-OrientVersion)** + + + ### configure ```php \PhpOrient\Protocols\Common\ConfigurableInterface PhpOrient\Protocols\Common\ConfigurableInterface::configure(array $options) diff --git a/docs/PhpOrient-Protocols-Common-ClusterMap b/docs/PhpOrient-Protocols-Common-ClusterMap index 82f3a63..c0afe12 100644 --- a/docs/PhpOrient-Protocols-Common-ClusterMap +++ b/docs/PhpOrient-Protocols-Common-ClusterMap @@ -1,12 +1,12 @@ -PhpOrient\Protocols\Common\ClusterMap +PhpOrient\Protocols\Common\ClustersMap =============== -Class ClusterMap +Class ClustersMap -* Class name: ClusterMap +* Class name: ClustersMap * Namespace: PhpOrient\Protocols\Common * This class implements: [PhpOrient\Protocols\Common\ConfigurableInterface](PhpOrient-Protocols-Common-ConfigurableInterface), ArrayAccess, Countable, Iterator @@ -89,7 +89,7 @@ Methods ### getServers ```php - integer PhpOrient\Protocols\Common\ClusterMap::getServers() + integer PhpOrient\Protocols\Common\ClustersMap::getServers() ``` ##### @@ -102,7 +102,7 @@ Methods ### getRelease ```php - string PhpOrient\Protocols\Common\ClusterMap::getRelease() + string PhpOrient\Protocols\Common\ClustersMap::getRelease() ``` ##### @@ -132,7 +132,7 @@ Methods ### getIdList ```php - array|array PhpOrient\Protocols\Common\ClusterMap::getIdList() + array|array PhpOrient\Protocols\Common\ClustersMap::getIdList() ``` ##### Return the list of cluster IDs @@ -145,7 +145,7 @@ Methods ### getClusterID ```php - integer|null PhpOrient\Protocols\Common\ClusterMap::getClusterID($name) + integer|null PhpOrient\Protocols\Common\ClustersMap::getClusterID($name) ``` ##### Alias for @see ClusterList::offsetGet @@ -161,7 +161,7 @@ Methods ### dropClusterID ```php - mixed PhpOrient\Protocols\Common\ClusterMap::dropClusterID($ID) + mixed PhpOrient\Protocols\Common\ClustersMap::dropClusterID($ID) ``` ##### Remove a cluster by ID @@ -177,7 +177,7 @@ Methods ### offsetExists ```php - boolean PhpOrient\Protocols\Common\ClusterMap::offsetExists(mixed $name) + boolean PhpOrient\Protocols\Common\ClustersMap::offsetExists(mixed $name) ``` ##### (PHP 5 >= 5.0.0)
Whether a offset exists @@ -196,7 +196,7 @@ Whether a offset exists ### offsetGet ```php - integer|null PhpOrient\Protocols\Common\ClusterMap::offsetGet(mixed $name) + integer|null PhpOrient\Protocols\Common\ClustersMap::offsetGet(mixed $name) ``` ##### (PHP 5 >= 5.0.0)
Offset to retrieve @@ -215,7 +215,7 @@ Offset to retrieve ### offsetSet ```php - void PhpOrient\Protocols\Common\ClusterMap::offsetSet(mixed $name, mixed $value) + void PhpOrient\Protocols\Common\ClustersMap::offsetSet(mixed $name, mixed $value) ``` ##### (PHP 5 >= 5.0.0)
Offset to set @@ -237,7 +237,7 @@ Offset to set ### offsetUnset ```php - void PhpOrient\Protocols\Common\ClusterMap::offsetUnset(mixed $name) + void PhpOrient\Protocols\Common\ClustersMap::offsetUnset(mixed $name) ``` ##### (PHP 5 >= 5.0.0)
Offset to unset @@ -256,7 +256,7 @@ Offset to unset ### count ```php - integer PhpOrient\Protocols\Common\ClusterMap::count() + integer PhpOrient\Protocols\Common\ClustersMap::count() ``` ##### (PHP 5 >= 5.1.0)
Count elements of an object @@ -270,7 +270,7 @@ Count elements of an object ### next ```php - void PhpOrient\Protocols\Common\ClusterMap::next() + void PhpOrient\Protocols\Common\ClustersMap::next() ``` ##### (PHP 5 >= 5.0.0)
Move forward to next element @@ -284,7 +284,7 @@ Move forward to next element ### key ```php - mixed PhpOrient\Protocols\Common\ClusterMap::key() + mixed PhpOrient\Protocols\Common\ClustersMap::key() ``` ##### (PHP 5 >= 5.0.0)
Return the key of the current element @@ -298,7 +298,7 @@ Return the key of the current element ### valid ```php - boolean PhpOrient\Protocols\Common\ClusterMap::valid() + boolean PhpOrient\Protocols\Common\ClustersMap::valid() ``` ##### (PHP 5 >= 5.0.0)
Checks if current position is valid @@ -312,7 +312,7 @@ Checks if current position is valid ### rewind ```php - void PhpOrient\Protocols\Common\ClusterMap::rewind() + void PhpOrient\Protocols\Common\ClustersMap::rewind() ``` ##### (PHP 5 >= 5.0.0)
Rewind the Iterator to the first element @@ -326,7 +326,7 @@ Rewind the Iterator to the first element ### current ```php - mixed PhpOrient\Protocols\Common\ClusterMap::current() + mixed PhpOrient\Protocols\Common\ClustersMap::current() ``` ##### (PHP 5 >= 5.0.0)
Return the current element @@ -340,7 +340,7 @@ Return the current element ### fromConfig ```php - static PhpOrient\Protocols\Common\ClusterMap::fromConfig(array $options) + static PhpOrient\Protocols\Common\ClustersMap::fromConfig(array $options) ``` ##### Return a new class instance configured from the given options. diff --git a/docs/PhpOrient-Protocols-Common-ClusterMap.md b/docs/PhpOrient-Protocols-Common-ClustersMap.md similarity index 72% rename from docs/PhpOrient-Protocols-Common-ClusterMap.md rename to docs/PhpOrient-Protocols-Common-ClustersMap.md index 82f3a63..75c3383 100644 --- a/docs/PhpOrient-Protocols-Common-ClusterMap.md +++ b/docs/PhpOrient-Protocols-Common-ClustersMap.md @@ -1,12 +1,12 @@ -PhpOrient\Protocols\Common\ClusterMap +PhpOrient\Protocols\Common\ClustersMap =============== -Class ClusterMap +Class ClustersMap -* Class name: ClusterMap +* Class name: ClustersMap * Namespace: PhpOrient\Protocols\Common * This class implements: [PhpOrient\Protocols\Common\ConfigurableInterface](PhpOrient-Protocols-Common-ConfigurableInterface), ArrayAccess, Countable, Iterator @@ -58,17 +58,6 @@ Properties -* Visibility: **protected** - - -#### $release -```php - protected string $release -``` - - - - * Visibility: **protected** @@ -89,20 +78,7 @@ Methods ### getServers ```php - integer PhpOrient\Protocols\Common\ClusterMap::getServers() -``` -##### - - - -* Visibility: **public** - - - - -### getRelease -```php - string PhpOrient\Protocols\Common\ClusterMap::getRelease() + integer PhpOrient\Protocols\Common\ClustersMap::getServers() ``` ##### @@ -132,7 +108,7 @@ Methods ### getIdList ```php - array|array PhpOrient\Protocols\Common\ClusterMap::getIdList() + array|array PhpOrient\Protocols\Common\ClustersMap::getIdList() ``` ##### Return the list of cluster IDs @@ -145,9 +121,9 @@ Methods ### getClusterID ```php - integer|null PhpOrient\Protocols\Common\ClusterMap::getClusterID($name) + integer|null PhpOrient\Protocols\Common\ClustersMap::getClusterID($name) ``` -##### Alias for @see ClusterList::offsetGet +##### Alias for @see NodesMap::offsetGet @@ -161,7 +137,7 @@ Methods ### dropClusterID ```php - mixed PhpOrient\Protocols\Common\ClusterMap::dropClusterID($ID) + mixed PhpOrient\Protocols\Common\ClustersMap::dropClusterID($ID) ``` ##### Remove a cluster by ID @@ -177,7 +153,7 @@ Methods ### offsetExists ```php - boolean PhpOrient\Protocols\Common\ClusterMap::offsetExists(mixed $name) + boolean PhpOrient\Protocols\Common\ClustersMap::offsetExists(mixed $name) ``` ##### (PHP 5 >= 5.0.0)
Whether a offset exists @@ -196,7 +172,7 @@ Whether a offset exists ### offsetGet ```php - integer|null PhpOrient\Protocols\Common\ClusterMap::offsetGet(mixed $name) + integer|null PhpOrient\Protocols\Common\ClustersMap::offsetGet(mixed $name) ``` ##### (PHP 5 >= 5.0.0)
Offset to retrieve @@ -215,7 +191,7 @@ Offset to retrieve ### offsetSet ```php - void PhpOrient\Protocols\Common\ClusterMap::offsetSet(mixed $name, mixed $value) + void PhpOrient\Protocols\Common\ClustersMap::offsetSet(mixed $name, mixed $value) ``` ##### (PHP 5 >= 5.0.0)
Offset to set @@ -237,7 +213,7 @@ Offset to set ### offsetUnset ```php - void PhpOrient\Protocols\Common\ClusterMap::offsetUnset(mixed $name) + void PhpOrient\Protocols\Common\ClustersMap::offsetUnset(mixed $name) ``` ##### (PHP 5 >= 5.0.0)
Offset to unset @@ -256,7 +232,7 @@ Offset to unset ### count ```php - integer PhpOrient\Protocols\Common\ClusterMap::count() + integer PhpOrient\Protocols\Common\ClustersMap::count() ``` ##### (PHP 5 >= 5.1.0)
Count elements of an object @@ -270,7 +246,7 @@ Count elements of an object ### next ```php - void PhpOrient\Protocols\Common\ClusterMap::next() + void PhpOrient\Protocols\Common\ClustersMap::next() ``` ##### (PHP 5 >= 5.0.0)
Move forward to next element @@ -284,7 +260,7 @@ Move forward to next element ### key ```php - mixed PhpOrient\Protocols\Common\ClusterMap::key() + mixed PhpOrient\Protocols\Common\ClustersMap::key() ``` ##### (PHP 5 >= 5.0.0)
Return the key of the current element @@ -298,7 +274,7 @@ Return the key of the current element ### valid ```php - boolean PhpOrient\Protocols\Common\ClusterMap::valid() + boolean PhpOrient\Protocols\Common\ClustersMap::valid() ``` ##### (PHP 5 >= 5.0.0)
Checks if current position is valid @@ -312,7 +288,7 @@ Checks if current position is valid ### rewind ```php - void PhpOrient\Protocols\Common\ClusterMap::rewind() + void PhpOrient\Protocols\Common\ClustersMap::rewind() ``` ##### (PHP 5 >= 5.0.0)
Rewind the Iterator to the first element @@ -326,7 +302,7 @@ Rewind the Iterator to the first element ### current ```php - mixed PhpOrient\Protocols\Common\ClusterMap::current() + mixed PhpOrient\Protocols\Common\ClustersMap::current() ``` ##### (PHP 5 >= 5.0.0)
Return the current element @@ -340,7 +316,7 @@ Return the current element ### fromConfig ```php - static PhpOrient\Protocols\Common\ClusterMap::fromConfig(array $options) + static PhpOrient\Protocols\Common\ClustersMap::fromConfig(array $options) ``` ##### Return a new class instance configured from the given options. diff --git a/docs/PhpOrient-Protocols-Common-OrientNode.md b/docs/PhpOrient-Protocols-Common-OrientNode.md new file mode 100644 index 0000000..75a80c2 --- /dev/null +++ b/docs/PhpOrient-Protocols-Common-OrientNode.md @@ -0,0 +1,106 @@ +PhpOrient\Protocols\Common\OrientNode +=============== + + + + + + +* Class name: OrientNode +* Namespace: PhpOrient\Protocols\Common + + + + + +Properties +---------- + + +#### $name +```php + public string $name +``` + + + + +* Visibility: **public** + + +#### $id +```php + public integer $id +``` + + + + +* Visibility: **public** + + +#### $startedOn +```php + public \DateTime $startedOn +``` + + + + +* Visibility: **public** + + +#### $host +```php + public string $host +``` + + + + +* Visibility: **public** + + +#### $port +```php + public integer $port +``` + + + + +* Visibility: **public** + + +Methods +------- + + +### __construct +```php + \PhpOrient\Protocols\Common\OrientNode PhpOrient\Protocols\Common\OrientNode::__construct(\PhpOrient\Protocols\Binary\Data\Record|null $node_list) +``` +##### + + + +* Visibility: **public** + + +##### Arguments +* $node_list **[PhpOrient\Protocols\Binary\Data\Record](PhpOrient-Protocols-Binary-Data-Record)|null**

an Array with starting configs (usually from a db_open, db_reload record response or server pushes)

+ + + +### __toString +```php + mixed PhpOrient\Protocols\Common\OrientNode::__toString() +``` +##### + + + +* Visibility: **public** + + + diff --git a/docs/PhpOrient-Protocols-Common-OrientVersion.md b/docs/PhpOrient-Protocols-Common-OrientVersion.md new file mode 100644 index 0000000..fa8e002 --- /dev/null +++ b/docs/PhpOrient-Protocols-Common-OrientVersion.md @@ -0,0 +1,164 @@ +PhpOrient\Protocols\Common\OrientVersion +=============== + +Class ClustersMap + + + + +* Class name: OrientVersion +* Namespace: PhpOrient\Protocols\Common + + + + + +Properties +---------- + + +#### $release +```php + protected string $release +``` + + + + +* Visibility: **protected** + + +#### $majorVersion +```php + protected integer $majorVersion +``` + + + + +* Visibility: **protected** + + +#### $minorVersion +```php + protected integer $minorVersion +``` + + + + +* Visibility: **protected** + + +#### $buildNumber +```php + protected string $buildNumber +``` + + + + +* Visibility: **protected** + + +Methods +------- + + +### _parseRelease +```php + mixed PhpOrient\Protocols\Common\OrientVersion::_parseRelease() +``` +##### + + + +* Visibility: **protected** + + + + +### getRelease +```php + string PhpOrient\Protocols\Common\OrientVersion::getRelease() +``` +##### + + + +* Visibility: **public** + + + + +### getMajorVersion +```php + integer PhpOrient\Protocols\Common\OrientVersion::getMajorVersion() +``` +##### + + + +* Visibility: **public** + + + + +### getMinorVersion +```php + integer PhpOrient\Protocols\Common\OrientVersion::getMinorVersion() +``` +##### + + + +* Visibility: **public** + + + + +### getBuildNumber +```php + string PhpOrient\Protocols\Common\OrientVersion::getBuildNumber() +``` +##### + + + +* Visibility: **public** + + + + +### configure +```php + \PhpOrient\Protocols\Common\OrientVersion PhpOrient\Protocols\Common\OrientVersion::configure(array $options) +``` +##### Configure the object. + + + +* Visibility: **public** + + +##### Arguments +* $options **array**

The options for the object.

+ + + +### fromConfig +```php + static PhpOrient\Protocols\Common\OrientVersion::fromConfig(array $options) +``` +##### Return a new class instance configured from the given options. + + + +* Visibility: **public** +* This method is **static**. + + +##### Arguments +* $options **array**

The options for the newly created class instance.

+ + diff --git a/src/PhpOrient/PhpOrient.php b/src/PhpOrient/PhpOrient.php index 48ca188..94e0b75 100644 --- a/src/PhpOrient/PhpOrient.php +++ b/src/PhpOrient/PhpOrient.php @@ -12,7 +12,7 @@ use PhpOrient\Protocols\Binary\Operations\RecordDelete; use PhpOrient\Protocols\Binary\Operations\RecordLoad; use PhpOrient\Protocols\Binary\Operations\RecordUpdate; -use PhpOrient\Protocols\Common\ClusterMap; +use PhpOrient\Protocols\Common\ClustersMap; use PhpOrient\Protocols\Common\ConfigurableInterface; use PhpOrient\Protocols\Common\ConfigurableTrait; use PhpOrient\Protocols\Common\Constants; @@ -88,6 +88,7 @@ class PhpOrient implements ConfigurableInterface { */ public function __construct( $hostname = '', $port = '', $token = '' ) { if ( !empty( $hostname ) ) { + if( $hostname == 'localhost' ) $hostname = '127.0.0.1'; $this->hostname = $hostname; } @@ -414,7 +415,7 @@ public function dbSize() { /** * Reload the structure of a Database * - * @return ClusterMap + * @return ClustersMap */ public function dbReload() { return $this->getTransport()->execute( 'dbReload', [] ); @@ -446,7 +447,8 @@ public function dbRelease( $db_name, $storage_type = Constants::STORAGE_TYPE_PLO * 'serializationType' => PhpOrient::SERIALIZATION_DOCUMENT2CSV, * 'databaseType' => PhpOrient::DATABASE_TYPE_GRAPH * } - * @return ClusterMap + * + * @return ClustersMap */ public function dbOpen( $database, $username = '', $password = '', Array $params = [] ) { diff --git a/src/PhpOrient/Protocols/Binary/Abstracts/Operation.php b/src/PhpOrient/Protocols/Binary/Abstracts/Operation.php index 49714cf..32d150a 100644 --- a/src/PhpOrient/Protocols/Binary/Abstracts/Operation.php +++ b/src/PhpOrient/Protocols/Binary/Abstracts/Operation.php @@ -17,8 +17,8 @@ use PhpOrient\Exceptions\PhpOrientException; use PhpOrient\Exceptions\PhpOrientBadMethodCallException; use PhpOrient\Protocols\Binary\OrientSocket; -use PhpOrient\Protocols\Common\ClusterMap; use Closure; +use PhpOrient\Protocols\Common\OrientNode; abstract class Operation implements ConfigurableInterface { use ConfigurableTrait; @@ -62,13 +62,6 @@ abstract class Operation implements ConfigurableInterface { */ protected $_callback; - /** - * Callback function to apply on push request when they are received - * - * @var Closure|string - */ - protected $_pushRequestCallback; - /** * Class constructor * @@ -82,7 +75,6 @@ public function __construct( SocketTransport $_transport ) { $this->_transport = $_transport; $this->_socket = $_transport->getSocket(); - $this->_pushRequestCallback = 'Operation::_pushReceived'; $this->_callback = function(){}; } @@ -159,26 +151,28 @@ protected function _readHeader() { # Push notification, Node cluster changed # - # FIELD_BYTE (OChannelBinaryProtocol.PUSH_DATA); # WRITE 3 - # FIELD_INT (Integer.MIN_VALUE); # SESSION ID = 2^-31 - # 80: \x50 Request Push 1 byte: Push command id - $push_command_id = $this->_readByte(); - list( , $payload ) = CSV::unserialize( $this->_readString() ); - if ( !empty( $this->_pushRequestCallback ) && is_callable( $this->_pushRequestCallback ) ){ - $this->{$this->_pushRequestCallback}( $push_command_id, $payload ); - } + # BYTE (OChannelBinaryProtocol.PUSH_DATA); # WRITE 3 + # INT (Integer.MIN_VALUE); # SESSION ID = 2^-31 + # 80: \x50 Request Push 1 byte: Push command id + # STRING $payload + $this->_pushReceived( + $this->_readByte(), + CSV::unserialize( $this->_readString() ) + ); $end_flag = $this->_readByte(); # this flag can be set more than once while ( $end_flag == 3 ) { $this->_readInt(); # FAKE SESSION ID = 2^-31 - $this->_readByte(); # 80: 0x50 Request Push - if ( !empty( $this->_pushRequestCallback ) && is_callable( $this->_pushRequestCallback ) ){ - $this->{$this->_pushRequestCallback}( $push_command_id, $payload ); - } + $this->_pushReceived( + $this->_readByte(), + CSV::unserialize( $this->_readString() ) + ); $end_flag = $this->_readByte(); } + $sessionId = $this->_readInt(); //string termination + } } @@ -196,10 +190,12 @@ protected function _pushReceived( $command_id, $payload ){ # TODO: this logic must stay within Messages class here I just want to receive # an object of something, like a new array of cluster. # We should register a callback and then execute it - if ( $command_id == 80 && $payload ){ - $this->_transport->setClusterMap( - ClusterMap::fromConfig( $this->_readString() ) - ); # JSON WITH THE NEW CLUSTER CFG + $list = []; + if ( $command_id == 80 ){ + foreach( $payload['members'] as $node ){ + $list[] = new OrientNode( $node ); + } + $this->_transport->setNodesList( $list ); # LIST WITH THE NEW CLUSTER CFG } } @@ -253,7 +249,7 @@ public function send(){ $this->_dump_streams(); $this->_socket->write( $this->_output_buffer ); $this->_output_buffer = ''; - $this->_writeStack = []; +// $this->_writeStack = []; return $this; } diff --git a/src/PhpOrient/Protocols/Binary/Operations/DbClose.php b/src/PhpOrient/Protocols/Binary/Operations/DbClose.php index 68fb1b4..53bafeb 100644 --- a/src/PhpOrient/Protocols/Binary/Operations/DbClose.php +++ b/src/PhpOrient/Protocols/Binary/Operations/DbClose.php @@ -3,7 +3,7 @@ namespace PhpOrient\Protocols\Binary\Operations; use PhpOrient\Protocols\Binary\Abstracts\Operation; -use PhpOrient\Protocols\Common\ClusterMap; +use PhpOrient\Protocols\Common\ClustersMap; use PhpOrient\Protocols\Common\Constants; use PhpOrient\Protocols\Binary\Abstracts\NeedDBOpenedTrait; @@ -28,7 +28,7 @@ protected function _read() {} */ public function getResponse() { $clusters = $this->_transport->getClusterMap(); - $clusters = new ClusterMap(); + $clusters = new ClustersMap(); $this->_socket->__destruct(); $this->_transport->debug("Closed Connection"); return 0; diff --git a/src/PhpOrient/Protocols/Binary/Operations/DbOpen.php b/src/PhpOrient/Protocols/Binary/Operations/DbOpen.php index 055ecab..f3120b0 100644 --- a/src/PhpOrient/Protocols/Binary/Operations/DbOpen.php +++ b/src/PhpOrient/Protocols/Binary/Operations/DbOpen.php @@ -5,9 +5,12 @@ use PhpOrient\Exceptions\PhpOrientBadMethodCallException; use PhpOrient\Protocols\Binary\Abstracts\Operation; use PhpOrient\Configuration\Constants as ClientConstants; -use PhpOrient\Protocols\Common\ClusterMap; +use PhpOrient\Protocols\Binary\Serialization\CSV; +use PhpOrient\Protocols\Common\ClustersMap; +use PhpOrient\Protocols\Common\OrientNode; use PhpOrient\Protocols\Common\Constants; use PhpOrient\Exceptions\PhpOrientWrongProtocolVersionException; +use PhpOrient\Protocols\Common\OrientVersion; class DbOpen extends Operation { @@ -106,6 +109,7 @@ protected function _read() { $sessionId = $this->_readInt(); $this->_transport->setSessionId( $sessionId ); $this->_transport->databaseOpened = true; + $this->_transport->databaseName = $this->database; $this->_transport->connected = false; if ( $this->_transport->getProtocolVersion() > 26 ) { @@ -144,11 +148,21 @@ protected function _read() { $cluster_list = [ 'sessionId' => $sessionId, 'dataClusters' => $dataClusters, - 'servers' => $this->_readString(), + 'servers' => CSV::unserialize( $this->_readString() ), 'release' => $this->_readString() ]; - $this->_transport->setClusterMap( ClusterMap::fromConfig( $cluster_list ) ); + $this->_transport->setClustersMap( ClustersMap::fromConfig( $cluster_list ) ); + + if( !empty( $cluster_list[ 'servers' ] ) ){ + $list = []; + foreach( $cluster_list['servers']['members'] as $node ){ + $list[] = new OrientNode( $node ); + } + $this->_transport->setNodesList( $list ); # LIST WITH THE NEW CLUSTER CFG + } + + $this->_transport->setOrientVersion( OrientVersion::fromConfig( $cluster_list ) ); return $this->_transport->getClusterMap(); diff --git a/src/PhpOrient/Protocols/Binary/Operations/DbReload.php b/src/PhpOrient/Protocols/Binary/Operations/DbReload.php index b2c3d7c..498a452 100644 --- a/src/PhpOrient/Protocols/Binary/Operations/DbReload.php +++ b/src/PhpOrient/Protocols/Binary/Operations/DbReload.php @@ -3,7 +3,7 @@ namespace PhpOrient\Protocols\Binary\Operations; use PhpOrient\Protocols\Binary\Abstracts\Operation; -use PhpOrient\Protocols\Common\ClusterMap; +use PhpOrient\Protocols\Common\ClustersMap; use PhpOrient\Protocols\Common\Constants; use PhpOrient\Protocols\Binary\Abstracts\NeedDBOpenedTrait; @@ -23,7 +23,7 @@ protected function _write() {} /** * Read the response from the socket. * - * @return ClusterMap + * @return ClustersMap */ protected function _read() { diff --git a/src/PhpOrient/Protocols/Binary/Operations/ShutDown.php b/src/PhpOrient/Protocols/Binary/Operations/ShutDown.php index 06840d2..6e0c598 100644 --- a/src/PhpOrient/Protocols/Binary/Operations/ShutDown.php +++ b/src/PhpOrient/Protocols/Binary/Operations/ShutDown.php @@ -11,7 +11,7 @@ use PhpOrient\Protocols\Binary\Abstracts\NeedConnectedTrait; use PhpOrient\Protocols\Binary\Abstracts\Operation; -use PhpOrient\Protocols\Common\ClusterMap; +use PhpOrient\Protocols\Common\ClustersMap; use PhpOrient\Protocols\Common\Constants; class ShutDown extends Operation { @@ -47,7 +47,7 @@ protected function _write() { */ protected function _read() { $clusters = $this->_transport->getClusterMap(); - $clusters = new ClusterMap(); + $clusters = new ClustersMap(); $this->_socket->__destruct(); $this->_transport->debug("Database ShutDown"); return 0; diff --git a/src/PhpOrient/Protocols/Binary/OrientSocket.php b/src/PhpOrient/Protocols/Binary/OrientSocket.php index 585e97c..bf6ba38 100644 --- a/src/PhpOrient/Protocols/Binary/OrientSocket.php +++ b/src/PhpOrient/Protocols/Binary/OrientSocket.php @@ -133,9 +133,10 @@ public function read( $size ) { $remaining = $size; do { - $data .= socket_read( $this->_socket, $remaining, PHP_BINARY_READ ); + $_data = socket_read( $this->_socket, $remaining, PHP_BINARY_READ ); + $data .= $_data; $remaining = $size - strlen( $data ); - if( $data === false || $data === '' ) { + if( $_data === false || $_data === '' ) { //https://bugs.php.net/bug.php?id=69008 //I must hard-code the error because of a bug in PHP throw new SocketException( "socket_read(): unable to read from socket [104]: Connection reset by peer" ); diff --git a/src/PhpOrient/Protocols/Binary/SocketTransport.php b/src/PhpOrient/Protocols/Binary/SocketTransport.php index 89216e6..58812a7 100644 --- a/src/PhpOrient/Protocols/Binary/SocketTransport.php +++ b/src/PhpOrient/Protocols/Binary/SocketTransport.php @@ -3,6 +3,7 @@ namespace PhpOrient\Protocols\Binary; use PhpOrient\Configuration\Constants; +use PhpOrient\Exceptions\SocketException; use PhpOrient\Exceptions\TransportException; use PhpOrient\Protocols\Binary\Abstracts\Operation; use PhpOrient\Protocols\Binary\Operations\Connect; @@ -25,6 +26,13 @@ class SocketTransport extends AbstractTransport { */ public $databaseOpened = false; + /** + * The database actually open + * + * @var string + */ + public $databaseName; + /** * Flag needed to know if connected to the server * @@ -151,7 +159,50 @@ public function getSocket() { public function execute( $operation, array $params = array() ) { $op = $this->operationFactory( $operation, $params ); - $result = $op->prepare()->send()->getResponse(); + try { + $result = $op->prepare()->send()->getResponse(); + } catch( SocketException $e ){ + //try another node from the list + $list = $this->getNodesList( true ); + if ( !empty( $list ) ) { + foreach ( $list as $newNode ) { + $this->port = $newNode->port; + $this->hostname = $newNode->host; + $this->_socket = null; + try { + $this->getSocket(); + break; //break because we found an available node + } catch ( SocketException $e ) { + if( Constants::$LOGGING ){ + $this->_logger->debug( $e ); + } + } + } + } + + //reconnect || reopen DB + if( $this->databaseOpened ){ + $_op = $this->operationFactory( + 'PhpOrient\Protocols\Binary\Operations\DbOpen', + array( 'database' => $this->databaseName ) + ); + } else { + $_op = $this->operationFactory( + 'PhpOrient\Protocols\Binary\Operations\Connect', + array() + ); + } + + //reconnect || reopen DB + $this->setSessionId( -1 ); + $_op->prepare()->send()->getResponse(); + + //repeat last command + $op = $this->operationFactory( $operation, $params ); + $result = $op->prepare()->send()->getResponse(); + + } + return $result; } @@ -182,10 +233,14 @@ protected function operationFactory( $operation, array $params ) { if( empty( $params[ 'username' ] ) ){ $params[ 'username' ] = $this->username; + } else{ + $this->username = $params[ 'username' ]; } if( empty( $params[ 'password' ] ) ){ $params[ 'password' ] = $this->password; + } else { + $this->password = $params[ 'password' ]; } } diff --git a/src/PhpOrient/Protocols/Common/AbstractTransport.php b/src/PhpOrient/Protocols/Common/AbstractTransport.php index 128d2ff..a4b0c31 100644 --- a/src/PhpOrient/Protocols/Common/AbstractTransport.php +++ b/src/PhpOrient/Protocols/Common/AbstractTransport.php @@ -31,15 +31,25 @@ abstract class AbstractTransport implements TransportInterface { protected $password; /** - * @var ClusterMap This Handle the actual Cluster List of Current Database + * @var ClustersMap This Handle the actual Cluster List of Current Database */ - protected $clusterList; + protected $clusterMap; + + /** + * @var OrientNode[] This is the list of OrientDB Nodes when distributed + */ + protected $nodesList; /** * @var LoggerInterface */ protected $_logger; + /** + * @var OrientVersion + */ + protected $orientVersion; + /** * Class Constructor * @@ -106,17 +116,17 @@ public function debug( $message ){ } /** - * @return ClusterMap + * @return ClustersMap */ public function getClusterMap() { - return $this->clusterList; + return $this->clusterMap; } /** - * @param ClusterMap $clusterList + * @param ClustersMap $clusterList */ - public function setClusterMap( ClusterMap $clusterList ) { - $this->clusterList = $clusterList; + public function setClustersMap( ClustersMap $clusterList ) { + $this->clusterMap = $clusterList; } /** @@ -128,4 +138,47 @@ public function getTransaction(){ return new \PhpOrient\Protocols\Binary\Transaction\TxCommit( $this ); } + /** + * Retrieve the nodes list, optionally filter excluding the actual one + * + * //TODO Improve with different protocol types handler if another transport protocol are implemented + * + * @param bool|false $filterActualNode + * + * @return OrientNode[] + */ + public function getNodesList( $filterActualNode = false ) { + + $list = $this->nodesList; + if( $filterActualNode ){ + foreach( $list as $pos => $node ){ + if( $node->host == $this->hostname && $node->port == $this->port ){ + unset( $list[$pos] ); + } + } + } + return $list; + } + + /** + * @param OrientNode[] $nodesList + */ + public function setNodesList( $nodesList ) { + $this->nodesList = $nodesList; + } + + /** + * @return OrientVersion + */ + public function getOrientVersion() { + return $this->orientVersion; + } + + /** + * @param OrientVersion $orientVersion + */ + public function setOrientVersion( $orientVersion ) { + $this->orientVersion = $orientVersion; + } + } diff --git a/src/PhpOrient/Protocols/Common/ClusterMap.php b/src/PhpOrient/Protocols/Common/ClustersMap.php similarity index 84% rename from src/PhpOrient/Protocols/Common/ClusterMap.php rename to src/PhpOrient/Protocols/Common/ClustersMap.php index 3d6f4f6..dd8ab54 100644 --- a/src/PhpOrient/Protocols/Common/ClusterMap.php +++ b/src/PhpOrient/Protocols/Common/ClustersMap.php @@ -9,7 +9,7 @@ namespace PhpOrient\Protocols\Common; /** - * Class ClusterMap + * Class ClustersMap * @package PhpOrient\Protocols\Common * * When you create a new record specifying its Class, @@ -28,10 +28,9 @@ * //TODO only default strategy is supported * */ -class ClusterMap implements ConfigurableInterface, \ArrayAccess, \Countable, \Iterator { +class ClustersMap implements ConfigurableInterface, \ArrayAccess, \Countable, \Iterator { use ConfigurableTrait { configure as config; - fromConfig as fromConf; } /** @@ -54,26 +53,6 @@ class ClusterMap implements ConfigurableInterface, \ArrayAccess, \Countable, \It */ protected $servers; - /** - * @var string - */ - protected $release; - - /** - * @var int - */ - protected $majorVersion; - - /** - * @var int - */ - protected $minorVersion; - - /** - * @var string - */ - protected $buildNumber; - /** * @return int */ @@ -81,49 +60,8 @@ public function getServers() { return $this->servers; } - protected function _parseRelease(){ - @list( - $this->majorVersion, - $this->minorVersion, - $this->buildNumber - ) = @explode( ".", $this->release ); - - if ( stripos( $this->minorVersion, "-" ) !== false ){ - @list( $this->minorVersion, $this->buildNumber ) = explode( "-", $this->minorVersion ); - } - @list( $this->buildNumber, ) = explode( " ", $this->buildNumber ); - } - - /** - * @return string - */ - public function getRelease() { - return $this->release; - } - - /** - * @return int - */ - public function getMajorVersion() { - return (int)$this->majorVersion; - } - - /** - * @return int - */ - public function getMinorVersion() { - return (int)$this->minorVersion; - } - - /** - * @return string - */ - public function getBuildNumber() { - return $this->buildNumber; - } - /** - * Expected ClusterMap + * Expected ClustersMap *
      * array (
      *      0 =>
@@ -146,7 +84,6 @@ public function getBuildNumber() {
     public function configure( Array $options = array() ) {
 
         $this->config( $options );
-        $this->_parseRelease();
         if ( !empty( $this->dataClusters ) ) {
             $this->reverseMap = array();
             $this->reverseIDMap = array();
@@ -170,7 +107,7 @@ public function getIdList(){
     }
 
     /**
-     * Alias for @see ClusterList::offsetGet
+     * Alias for @see NodesMap::offsetGet
      * @param $name
      *
      * @return int|null
diff --git a/src/PhpOrient/Protocols/Common/OrientNode.php b/src/PhpOrient/Protocols/Common/OrientNode.php
new file mode 100644
index 0000000..34d30e9
--- /dev/null
+++ b/src/PhpOrient/Protocols/Common/OrientNode.php
@@ -0,0 +1,78 @@
+id = $node_list['id'];
+        $this->name = $node_list['name'];
+        $this->startedOn = $node_list['startedOn'];
+        $listener = array_reduce( $node_list['listeners'], function( $acc, $lsn ){
+            if( $lsn['protocol'] != 'ONetworkProtocolBinary' ) return $acc;
+            return $lsn;
+        } );
+
+        if ( $listener ){
+            $listen = explode( ":", $listener['listen'] );
+            $this->host = $listen[0];
+            $this->port = $listen[1] ;
+        }
+
+        return $this;
+
+    }
+
+    public function __toString(){
+        return $this->name;
+    }
+
+}
\ No newline at end of file
diff --git a/src/PhpOrient/Protocols/Common/OrientVersion.php b/src/PhpOrient/Protocols/Common/OrientVersion.php
new file mode 100644
index 0000000..cb4cb58
--- /dev/null
+++ b/src/PhpOrient/Protocols/Common/OrientVersion.php
@@ -0,0 +1,112 @@
+
+ *  
  • default, uses always the Class's defaultClusterId property. This was the default before 1.7
  • + *
  • round-robin, put the Class's configured clusters in a ring and returns a different cluster every time restarting from the first when the ring is completed
  • + *
  • balanced, checks the records in all the clusters and returns the smaller cluster. This allows the cluster to have all the underlying clusters balanced on size. On adding a new cluster to an existent class, the new empty cluster will be filled before the others because more empty then the others. Calculation of cluster size is made every 5 or more seconds to avoid to slow down insertion
  • + *
  • local. This is injected when OrientDB is running in distributed mode. With this strategy the cluster that is the master on current node is always preferred. This avoids conflicts and reduces network latency with remote calls between nodes.
  • + * + * + * //TODO only default strategy is supported + * + */ +class OrientVersion { + use ConfigurableTrait { + configure as config; + fromConfig as fromConf; + } + + /** + * @var string + */ + protected $release; + + /** + * @var int + */ + protected $majorVersion; + + /** + * @var int + */ + protected $minorVersion; + + /** + * @var string + */ + protected $buildNumber; + + protected function _parseRelease(){ + @list( + $this->majorVersion, + $this->minorVersion, + $this->buildNumber + ) = @explode( ".", $this->release ); + + if ( stripos( $this->minorVersion, "-" ) !== false ){ + @list( $this->minorVersion, $this->buildNumber ) = explode( "-", $this->minorVersion ); + } + @list( $this->buildNumber, ) = explode( " ", $this->buildNumber ); + } + + /** + * @return string + */ + public function getRelease() { + return $this->release; + } + + /** + * @return int + */ + public function getMajorVersion() { + return (int)$this->majorVersion; + } + + /** + * @return int + */ + public function getMinorVersion() { + return (int)$this->minorVersion; + } + + /** + * @return string + */ + public function getBuildNumber() { + return $this->buildNumber; + } + + /** + * Expected Version string + * @param array $options + * + * @return $this|void + */ + public function configure( Array $options = array() ) { + + $this->config( $options ); + $this->_parseRelease(); + return $this; + + } + +} \ No newline at end of file diff --git a/tests/PhpOrient/Abstracts/TestCase.php b/tests/PhpOrient/Abstracts/TestCase.php index c0f21bb..0791d99 100644 --- a/tests/PhpOrient/Abstracts/TestCase.php +++ b/tests/PhpOrient/Abstracts/TestCase.php @@ -2,7 +2,7 @@ namespace PhpOrient\Abstracts; use PhpOrient\PhpOrient; -use PhpOrient\Protocols\Common\ClusterMap; +use PhpOrient\Protocols\Common\ClustersMap; use PhpOrient\Protocols\Common\Constants; abstract class TestCase extends \PHPUnit_Framework_TestCase { @@ -17,7 +17,7 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase { protected $db_name; /** - * @var ClusterMap + * @var ClustersMap */ protected $cluster_struct; diff --git a/tests/PhpOrient/RecordCommandsTest.php b/tests/PhpOrient/RecordCommandsTest.php index 1b9d73f..39dde5a 100644 --- a/tests/PhpOrient/RecordCommandsTest.php +++ b/tests/PhpOrient/RecordCommandsTest.php @@ -332,7 +332,8 @@ public function testUpdateEdges(){ Constants::DATABASE_TYPE_GRAPH ); - $orientInfo = $client->dbOpen( "db_test_edges", 'admin', 'admin' ); + $orientClustersInfo = $client->dbOpen( "db_test_edges", 'admin', 'admin' ); + $orientVersion = $client->getTransport()->getOrientVersion(); $cmd = 'begin;' . 'let a = create vertex set script = true;' . @@ -349,6 +350,7 @@ public function testUpdateEdges(){ $rec = $client->recordLoad( new ID("#9:0") )[0]; /** + * @var $rec Record * @var $bag \PhpOrient\Protocols\Binary\Data\Bag */ $bag = $rec->getOData()['in_']; @@ -356,15 +358,16 @@ public function testUpdateEdges(){ $client->recordUpdate($rec); /** + * @var $rec Record * @var $bag2 \PhpOrient\Protocols\Binary\Data\Bag */ $rec = $client->recordLoad( new ID("#9:0") )[0]; $bag2 = $rec->getOData()['in_']; $this->assertNotEmpty( $bag2->getRawBagContent() ); - if( $orientInfo->getMajorVersion() >= 2 - && $orientInfo->getMinorVersion() >= 0 - && ( $orientInfo->getBuildNumber() >= 7 || !is_numeric( $orientInfo->getBuildNumber() ) ) + if( $orientVersion->getMajorVersion() >= 2 + && $orientVersion->getMinorVersion() >= 0 + && ( $orientVersion->getBuildNumber() >= 7 || !is_numeric( $orientVersion->getBuildNumber() ) ) ) { $this->assertEquals( $bag->getRawBagContent(), $bag2->getRawBagContent() ); } diff --git a/tests/PhpOrient/TestClusterMap.php b/tests/PhpOrient/TestClusterMap.php index 716b60e..d42cde4 100644 --- a/tests/PhpOrient/TestClusterMap.php +++ b/tests/PhpOrient/TestClusterMap.php @@ -9,7 +9,6 @@ namespace PhpOrient; use PhpOrient\Abstracts\TestCase; -use PhpOrient\Protocols\Common\ClusterMap; use PhpOrient\Protocols\Common\Constants; class ClusterMapTest extends TestCase { diff --git a/tests/PhpOrient/TestOrientNode.php b/tests/PhpOrient/TestOrientNode.php new file mode 100644 index 0000000..4825638 --- /dev/null +++ b/tests/PhpOrient/TestOrientNode.php @@ -0,0 +1,40 @@ +),(id:"4cef7910-023c-4bbb-a27e-bcda6444d7b4",name:"node1435528114865",startedOn:1435528707007t,listeners:[{"protocol":"ONetworkProtocolBinary","listen":"127.0.0.1:2425"},{"protocol":"ONetworkProtocolHttpDb","listen":"127.0.0.1:2481"}],databases:<>)] +JSON; + + + public function testNodeInitialization(){ + + $jsonNodes = CSV::unserialize( $this->stringCSVNodeList ); + + /** + * @var $node Record + */ + foreach( $jsonNodes['members'] as $node ){ + $orientNode = OrientNode::fromConfig( $node->getOData() ); + $this->assertInstanceOf( 'PhpOrient\Protocols\Common\OrientNode', $orientNode ); + $this->assertNotEmpty( $orientNode->id ); + $this->assertNotEmpty( $orientNode->name ); + $this->assertNotEmpty( $orientNode->host ); + $this->assertNotEmpty( $orientNode->port ); + } + + } + +}