Fix tests broken by missing fix to Anime Collection Model
This commit is contained in:
parent
2f8886c28f
commit
799a3652d4
@ -34,7 +34,15 @@ class AnimeCollection extends DB {
|
||||
{
|
||||
parent::__construct($container);
|
||||
|
||||
try
|
||||
{
|
||||
$this->db = \Query($this->db_config['collection']);
|
||||
}
|
||||
catch (\PDOException $e)
|
||||
{
|
||||
$this->valid_database = FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
$this->anime_model = new AnimeModel($container);
|
||||
|
||||
// Is database valid? If not, set a flag so the
|
||||
@ -42,16 +50,9 @@ class AnimeCollection extends DB {
|
||||
$db_file_name = $this->db_config['collection']['file'];
|
||||
if ($db_file_name !== ':memory:')
|
||||
{
|
||||
if ( ! file_exists($db_file_name))
|
||||
{
|
||||
$this->valid_database = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
$db_file = file_get_contents($db_file_name);
|
||||
$db_file = @file_get_contents($db_file_name);
|
||||
$this->valid_database = (strpos($db_file, 'SQLite format 3') === 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->valid_database = TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user