|
| 1 | +Release notes for the ArangoDB-PHP driver 3.0 |
| 2 | +============================================= |
| 3 | + |
| 4 | +This version of the driver is compatible with ArangoDB 3.0. |
| 5 | +It is not compatible to earlier versions of ArangoDB (i.e. 2.x). |
| 6 | +Please use ones of the `2.x` branches of the driver for 2.x-compatibility. |
| 7 | + |
| 8 | +Changed functionality |
| 9 | +===================== |
| 10 | + |
| 11 | +User management |
| 12 | +--------------- |
| 13 | + |
| 14 | +The user management APIs in class `UserHandler` have changed slightly. The methods for adding, |
| 15 | +replacing and updating users had an optional parameter named `$options`, which did nothing. |
| 16 | +This parameter has been removed. |
| 17 | + |
| 18 | +The API methods simplify to: |
| 19 | + |
| 20 | +- UserHandler::addUser($username, $passwd = null, $active = null, $extra = null, $options = array()) |
| 21 | +- UserHandler::replaceUser($username, $passwd = null, $active = null, $extra = null, $options = array()) |
| 22 | +- UserHandler::updateUser($username, $passwd = null, $active = null, $extra = null, $options = array()) |
| 23 | + |
| 24 | +- UserHandler::addUser($username, $passwd = null, $active = null, $extra = null) |
| 25 | +- UserHandler::replaceUser($username, $passwd = null, $active = null, $extra = null) |
| 26 | +- UserHandler::updateUser($username, $passwd = null, $active = null, $extra = null) |
| 27 | + |
| 28 | +Note that when adding a new user via the `addUser()` method, the new user will now be given |
| 29 | +access permissions for the current database the PHP driver is connected to. |
| 30 | +User permissions can be adjusted manually by using the following new methods of the |
| 31 | +`UserHandler` class: |
| 32 | + |
| 33 | +- UserHandler::grantPermissions($username, $databaseName) |
| 34 | +- UserHandler::revokePermissions($username, $databaseName) |
| 35 | + |
| 36 | + |
| 37 | +Unsupported functionality |
| 38 | +========================= |
| 39 | + |
| 40 | +Cap constraints |
| 41 | +--------------- |
| 42 | + |
| 43 | +Support for cap constraints has been discontinued on the 3.0 version of ArangoDB. |
| 44 | +Therefore, the following methods have also been removed from the PHP driver in |
| 45 | +the 3.0 branch: |
| 46 | + |
| 47 | +- CollectionHandler::createCapConstraint($collectionId, $size) |
| 48 | +- CollectionHandler::first($collectionId, $count = null) |
| 49 | +- CollectionHandler::last($collectionId, $count = null) |
| 50 | + |
| 51 | +Graph functions |
| 52 | +--------------- |
| 53 | + |
| 54 | +The ArangoDB PHP driver provided PHP wrapper methods for common graph functions |
| 55 | +that were implemented server-side. When one of these wrapper methods was called, |
| 56 | +the PHP driver assembled an AQL query that called the equivalent graph AQL functions |
| 57 | +on the server. The driver has provided some extra post-filtering options for some |
| 58 | +of the graph functions, but for others it only provided a subset of the features |
| 59 | +available server-side. |
| 60 | + |
| 61 | +With ArangoDB 3.0, the graph functionality on the server-side has changed: the |
| 62 | +previously available AQL graph functions that were called by the PHP driver are |
| 63 | +not available anymore in 3.0. This affects the following previously existing |
| 64 | +methods of the PHP driver's `GraphHandler` class, which are now gone in 3.0: |
| 65 | + |
| 66 | +- GraphHandler::getNeighborVertices($graph, $vertexExample, $options = array()) |
| 67 | +- GraphHandler::getConnectedEdges($graph, $vertexId, $options = array()) |
| 68 | +- GraphHandler::getVertices($graph, $options = array()) |
| 69 | +- GraphHandler::getEdges($graph, $options = array()) |
| 70 | +- GraphHandler::getPaths($graph, $options = array()) |
| 71 | +- GraphHandler::getShortestPaths($graph, $startVertexExample = array(), $endVertexExample = array(), $options = array()) |
| 72 | +- GraphHandler::getDistanceTo($graph, $startVertexExample = null, $endVertexExample = null, $options = array()) |
| 73 | +- GraphHandler::getCommonNeighborVertices($graph, $vertex1Example = null, $vertex2Example = null, $options1 = array(),$options2 = array()) |
| 74 | +- GraphHandler::getCommonProperties($graph, $vertex1Example= null, $vertex2Example = null, $options = array()) |
| 75 | +- GraphHandler::getAbsoluteEccentricity($graph, $vertexExample = null, $options = array()) |
| 76 | +- GraphHandler::getEccentricity($graph, $options = array()) |
| 77 | +- GraphHandler::getAbsoluteCloseness($graph, $vertexExample = null, $options = array()) |
| 78 | +- GraphHandler::getCloseness($graph, $options = array()) |
| 79 | +- GraphHandler::getAbsoluteBetweenness($graph, $options = array()) |
| 80 | +- GraphHandler::getBetweenness($graph, $options = array()) |
| 81 | +- GraphHandler::getRadius($graph, $options = array()) |
| 82 | +- GraphHandler::getDiameter($graph, $options = array()) |
| 83 | + |
| 84 | +Most of these methods can be emulated by issuing an AQL query from the PHP driver. |
| 85 | +AQL provides provides blocks for computing the vertices, connected edges, and paths |
| 86 | +in a graph or just dedicated collections. As a bonus, by using AQL queries one is |
| 87 | +not limited to the subset of the functionality that was available in the "old" |
| 88 | +graph functions' interfaces, but can use the full functionality and composability |
| 89 | +of AQL. |
| 90 | + |
| 91 | +Custom queues |
| 92 | +------------- |
| 93 | + |
| 94 | +"Custom queues" were an undocumented, experimental feature in later versions |
| 95 | +of the 2.x driver. Its purpose was to send requests to dedicated processing |
| 96 | +queues on the server. This functionality has been removed from the 3.0 ArangoDB |
| 97 | +server and the 3.0 driver. |
| 98 | + |
| 99 | +Due to that the following undocumented methods have been removed from the |
| 100 | +PHP driver: |
| 101 | + |
| 102 | +- Handler::enableCustomQueue($queueName, $count = null) |
| 103 | +- Handler::disableCustomQueue() |
| 104 | +- Connection::enableCustomQueue($queueName, $count = null) |
| 105 | +- Connection::disableCustomQueue() |
| 106 | + |
| 107 | +Client versioning |
| 108 | +----------------- |
| 109 | + |
| 110 | +The client-side versioning feature was also removed from the driver in version |
| 111 | +3.0. The versioning feature allowed sending the HTTP header `X-Arango-Version` |
| 112 | +with the desired version number for all requests made from the driver. The |
| 113 | +ArangoDB server interpreted the value of this HTTP header at some endpoints and |
| 114 | +returned result structures matching the ones from older versions of ArangoDB. |
| 115 | + |
| 116 | +This feature was abandoned on the server-side in 3.0 so the versioning was |
| 117 | +removed from the driver as well. This also means the following methods have |
| 118 | +been removed from the driver's `Connection` class. |
| 119 | + |
| 120 | +- Connection::getVersion() |
| 121 | +- Connection::getClientVersion() |
| 122 | + |
| 123 | +Changed functionality |
| 124 | +===================== |
| 125 | + |
| 126 | +When replacing edges via the `EdgeHandler::replace()` method, it is now |
| 127 | +required to specify both the `_from` and `_to` values of the replacing edge. |
| 128 | +If either attribute is missing or invalid, the replace operation will fail |
| 129 | +with an error `invalid edge attribute` on the server-side. |
| 130 | + |
| 131 | +That means the following may not work: |
| 132 | + |
| 133 | +```php |
| 134 | +$edgeHandler = new EdgeHandler($connection); |
| 135 | + |
| 136 | +$edge = new Edge(); |
| 137 | +$edge->set("_id", $idOfExistingEdge); |
| 138 | +/* set some other edge attributes */ |
| 139 | +... |
| 140 | + |
| 141 | +$result = $edgeHandler->replace($edge); |
| 142 | +``` |
| 143 | + |
| 144 | +until at least `_from` and `_to` are also set via the `setFrom()` and `setTo()` |
| 145 | +methods: |
| 146 | + |
| 147 | +```php |
| 148 | +$edgeHandler = new EdgeHandler($connection); |
| 149 | + |
| 150 | +$edge = new Edge(); |
| 151 | +$edge->set("_id", $idOfExistingEdge); |
| 152 | +/* set some other edge attributes */ |
| 153 | +... |
| 154 | +$edge->setFrom($fromHandle); |
| 155 | +$edge->setTo($toHandle); |
| 156 | + |
| 157 | +$result = $edgeHandler->replace($edge); |
| 158 | +``` |
| 159 | + |
| 160 | +Note that this affects only the `replace()` and `replaceById()` methods and |
| 161 | +not `update()` nor `updateById()`. |
0 commit comments