public function databaseMount(Request $request)
    {
        $dbName = trim($request->request->get('new_dbname', ''));

        /** @var DataboxService $databoxService */
        $databoxService = $this->app['databox.service'];

        try {
            $connectionSettings = $this->buildSettingsFromRequest($request);

            \phrasea::clear_sbas_params($this->app);

            $databox = $databoxService->mountDatabox($dbName, $this->app->getAuthenticatedUser(), $connectionSettings);

            return $this->app->redirectPath('admin_database', [
                'databox_id' => $databox->get_sbas_id(),
                'success' => 1,
                'reload-tree' => 1,
            ]);
        }
        catch (\InvalidArgumentException $exception) {
            return $this->handleInvalidArgument($exception);
        }
        catch (\Exception $exception) {
            return $this->app->redirectPath('admin_databases', [
                'success' => 0,
                // 'error' => 'mount-failed'
                'error' => $exception->getMessage()
            ]);
        }
    }
public function databaseMount(Request $request)
    {
        $dbName = trim($request->request->get('new_dbname', ''));

        /** @var DataboxService $databoxService */
        $databoxService = $this->app['databox.service'];

        try {
            $connectionSettings = $this->buildSettingsFromRequest($request);

            \phrasea::clear_sbas_params($this->app);

            $databox = $databoxService->mountDatabox($dbName, $this->app->getAuthenticatedUser(), $connectionSettings);

            return $this->app->redirectPath('admin_database', [
                'databox_id' => $databox->get_sbas_id(),
                'success' => 1,
                'reload-tree' => 1,
            ]);
        }
        catch (\InvalidArgumentException $exception) {
            return $this->handleInvalidArgument($exception);
        }
        catch (\Exception $exception) {
            return $this->app->redirectPath('admin_databases', [
                'success' => 0,
                // 'error' => 'mount-failed'
                'error' => $exception->getMessage()
            ]);
        }
    }
public function databaseMount ( Request $ request ) { $ dbName = trim ( $ request -> request -> get ( 'new_dbname' , '' ) ) ; /** @var DataboxService $databoxService */ $ databoxService = $ this -> app [ 'databox.service' ] ; try { $ connectionSettings = $ this -> buildSettingsFromRequest ( $ request ) ; \ phrasea :: clear_sbas_params ( $ this -> app ) ; $ databox = $ databoxService -> mountDatabox ( $ dbName , $ this -> app -> getAuthenticatedUser ( ) , $ connectionSettings ) ; return $ this -> app -> redirectPath ( 'admin_database' , [ 'databox_id' => $ databox -> get_sbas_id ( ) , 'success' => 1 , 'reload-tree' => 1 , ] ) ; } catch ( \ InvalidArgumentException $ exception ) { return $ this -> handleInvalidArgument ( $ exception ) ; } catch ( \ Exception $ exception ) { return $ this -> app -> redirectPath ( 'admin_databases' , [ 'success' => 0 , // 'error' => 'mount-failed' 'error' => $ exception -> getMessage ( ) ] ) ; } }
Mount a databox

@param  Request $request The current HTTP request
@return RedirectResponse
Mount a databox