mirror of
https://codeberg.org/vlw/php-mysql.git
synced 2025-09-13 16:23:42 +02:00
chore: rename of this package to "php-mysql" (#36)
The name I gave this years ago "libmysqldriver" never sat right with me.. okay it might be considered a library for mysql but it's *definitely* not a driver. Reviewed-on: https://codeberg.org/vlw/php-mysql/pulls/36 Co-authored-by: vlw <victor@vlw.se> Co-committed-by: vlw <victor@vlw.se>
This commit is contained in:
parent
adc2fda90a
commit
a536a3bec4
4 changed files with 14 additions and 14 deletions
12
README.md
12
README.md
|
@ -1,6 +1,6 @@
|
||||||
# php-libmysqldriver
|
# php-mysql
|
||||||
|
|
||||||
This library provides abstraction methods for common operations on MySQL-like databases like `SELECT`, `UPDATE`, and `INSERT` using method chaining for the various MySQL features.
|
This is a simple abstraction library for MySQL DML operations.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
```php
|
```php
|
||||||
|
@ -17,16 +17,16 @@ SELECT $columns FROM $table WHERE $filter ORDER BY $order_by LIMIT $limit;
|
||||||
```
|
```
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> This library is built on top of the PHP [`MySQL Improved`](https://www.php.net/manual/en/book.mysqli.php) extension and requires PHP 8.0 or newer.
|
> This library requires the [`MySQL Improved`](https://www.php.net/manual/en/book.mysqli.php) extension and requires PHP 8.0 or newer.
|
||||||
|
|
||||||
## Install from composer
|
## Install from composer
|
||||||
|
|
||||||
```
|
```
|
||||||
composer require victorwesterlund/libmysqldriver
|
composer require vlw/mysql
|
||||||
```
|
```
|
||||||
|
|
||||||
```php
|
```php
|
||||||
use libmysqldriver/MySQL;
|
use vlw\MySQL\MySQL;
|
||||||
```
|
```
|
||||||
|
|
||||||
# Example / Documentation
|
# Example / Documentation
|
||||||
|
@ -53,7 +53,7 @@ id|beverage_type|beverage_name|beverage_size
|
||||||
3|tea|black|15
|
3|tea|black|15
|
||||||
|
|
||||||
```php
|
```php
|
||||||
use libmysqldriver\MySQL;
|
use vlw\MySQL\MySQL;
|
||||||
|
|
||||||
// Pass through: https://www.php.net/manual/en/mysqli.construct.php
|
// Pass through: https://www.php.net/manual/en/mysqli.construct.php
|
||||||
$db = new MySQL($host, $user, $pass, $db);
|
$db = new MySQL($host, $user, $pass, $db);
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
{
|
{
|
||||||
"name": "victorwesterlund/libmysqldriver",
|
"name": "vlw/mysql",
|
||||||
"description": "Abstraction library for common mysqli features",
|
"description": "Abstraction library for common MySQL/MariaDB DML operations with php-mysqli",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-or-later",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Victor Westerlund",
|
"name": "Victor Westerlund",
|
||||||
"email": "victor.vesterlund@gmail.com"
|
"email": "victor@vlw.se"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"libmysqldriver\\": "src/"
|
"vlw\\MySQL\\": "src/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"require": {}
|
"require": {}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace libmysqldriver;
|
namespace vlw\MySQL;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
use mysqli_stmt;
|
use mysqli_stmt;
|
||||||
use mysqli_result;
|
use mysqli_result;
|
||||||
|
|
||||||
use libmysqldriver\Operators;
|
use vlw\MySQL\Operators;
|
||||||
|
|
||||||
require_once "Operators.php";
|
require_once "Operators.php";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace libmysqldriver;
|
namespace vlw\MySQL;
|
||||||
|
|
||||||
enum Operators: string {
|
enum Operators: string {
|
||||||
// Logical
|
// Logical
|
||||||
|
|
Loading…
Add table
Reference in a new issue