@@ -25,7 +25,7 @@ so you can query your data without blocking your main application.
25
25
and does not get in your way.
26
26
Future or custom commands and events require no changes to be supported.
27
27
* ** Good test coverage** -
28
- Comes with an automated tests suite and is regularly tested against actual SQLite databases in the wild.
28
+ Comes with an automated test suite and is regularly tested against actual SQLite databases in the wild.
29
29
30
30
** Table of contents**
31
31
@@ -64,6 +64,10 @@ existing SQLite database file (or automatically create it on first run) and then
64
64
` INSERT ` a new record to the database:
65
65
66
66
``` php
67
+ <?php
68
+
69
+ require __DIR__ . '/vendor/autoload.php';
70
+
67
71
$factory = new Clue\React\SQLite\Factory();
68
72
69
73
$db = $factory->openLazy('users.db');
@@ -164,11 +168,11 @@ the underlying database is ready. Additionally, it will only keep this
164
168
underlying database in an "idle" state for 60s by default and will
165
169
automatically end the underlying database when it is no longer needed.
166
170
167
- From a consumer side this means that you can start sending queries to the
171
+ From a consumer side, this means that you can start sending queries to the
168
172
database right away while the underlying database process may still be
169
173
outstanding. Because creating this underlying process may take some
170
- time, it will enqueue all oustanding commands and will ensure that all
171
- commands will be executed in correct order once the database is ready.
174
+ time, it will enqueue all outstanding commands and will ensure that all
175
+ commands will be executed in the correct order once the database is ready.
172
176
In other words, this "virtual" database behaves just like a "real"
173
177
database as described in the ` DatabaseInterface ` and frees you from
174
178
having to deal with its async resolution.
@@ -213,7 +217,7 @@ $db = $factory->openLazy('users.db', SQLITE3_OPEN_READONLY);
213
217
By default, this method will keep "idle" connection open for 60s and will
214
218
then end the underlying connection. The next request after an "idle"
215
219
connection ended will automatically create a new underlying connection.
216
- This ensure you always get a "fresh" connection and as such should not be
220
+ This ensures you always get a "fresh" connection and as such should not be
217
221
confused with a "keepalive" or "heartbeat" mechanism, as this will not
218
222
actively try to probe the connection. You can explicitly pass a custom
219
223
idle timeout value in seconds (or use a negative number to not apply a
@@ -355,7 +359,7 @@ The `close(): void` method can be used to
355
359
force-close the connection.
356
360
357
361
Unlike the ` quit() ` method, this method will immediately force-close the
358
- connection and reject all oustanding commands.
362
+ connection and reject all outstanding commands.
359
363
360
364
``` php
361
365
$db->close();
@@ -400,7 +404,7 @@ See also the [`close()`](#close) method.
400
404
401
405
## Install
402
406
403
- The recommended way to install this library is [ through Composer] ( https://getcomposer.org ) .
407
+ The recommended way to install this library is [ through Composer] ( https://getcomposer.org/ ) .
404
408
[ New to Composer?] ( https://getcomposer.org/doc/00-intro.md )
405
409
406
410
This project follows [ SemVer] ( https://semver.org/ ) .
@@ -427,7 +431,7 @@ $ sudo apt install php-sqlite3
427
431
## Tests
428
432
429
433
To run the test suite, you first need to clone this repo and then install all
430
- dependencies [ through Composer] ( https://getcomposer.org ) :
434
+ dependencies [ through Composer] ( https://getcomposer.org/ ) :
431
435
432
436
``` bash
433
437
$ composer install
@@ -436,7 +440,7 @@ $ composer install
436
440
To run the test suite, go to the project root and run:
437
441
438
442
``` bash
439
- $ php vendor/bin/phpunit
443
+ $ vendor/bin/phpunit
440
444
```
441
445
442
446
## License
0 commit comments