Download the PHP package ostico/phporient without Composer
On this page you can find all versions of the php package ostico/phporient. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ostico/phporient
More information about ostico/phporient
Files in ostico/phporient
Package phporient
Short Description PHPOrient is a good php driver based on the binary protocol of OrientDB.
License Apache License v2.0
Homepage https://github.com/Ostico/PhpOrient
Informations about the package phporient
PhpOrient
PHPOrient is a php driver based on the binary protocol of OrientDB.
status: Stable Please report any bugs you find so that we can improve the library for everyone.
Requires
- PHP Version >= 5.4 ( Socket extension enabled )
- Orientdb version 1.7.4 or later.
PhpOrient works even on 32bit and 64bit platforms.
Warning, if you use a 32bit platform, you must use one of these libraries into YOUR application to avoid the loss of significant digits with Java long integers. Furthermore, these php modules should be loaded to achieve better driver performances on these systems.
- BCMath Arbitrary Precision Mathematics (Faster, recommended)
- GNU Multiple Precision
In PhpOrient, by design, numbers are always treated as strings because of the platform dependant nature of PHP. In 32bit platform numbers must be treated as string because values greater than 2^32 would be lost and the BCMath/GMP modules must be used to avoid this. To make the results consistent for all platforms ( 32 and 64bit ) and leave to the user/developer the decision on how to use it's own data ( by manual cast ) strings are used for all numeric data types.
Installation
Main public repository of PhpOrient is hosted at https://github.com/Ostico/PhpOrient.git.
To install most recent version of library, just type
git clone https://github.com/Ostico/PhpOrient.git
where you want its file to be located.
If you have not already installed globally, you have to download composer. Just run this command inside your PhpOrient directory.
Now get the required libraries to work with PhpOrient:
Note:
If you already have a composer installed or your existing project use it, you can install/add PhpOrient via Composer https://packagist.org/packages/ostico/phporient, it is linked to this GitHub repository ( so it is everityme updated ), and add it as dependecy to your project.
php composer.phar require "ostico/phporient:dev-master" --update-no-dev
Contributions
- Fork the project.
- Make your changes.
- Add tests for it. This is important so I don’t break it in a future version unintentionally.
- Send me a pull request (pull request to master will be rejected)
- ???
- PROFIT
How to run tests
-
Get the development libraries with:
- Bootsrap orient by running ./ci/ci-start.sh from project directory it will download latest orient and make some change on config and database for the tests
- Run : ./vendor/bin/phpunit
Usage
PhpOrient specify autoload information, Composer generates a vendor/autoload.php file. You can simply include this file and you will get autoloading for free and declare the use of PhpOrient Client with fully qualified name.
A complete phpdoc reference can be found here ApiIndex or in the PhpOrient Wiki
Client initialization
There are several ways to initialize the client
Connect to perform Server Management Operations
Database Create
Drop a Database
Check if a DB Exists
Get the the list of databases
Open a Database
Send a command
This should be used only to perform not idempotent commands on a database
Make a query
Make an Async query ( callback )
Load a Record
Create a Record
Update a Record
To update a Record you must have one.
If you have not a record you can build up a new one specifying a RID and the data:
Otherwise you can work with a previous loaded/created Record
Load a Record with node depth navigation ( callback )
Delete a Record
Execute OrientDB SQL Batch
Transactions
Get the size of a database ( needs a DB opened )
Get the range of record ids for a cluster
Get the number of records in one or more clusters
Get the number of records in an open database
Reload the Database info
This method automatically updates the client Cluster Map. Can be used after a Class creation or a DataCluster Add/Drop
Create a new data Cluster
Drop a data cluster
Persistent Connections ( Session Token )
Since version 27 is introduced an extension to allow use a token based session. This functionality must be enabled on the server config.
- In the first negotiation the client can ask for a token based authentication using the method.
- The server will reply with a token or with an empty string meaning that it not support token based session and is using an old style session.
- For each request, the client will send the token and eventually it will get a new one if token lifetime ends.
When using the token based authentication, the connections can be shared between users of the same server.
A GRAPH Example
License
Apache License, Version 2.0, see LICENSE.md.