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

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.3.27. 35 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.3.27/code/app/Models/Connection/ConnectionManager.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.3.27/raw/app/Models/Connection/ConnectionManager.php
- Modified: 2025-10-14T16:36:46+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.3.27/code/app/Models/Connection/ConnectionManager.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Models\Connection;

use FluentCart\App\Models\Model;
use FluentCart\Framework\Database\DBManager;
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 DBManager($resolver);
        });
    }
}
```
