9 Commits
3.0.0 ... 3.0.1

2 changed files with 25 additions and 19 deletions

6
.editorconfig Normal file
View File

@@ -0,0 +1,6 @@
root = true
[README.md]
charset = utf-8
indent_style = tab
tab_width = 2

View File

@@ -2,8 +2,8 @@
Lightweight binary database by pure PHP<br> Lightweight binary database by pure PHP<br>
## Dependencies ## Dependencies
1. ![PHP 8.4](https://www.php.net/releases/8.4/en.php) 1. [PHP 8.4](https://www.php.net/releases/8.4/en.php)
2. ![Composer](https://getcomposer.org/) (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)) {