Suppress error messages of failed database connects and config save attempts

This commit is contained in:
Tobias Reich 2016-03-24 22:09:21 +01:00
parent c7e862124b
commit 502f01ae6c
2 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ $config = "<?php
?>"; ?>";
// Save file // Save file
if (file_put_contents(LYCHEE_CONFIG_FILE, $config)===false) return 'Warning: Could not create file!'; if (@file_put_contents(LYCHEE_CONFIG_FILE, $config)===false) return 'Warning: Could not create file!';
return true; return true;

View File

@ -81,7 +81,7 @@ final class Database {
public static function connect($host = 'localhost', $user, $password) { public static function connect($host = 'localhost', $user, $password) {
// Open a new connection to the MySQL server // Open a new connection to the MySQL server
$connection = new Mysqli($host, $user, $password); $connection = @new Mysqli($host, $user, $password);
// Check if the connection was successful // Check if the connection was successful
if ($connection->connect_errno) return false; if ($connection->connect_errno) return false;