PHPackages                             avoutic/web-framework-mysql - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. avoutic/web-framework-mysql

ActiveLibrary[Framework](/categories/framework)

avoutic/web-framework-mysql
===========================

MySQL module for WebFramework

4.0.0(8mo ago)01.9k1MITPHPCI passing

Since May 23Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/avoutic/web-framework-mysql)[ Packagist](https://packagist.org/packages/avoutic/web-framework-mysql)[ Docs](https://web-framework.com)[ RSS](/packages/avoutic-web-framework-mysql/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (6)Versions (6)Used By (1)

WebFramework MySQL Module
=========================

[](#webframework-mysql-module)

This module provides MySQL and MariaDB database integration for WebFramework.

Installation
------------

[](#installation)

Install via Composer:

```
composer require avoutic/web-framework-mysql
```

Make sure the definitions file is included in your project by adding it to `definition_files` in your `config.php` file:

```
return [
    'definition_files' => [
        '../vendor/avoutic/web-framework/definitions/definitions.php',
        '../vendor/avoutic/web-framework-mysql/definitions/definitions.php',
        'app_definitions.php',
    ],
];
```

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- MySQL or MariaDB server
- PHP mysqli extension
- WebFramework core package (^11)

Usage
-----

[](#usage)

The module provides MySQL integration for WebFramework, enabling database access. It implements the WebFramework Database interface to access the database.

To use MySQL for database access you need to add it in your PHP-DI definitions:

```
return [
    Database::class => DI\autowire(MysqliDatabase::class),
];
```

Configuration
-------------

[](#configuration)

If you are using the definition from *definitions/defitinions.php*. You can just add the following *db\_config.main.php* to your auth config directory (*config/auth*):

```
