Habari\InstallHandler::connect_to_existing_db PHP Метод

connect_to_existing_db() приватный Метод

Checks that there is a database matching the supplied arguments.
private connect_to_existing_db ( ) : boolean
Результат boolean Database exists with credentials?
    private function connect_to_existing_db()
    {
        if ($config = $this->get_config_file()) {
            $config = preg_replace('/<\\?php(.*)\\?' . '>/ims', '$1', $config);
            // Update the db_connection from the config that is about to be written:
            eval($config);
            /* Attempt to connect to the database host */
            try {
                DB::connect();
                return true;
            } catch (\PDOException $e) {
                $this->theme->assign('form_errors', array('db_user' => _t('Problem connecting to supplied database credentials')));
                return false;
            }
        }
        // If we couldn't create the config from the template, return an error
        return false;
    }