sudo sed -i 's@//.*archive.ubuntu.com@//mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list sudo sed -i 's/security.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list sudo sed -i 's/http:/https:/g' /etc/apt/sources.list
/* * This file is part of Flarum. * * For detailed copyright and license information, please view the * LICENSE file that was distributed with this source code. */
privatefunctionvalidate() { if (empty($this->driver)) { thrownewValidationFailed('Please specify a database driver.'); }
if ($this->driver !== 'mysql') { thrownewValidationFailed('Currently, only MySQL/MariaDB is supported.'); }
if (empty($this->host)) { thrownewValidationFailed('Please specify the hostname of your database server.'); }
if (! is_int($this->port) || $this->port < 1 || $this->port > 65535) { thrownewValidationFailed('Please provide a valid port number between 1 and 65535.'); }
if (empty($this->database)) { thrownewValidationFailed('Please specify the database name.'); }
if (! is_string($this->database)) { thrownewValidationFailed('The database name must be a non-empty string.'); }
if (empty($this->username)) { thrownewValidationFailed('Please specify the username for accessing the database.'); }
if (! is_string($this->database)) { thrownewValidationFailed('The username must be a non-empty string.'); }
if (! empty($this->prefix)) { if (! preg_match('/^[\pL\pM\pN_]+$/u', $this->prefix)) { thrownewValidationFailed('The prefix may only contain characters and underscores.'); }
if (strlen($this->prefix) > 10) { thrownewValidationFailed('The prefix should be no longer than 10 characters.'); } } } }