Improving translation for mysql user length, fixing tabs, enabling mysql limit note for MariaDB too, adding documentation for is_it_mysql_or_mariadb() PHP function

This commit is contained in:
dpeca 2016-10-11 00:34:41 +00:00
commit 6bf6cbd6d0
31 changed files with 75 additions and 37 deletions

View file

@ -3,7 +3,7 @@
session_start();
define('VESTA_CMD', '/usr/bin/sudo /usr/local/vesta/bin/');
define('JS_LATEST_UPDATE', '1467758417');
define('JS_LATEST_UPDATE', '1476144160');
$i = 0;
@ -346,11 +346,25 @@ function list_timezones() {
return $timezone_list;
}
/**
* A function that tells is it MySQL installed on the system, or it is MariaDB.
*
* Explaination:
* $_SESSION['DB_SYSTEM'] has 'mysql' value even if MariaDB is installed, so you can't figure out is it really MySQL or it's MariaDB.
* So, this function will make it clear.
*
* If MySQL is installed, function will return 'mysql' as a string.
* If MariaDB is installed, function will return 'mariadb' as a string.
*
* Hint: if you want to check if PostgreSQL is installed - check value of $_SESSION['DB_SYSTEM']
*
* @return string
*/
function is_it_mysql_or_mariadb() {
exec (VESTA_CMD."v-list-sys-services json", $output, $return_var);
$data = json_decode(implode('', $output), true);
unset($output);
$mysqltype='mysql';
if (isset($data['mariadb'])) $mysqltype='mariadb';
return $mysqltype;
exec (VESTA_CMD."v-list-sys-services json", $output, $return_var);
$data = json_decode(implode('', $output), true);
unset($output);
$mysqltype='mysql';
if (isset($data['mariadb'])) $mysqltype='mariadb';
return $mysqltype;
}