commit
42af88ded9
@ -139,12 +139,12 @@ class AdminPage extends Extension {
|
|||||||
|
|
||||||
private function dbdump(Page $page) {
|
private function dbdump(Page $page) {
|
||||||
$matches = array();
|
$matches = array();
|
||||||
preg_match("#(\w+)://(\w+):(\w+)@([\w\.\-]+)/([\w_]+)(\?.*)?#", DATABASE_DSN, $matches);
|
preg_match("#^(?P<proto>\w+)\:(?:user=(?P<user>\w+)(?:;|$)|password=(?P<password>\w+)(?:;|$)|host=(?P<host>[\w\.\-]+)(?:;|$)|dbname=(?P<dbname>[\w_]+)(?:;|$))+#", DATABASE_DSN, $matches);
|
||||||
$software = $matches[1];
|
$software = $matches['proto'];
|
||||||
$username = $matches[2];
|
$username = $matches['user'];
|
||||||
$password = $matches[3];
|
$password = $matches['password'];
|
||||||
$hostname = $matches[4];
|
$hostname = $matches['host'];
|
||||||
$database = $matches[5];
|
$database = $matches['dbname'];
|
||||||
|
|
||||||
// TODO: Support more than just MySQL..
|
// TODO: Support more than just MySQL..
|
||||||
switch($software) {
|
switch($software) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user