Search code examples
mysqlelfinder

ElFinder multiple roots with MySQL drive


I'm not sure if it's possible to have a connector with multiple MySQL roots. When I try with just one root it works perfect. My code with 2 roots look like this:

[
    'locale' => 'es_ES.UTF-8',
    'bind' => false,
    'debug' => true,
    'roots' => [
        (int) 0 => [
            (int) 0 => [
                'driver' => 'MySQL',
                'host' => 'localhost',
                'user' => 'user',
                'pass' => 'pass',
                'db' => 'elfinder_db',
                'files_table' => 'files',
                'path' => '1'
            ],
            (int) 1 => [
                'driver' => 'MySQL',
                'host' => 'localhost',
                'user' => 'user',
                'pass' => 'pass',
                'db' => 'elfinder_db',
                'files_table' => 'files',
                'path' => '6'
            ]
        ]
    ]
]

Solution

  • Please try simple array.

    [
        'locale' => 'es_ES.UTF-8',
        'bind' => false,
        'debug' => true,
        'roots' => [
            [
                'driver' => 'MySQL',
                'host' => 'localhost',
                'user' => 'user',
                'pass' => 'pass',
                'db' => 'elfinder_db',
                'files_table' => 'files',
                'path' => '1'
            ],
            [
                'driver' => 'MySQL',
                'host' => 'localhost',
                'user' => 'user',
                'pass' => 'pass',
                'db' => 'elfinder_db',
                'files_table' => 'files',
                'path' => '6'
            ]
        ]
    ]