Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
d7e3a61e63 | |||
1ea9c1f41f | |||
273cc1ac2d | |||
6d332c7cf9 | |||
19978574a3 | |||
c6fd8cf9f9 | |||
00e4b256f7 | |||
54b7ab07f1 | |||
a9f90966e0 |
6
.editorconfig
Normal file
6
.editorconfig
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[README.md]
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = tab
|
||||||
|
tab_width = 2
|
38
README.md
38
README.md
@@ -2,8 +2,8 @@
|
|||||||
Lightweight binary database by pure PHP<br>
|
Lightweight binary database by pure PHP<br>
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
1. 
|
1. [PHP 8.4](https://www.php.net/releases/8.4/en.php)
|
||||||
2.  (php package manager)
|
2. [Composer](https://getcomposer.org/) (php package manager)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
`composer require mirzaev/baza`
|
`composer require mirzaev/baza`
|
||||||
@@ -12,29 +12,29 @@ Lightweight binary database by pure PHP<br>
|
|||||||
```php
|
```php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use use mirzaev\baza\database,
|
use mirzaev\baza\database,
|
||||||
mirzaev\baza\column,
|
mirzaev\baza\column,
|
||||||
mirzaev\baza\record,
|
mirzaev\baza\record,
|
||||||
mirzaev\baza\enumerations\encoding,
|
mirzaev\baza\enumerations\encoding,
|
||||||
mirzaev\baza\enumerations\type;
|
mirzaev\baza\enumerations\type;
|
||||||
|
|
||||||
// Initializing the database
|
// Initializing the database
|
||||||
$database = new database()
|
$database = new database()
|
||||||
->encoding(encoding::utf8)
|
->encoding(encoding::utf8)
|
||||||
->columns(
|
->columns(
|
||||||
new column('name', type::string, ['length' => 32]),
|
new column('name', type::string, ['length' => 32]),
|
||||||
new column('second_name', type::string, ['length' => 64]),
|
new column('second_name', type::string, ['length' => 64]),
|
||||||
new column('age', type::integer),
|
new column('age', type::integer),
|
||||||
new column('height', type::float)
|
new column('height', type::float)
|
||||||
)
|
)
|
||||||
->connect(__DIR__ . DIRECTORY_SEPARATOR . 'database.ba');
|
->connect(__DIR__ . DIRECTORY_SEPARATOR . 'database.ba');
|
||||||
|
|
||||||
// Initializing the record
|
// Initializing the record
|
||||||
$record = $database->record(
|
$record = $database->record(
|
||||||
'Arsen',
|
'Arsen',
|
||||||
'Mirzaev',
|
'Mirzaev',
|
||||||
23,
|
23,
|
||||||
(float) 165
|
(float) 165
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($database->write($record)) {
|
if ($database->write($record)) {
|
||||||
|
Reference in New Issue
Block a user