Add Install Mode (Part 2)
- Added constants to class `App` - Added global App-Mode to `dba:connect()` instead parameter `$install`
This commit is contained in:
parent
d5b68cd146
commit
a97ad9dc42
7 changed files with 38 additions and 21 deletions
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
|
@ -24,7 +25,7 @@ class dba {
|
|||
private static $in_transaction = false;
|
||||
private static $relation = [];
|
||||
|
||||
public static function connect($serveraddr, $user, $pass, $db, $install = false) {
|
||||
public static function connect($serveraddr, $user, $pass, $db) {
|
||||
if (!is_null(self::$db)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -51,7 +52,7 @@ class dba {
|
|||
return false;
|
||||
}
|
||||
|
||||
if ($install) {
|
||||
if ($a->mode == App::MODE_INSTALL) {
|
||||
// server has to be a non-empty string that is not 'localhost' and not an IP
|
||||
if (strlen($server) && ($server !== 'localhost') && filter_var($server, FILTER_VALIDATE_IP) === false) {
|
||||
if (! dns_get_record($server, DNS_A + DNS_CNAME)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue