PMA\libraries\config\Validator::validatePMAStorage PHP Метод

validatePMAStorage() публичный статический Метод

Validate pmadb config
public static validatePMAStorage ( string $path, array $values ) : array
$path string path to config, not used keep this parameter since the method is invoked using reflection along with other similar methods
$values array config values
Результат array
    public static function validatePMAStorage($path, $values)
    {
        $result = array('Server_pmadb' => '', 'Servers/1/controluser' => '', 'Servers/1/controlpass' => '');
        $error = false;
        if (empty($values['Servers/1/pmadb'])) {
            return $result;
        }
        $result = array();
        if (empty($values['Servers/1/controluser'])) {
            $result['Servers/1/controluser'] = __('Empty phpMyAdmin control user while using phpMyAdmin configuration ' . 'storage!');
            $error = true;
        }
        if (empty($values['Servers/1/controlpass'])) {
            $result['Servers/1/controlpass'] = __('Empty phpMyAdmin control user password while using phpMyAdmin ' . 'configuration storage!');
            $error = true;
        }
        if (!$error) {
            $test = static::testDBConnection(empty($values['Servers/1/connect_type']) ? '' : $values['Servers/1/connect_type'], empty($values['Servers/1/host']) ? '' : $values['Servers/1/host'], empty($values['Servers/1/port']) ? '' : $values['Servers/1/port'], empty($values['Servers/1/socket']) ? '' : $values['Servers/1/socket'], empty($values['Servers/1/controluser']) ? '' : $values['Servers/1/controluser'], empty($values['Servers/1/controlpass']) ? '' : $values['Servers/1/controlpass'], 'Server_pmadb');
            if ($test !== true) {
                $result = array_merge($result, $test);
            }
        }
        return $result;
    }