{"id":13529159,"url":"https://github.com/graphaware/neo4j-bolt-php","last_synced_at":"2025-04-01T15:30:36.379Z","repository":{"id":56983401,"uuid":"41616370","full_name":"graphaware/neo4j-bolt-php","owner":"graphaware","description":"PHP Driver for Neo4j's Binary Protocol : Bolt","archived":true,"fork":false,"pushed_at":"2021-11-30T16:51:29.000Z","size":286,"stargazers_count":42,"open_issues_count":12,"forks_count":36,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-05-17T06:02:14.459Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphaware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-30T04:12:15.000Z","updated_at":"2023-07-05T09:40:23.000Z","dependencies_parsed_at":"2022-08-21T12:20:51.105Z","dependency_job_id":null,"html_url":"https://github.com/graphaware/neo4j-bolt-php","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-bolt-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-bolt-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-bolt-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-bolt-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphaware","download_url":"https://codeload.github.com/graphaware/neo4j-bolt-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246662217,"owners_count":20813708,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T07:00:33.874Z","updated_at":"2025-04-01T15:30:35.886Z","avatar_url":"https://github.com/graphaware.png","language":"PHP","readme":"THIS REPOSITORY IS ARCHIVED.\n\nPlease head to http://github.com/neo4j-php or http://neo4j.com/developer/php for up-to-date PHP support for Neo4j.\n\n---\n\n## Neo4j Bolt PHP\n\nPHP low level Driver for Neo4j's Bolt Remoting Protocol\n\n[![Build Status](https://travis-ci.org/graphaware/neo4j-bolt-php.svg?branch=master)](https://travis-ci.org/graphaware/neo4j-bolt-php)\n\n---\n\n### References :\n\n* PHP Client embedding Bolt along with the http driver (recommended way of using Neo4j in PHP) : https://github.com/graphaware/neo4j-php-client\n* Neo4j 3.0 : http://neo4j.com/docs\n\n### Requirements:\n\n* PHP5.6+\n* Neo4j3.0\n* PHP Sockets extension available\n* `bcmath` extension\n* `mbstring` extension\n\n### Installation\n\nRequire the package in your dependencies :\n\n```bash\ncomposer require graphaware/neo4j-bolt\n```\n\n### Setting up a driver and creating a session\n\n```php\n\nuse GraphAware\\Bolt\\GraphDatabase;\n\n$driver = GraphDatabase::driver(\"bolt://localhost\");\n$session = $driver-\u003esession();\n```\n\n### Sending a Cypher statement\n\n```php\n$session = $driver-\u003esession();\n$session-\u003erun(\"CREATE (n)\");\n$session-\u003eclose();\n\n// with parameters :\n\n$session-\u003erun(\"CREATE (n) SET n += {props}\", ['name' =\u003e 'Mike', 'age' =\u003e 27]);\n```\n\n### Empty Arrays\n\nDue to lack of Collections types in php, there is no way to distinguish when an empty array\nshould be treated as equivalent Java List or Map types.\n\nTherefore you can use a wrapper around arrays for type safety :\n\n```php\nuse GraphAware\\Common\\Collections;\n\n        $query = 'MERGE (n:User {id: {id} }) \n        WITH n\n        UNWIND {friends} AS friend\n        MERGE (f:User {id: friend.name})\n        MERGE (f)-[:KNOWS]-\u003e(n)';\n\n        $params = ['id' =\u003e 'me', 'friends' =\u003e Collections::asList([])];\n        $this-\u003egetSession()-\u003erun($query, $params);\n        \n// Or\n\n        $query = 'MERGE (n:User {id: {id} }) \n        WITH n\n        UNWIND {friends}.users AS friend\n        MERGE (f:User {id: friend.name})\n        MERGE (f)-[:KNOWS]-\u003e(n)';\n\n        $params = ['id' =\u003e 'me', 'friends' =\u003e Collections::asMap([])];\n        $this-\u003egetSession()-\u003erun($query, $params);\n\n```\n\n### TLS Encryption\n\nIn order to enable TLS support, you need to set the configuration option to `REQUIRED`, here an example :\n\n```php\n$config = \\GraphAware\\Bolt\\Configuration::newInstance()\n    -\u003ewithCredentials('bolttest', 'L7n7SfTSj0e6U')\n    -\u003ewithTLSMode(\\GraphAware\\Bolt\\Configuration::TLSMODE_REQUIRED);\n\n$driver = \\GraphAware\\Bolt\\GraphDatabase::driver('bolt://hobomjfhocgbkeenl.dbs.graphenedb.com:24786', $config);\n$session = $driver-\u003esession();\n```\n\n### License\n\nCopyright (c) 2015-2016 GraphAware Ltd\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n---\n","funding_links":[],"categories":["Connectors","Bolt"],"sub_categories":["Bolt"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaware%2Fneo4j-bolt-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphaware%2Fneo4j-bolt-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaware%2Fneo4j-bolt-php/lists"}