# fluent-cart/1.6.4/app/Models/Connection/ConnectionManager.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.6.4. 36 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/app/Models/Connection/ConnectionManager.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.6.4/raw/app/Models/Connection/ConnectionManager.php
- Modified: 2026-06-11T12:21:58+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/app/Models/Connection/ConnectionManager.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Models\Connection;

use FluentCart\App\Models\Model;
use FluentCart\Framework\Database\DatabaseManager;
use FluentCart\Database\Overrides\DbConnection;
use FluentCart\Framework\Database\ConnectionResolver;

class ConnectionManager
{
    public static function connect(&$app)
    {

        $resolver = new ConnectionResolver([
            'mysql' => new DbConnection(
                $GLOBALS['wpdb'],
                $app->config->get('database')
            ),
            'sqlite' => new DbConnection(
                $GLOBALS['wpdb']
            ),
        ]);

        $resolver->setDefaultConnection('mysql');

        Model::setConnectionResolver($resolver);

        Model::setEventDispatcher($app['events']);

        $app->singleton('db', function ($app) use ($resolver) {
            return new DatabaseManager($resolver);
        });
    }
}

```
