protected function _mysqlBackend(array $backend)
    {
        if (empty($backend['config']['ini_file'])) {
            return $this->abort('Missing config.ini_file key for mysql backend');
        }
        if (!is_file($backend['config']['ini_file'])) {
            return $this->abort('ini file do not exist (' . $backend['config']['ini_file'] . ')');
        }

        $ini = parse_ini_file($backend['config']['ini_file']);
        $connection_url = sprintf('%s:%s@unix(/var/run/mysqld/mysqld.sock)/', $ini['user'], $ini['password']);

        $data = $this->Vault->data();
        $this->info('  Writing connection string');
        $max_open_connections = 10;
        $data->write('mysql/config/connection', compact('connection_url', 'max_open_connections'));

        $this->info('  Writing lease configuration');
        $data->write('mysql/config/lease', ['lease' => '1h', 'lease_max' => '24h']);

        $this->info('  Writing role configuration(s)');
        foreach ($backend['roles'] as $role) {
            $this->info('    ' . $role['name']);
            $data->write('mysql/roles/' . $role['name'], ['sql' => join(';', $role['sql'])]);
        }

    }
protected function _mysqlBackend(array $backend)
    {
        if (empty($backend['config']['ini_file'])) {
            return $this->abort('Missing config.ini_file key for mysql backend');
        }
        if (!is_file($backend['config']['ini_file'])) {
            return $this->abort('ini file do not exist (' . $backend['config']['ini_file'] . ')');
        }

        $ini = parse_ini_file($backend['config']['ini_file']);
        $connection_url = sprintf('%s:%s@unix(/var/run/mysqld/mysqld.sock)/', $ini['user'], $ini['password']);

        $data = $this->Vault->data();
        $this->info('  Writing connection string');
        $max_open_connections = 10;
        $data->write('mysql/config/connection', compact('connection_url', 'max_open_connections'));

        $this->info('  Writing lease configuration');
        $data->write('mysql/config/lease', ['lease' => '1h', 'lease_max' => '24h']);

        $this->info('  Writing role configuration(s)');
        foreach ($backend['roles'] as $role) {
            $this->info('    ' . $role['name']);
            $data->write('mysql/roles/' . $role['name'], ['sql' => join(';', $role['sql'])]);
        }

    }
protected function _mysqlBackend ( array $ backend ) { if ( empty ( $ backend [ 'config' ] [ 'ini_file' ] ) ) { return $ this -> abort ( 'Missing config.ini_file key for mysql backend' ) ; } if ( ! is_file ( $ backend [ 'config' ] [ 'ini_file' ] ) ) { return $ this -> abort ( 'ini file do not exist (' . $ backend [ 'config' ] [ 'ini_file' ] . ')' ) ; } $ ini = parse_ini_file ( $ backend [ 'config' ] [ 'ini_file' ] ) ; $ connection_url = sprintf ( '%s:%s@unix(/var/run/mysqld/mysqld.sock)/' , $ ini [ 'user' ] , $ ini [ 'password' ] ) ; $ data = $ this -> Vault -> data ( ) ; $ this -> info ( '  Writing connection string' ) ; $ max_open_connections = 10 ; $ data -> write ( 'mysql/config/connection' , compact ( 'connection_url' , 'max_open_connections' ) ) ; $ this -> info ( '  Writing lease configuration' ) ; $ data -> write ( 'mysql/config/lease' , [ 'lease' => '1h' , 'lease_max' => '24h' ] ) ; $ this -> info ( '  Writing role configuration(s)' ) ; foreach ( $ backend [ 'roles' ] as $ role ) { $ this -> info ( '    ' . $ role [ 'name' ] ) ; $ data -> write ( 'mysql/roles/' . $ role [ 'name' ] , [ 'sql' => join ( ';' , $ role [ 'sql' ] ) ] ) ; } }
Specific handler for MySQL secret backends

@param  array $backend
@return void
Specific handler for MySQL secret backends