mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-11 01:24:27 +02:00
Remove extraneous dba::connect calls
This commit is contained in:
parent
decfc553f7
commit
3985a4bc43
11 changed files with 18 additions and 60 deletions
|
@ -54,12 +54,8 @@ HELP;
|
|||
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
|
||||
}
|
||||
|
||||
require_once '.htconfig.php';
|
||||
$result = \dba::connect($db_host, $db_user, $db_pass, $db_data);
|
||||
unset($db_host, $db_user, $db_pass, $db_data);
|
||||
|
||||
if (!$result) {
|
||||
throw new \RuntimeException('Unable to connect to database');
|
||||
if ($a->mode === App::MODE_INSTALL) {
|
||||
throw new \RuntimeException('Friendica isn\'t properly installed yet.');
|
||||
}
|
||||
|
||||
$nurl = normalise_link($this->getArgument(0));
|
||||
|
|
|
@ -92,12 +92,8 @@ HELP;
|
|||
throw new CommandArgsException('Too many arguments');
|
||||
}
|
||||
|
||||
require_once '.htconfig.php';
|
||||
$result = dba::connect($db_host, $db_user, $db_pass, $db_data);
|
||||
unset($db_host, $db_user, $db_pass, $db_data);
|
||||
|
||||
if (!$result) {
|
||||
throw new \RuntimeException('Unable to connect to database');
|
||||
if ($a->mode === \Friendica\App::MODE_INSTALL) {
|
||||
$this->out('Database isn\'t ready or populated yet, showing file config only');
|
||||
}
|
||||
|
||||
if (count($this->args) == 3) {
|
||||
|
|
|
@ -56,11 +56,7 @@ HELP;
|
|||
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
|
||||
}
|
||||
|
||||
require_once '.htconfig.php';
|
||||
$result = \dba::connect($db_host, $db_user, $db_pass, $db_data);
|
||||
unset($db_host, $db_user, $db_pass, $db_data);
|
||||
|
||||
if (!$result) {
|
||||
if (!\dba::connected()) {
|
||||
throw new \RuntimeException('Unable to connect to database');
|
||||
}
|
||||
|
||||
|
|
|
@ -56,12 +56,8 @@ HELP;
|
|||
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
|
||||
}
|
||||
|
||||
require_once '.htconfig.php';
|
||||
$result = \dba::connect($db_host, $db_user, $db_pass, $db_data);
|
||||
unset($db_host, $db_user, $db_pass, $db_data);
|
||||
|
||||
if (!$result) {
|
||||
throw new \RuntimeException('Unable to connect to database');
|
||||
if ($a->mode == \Friendica\App::MODE_INSTALL) {
|
||||
throw new \RuntimeException('Database isn\'t ready or populated yet');
|
||||
}
|
||||
|
||||
$contact_id = Contact::getIdForURL($this->getArgument(0));
|
||||
|
|
|
@ -64,12 +64,8 @@ HELP;
|
|||
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
|
||||
}
|
||||
|
||||
require_once '.htconfig.php';
|
||||
$result = \dba::connect($db_host, $db_user, $db_pass, $db_data);
|
||||
unset($db_host, $db_user, $db_pass, $db_data);
|
||||
|
||||
if (!$result) {
|
||||
throw new \RuntimeException('Unable to connect to database');
|
||||
if ($a->mode == \Friendica\App::MODE_INSTALL) {
|
||||
throw new \RuntimeException('Database isn\'t ready or populated yet');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -64,12 +64,8 @@ HELP;
|
|||
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
|
||||
}
|
||||
|
||||
require_once '.htconfig.php';
|
||||
$result = \dba::connect($db_host, $db_user, $db_pass, $db_data);
|
||||
unset($db_host, $db_user, $db_pass, $db_data);
|
||||
|
||||
if (!$result) {
|
||||
throw new \RuntimeException('Unable to connect to database');
|
||||
if ($a->mode == \Friendica\App::MODE_INSTALL) {
|
||||
throw new \RuntimeException('Database isn\'t ready or populated yet');
|
||||
}
|
||||
|
||||
Core\Config::load();
|
||||
|
|
|
@ -58,12 +58,8 @@ HELP;
|
|||
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
|
||||
}
|
||||
|
||||
require_once '.htconfig.php';
|
||||
$result = \dba::connect($db_host, $db_user, $db_pass, $db_data);
|
||||
unset($db_host, $db_user, $db_pass, $db_data);
|
||||
|
||||
if (!$result) {
|
||||
throw new \RuntimeException('Unable to connect to database');
|
||||
if ($a->mode == \Friendica\App::MODE_INSTALL) {
|
||||
throw new \RuntimeException('Database isn\'t ready or populated yet');
|
||||
}
|
||||
|
||||
$nick = $this->getArgument(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue