Skip to content

Commit 0a61f6f

Browse files
Merge branch 'master' into hotfix/-tiny_int
2 parents d31d8fe + ab2d5a5 commit 0a61f6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1434
-253
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
custom: https://www.paypal.me/MichalStefanak
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior.
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen.
18+
19+
**Desktop (please complete the following information):**
20+
- OS: [e.g. Win 10 Pro]
21+
- PHP Version [e.g. 7.1.22]
22+
- Neo4j Version [e.g. 4.1.7]
23+
- Bolt Library Version [e.g. v1.2 or master]
24+
25+
**Additional context**
26+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context about the feature request here.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.idea/
2-
2+
.vscode/
3+
phpunit*.phar

README.md

Lines changed: 8 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Bolt
22
Bolt protocol library over TCP socket. Bolt protocol is primary used for communication with [Neo4j](https://neo4j.com/) Graph database. The documentation is available at [https://7687.org/](https://7687.org/).
33

4+
![](https://img.shields.io/badge/phpunit-passed-success) ![](https://img.shields.io/badge/coverage-70%25-yellowgreen) ![](https://img.shields.io/github/stars/stefanak-michal/Bolt) ![](https://img.shields.io/packagist/dt/stefanak-michal/bolt) ![](https://img.shields.io/github/v/release/stefanak-michal/bolt) ![](https://img.shields.io/github/commits-since/stefanak-michal/bolt/latest)
5+
46
## Supported version
57
Bolt <= 4.1
68

@@ -17,58 +19,15 @@ Bolt <= 4.1
1719

1820
<sup>The (x) denotes that support could be removed in next version of Neo4j.</sup>
1921

20-
## Requirements
21-
PHP >= 7.1
22-
extensions:
23-
- sockets https://www.php.net/manual/en/book.sockets.php
24-
- mbstring https://www.php.net/manual/en/book.mbstring.php
25-
26-
## Installation via composer
27-
Run the following command to install the latest applicable version of the package:
28-
29-
``composer require stefanak-michal/bolt``
30-
31-
## Usage
32-
See ``index.php`` file. It contains few examples how you can use this library. Of course you need to set up your username and password. This repository contains simple `autoload.php` file.
33-
34-
### Main code example
35-
```php
36-
<?php
37-
//Create new Bolt instance
38-
$bolt = new \Bolt\Bolt();
39-
//Set Bolt protocol version (default is newest 4.1)
40-
$bolt->setProtocolVersions(4.1);
41-
//Connect to database
42-
$bolt->init('MyClient/1.0', 'username', 'password');
43-
//Execute query
44-
$bolt->run('RETURN 1 AS num, 2 AS cnt');
45-
//Pull records from last query
46-
$rows = $bolt->pull();
47-
```
48-
49-
| Method | Description |
50-
|--------------------------|---------------------------------------------------------------------------------------|
51-
| setProtocolVersions | set requested protocol versions |
52-
| getProtocolVersion | get used protocol version (you have to establish connection with init() method first) |
53-
| init | connect to database |
54-
| run | execute query |
55-
| pull / pullAll | fetch records from last query |
56-
| discard / discardAll | discard records from last query |
57-
| begin | start transaction |
58-
| commit | commit transaction |
59-
| rollback | rollback transaction |
60-
| reset | reset connection |
61-
62-
## Exceptions
63-
Throwing exceptions is default behaviour. If you want, you can assign own callable error handler to ``\Bolt\Bolt::$errorHandler``. It's called on error and methods (init, run, pullAll, ...) will therefore return false.
22+
## [Requirements](https://github.com/stefanak-michal/Bolt/wiki/Requirements)
23+
## [Installation](https://github.com/stefanak-michal/Bolt/wiki/Installation)
24+
## [Usage](https://github.com/stefanak-michal/Bolt/wiki/Usage)
25+
## [Errors](https://github.com/stefanak-michal/Bolt/wiki/Errors)
6426

6527
## Author note
6628
I really like Neo4j and I wanted to use it with PHP. But after I looked on official php library, I was really disappointed. Too much dependencies. I don't like if I need to install 10 things because of one. First I decided to use HTTP API for communication, but it wasn't fast enough. I went through bolt protocol documentation and I said to myself, why not to create own simpler library?
6729

30+
[Speed comparison](https://github.com/stefanak-michal/Bolt/wiki/Speed-comparison)
31+
6832
## Another solutions
6933
https://neo4j.com/developer/php/
70-
71-
## Support
72-
If you like this project and you want to support me, buy me a tea :)
73-
74-
[![Donate paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.me/MichalStefanak)

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"ext-sockets": "*",
1313
"ext-mbstring": "*"
1414
},
15+
"require-dev": {
16+
"phpunit/phpunit": ">=7.5.0"
17+
},
1518
"support": {
1619
"issues": "https://github.com/stefanak-michal/Bolt/issues",
1720
"source": "https://github.com/stefanak-michal/Bolt"
@@ -30,7 +33,7 @@
3033
],
3134
"autoload": {
3235
"psr-4": {
33-
"Bolt\\": "/"
36+
"Bolt\\": "src/"
3437
}
3538
}
3639
}

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @link https://github.com/stefanak-michal/Bolt
99
*/
1010

11-
require_once 'autoload.php';
11+
require_once 'src' . DIRECTORY_SEPARATOR . 'autoload.php';
1212

1313
set_time_limit(3);
1414

phpunit.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<phpunit bootstrap="src/autoload.php">
2+
<testsuites>
3+
<testsuite name="Bolt">
4+
<directory>tests</directory>
5+
</testsuite>
6+
</testsuites>
7+
<php>
8+
<var name="NEO_USER" value="neo4j"/>
9+
<var name="NEO_PASS" value="nothing"/>
10+
</php>
11+
<filter>
12+
<whitelist>
13+
<directory suffix=".php">src/connection</directory>
14+
<directory suffix=".php">src/PackStream</directory>
15+
<directory suffix=".php">src/protocol</directory>
16+
<file>src/Bolt.php</file>
17+
</whitelist>
18+
</filter>
19+
</phpunit>

protocol/AProtocol.php

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)