Compare commits
2 Commits
5d752f6ee3
...
42ec5faa4a
Author | SHA1 | Date |
---|---|---|
Timothy Warren | 42ec5faa4a | |
Timothy Warren | 1c3b478d49 |
|
@ -8,4 +8,4 @@ user = ""
|
||||||
pass = ""
|
pass = ""
|
||||||
port = ""
|
port = ""
|
||||||
database = ""
|
database = ""
|
||||||
file = "anime_collection.sqlite"
|
file = "anime_collection.sqlite3"
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
paths:
|
paths:
|
||||||
migrations: %%PHINX_CONFIG_DIR%%/migrations
|
migrations: '%%PHINX_CONFIG_DIR%%/migrations'
|
||||||
|
|
||||||
environments:
|
environments:
|
||||||
default_migration_table: phinxlog
|
default_migration_table: phinxlog
|
||||||
default_database: development
|
default_database: development
|
||||||
development:
|
development:
|
||||||
adapter: sqlite
|
adapter: sqlite
|
||||||
name: ./anime_collection.sqlite
|
name: ./anime_collection # Phinx will add a .sqlite3 suffix
|
||||||
|
|
|
@ -25,6 +25,12 @@ use PDOException;
|
||||||
*/
|
*/
|
||||||
class Collection extends DB {
|
class Collection extends DB {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The query builder object
|
||||||
|
* @var \Query\Query_Builder_Interface
|
||||||
|
*/
|
||||||
|
protected $db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the database is valid for querying
|
* Whether the database is valid for querying
|
||||||
* @var boolean
|
* @var boolean
|
||||||
|
@ -43,6 +49,7 @@ class Collection extends DB {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$this->db = \Query($this->dbConfig);
|
$this->db = \Query($this->dbConfig);
|
||||||
|
$this->validDatabase = TRUE;
|
||||||
}
|
}
|
||||||
catch (PDOException $e) {}
|
catch (PDOException $e) {}
|
||||||
|
|
||||||
|
@ -62,9 +69,9 @@ class Collection extends DB {
|
||||||
$this->validDatabase = FALSE;
|
$this->validDatabase = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if ($this->db === NULL)
|
||||||
{
|
{
|
||||||
$this->validDatabase = TRUE;
|
$this->validDatabase = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,12 +24,6 @@ use Aviat\Ion\Di\{ContainerAware, ContainerInterface};
|
||||||
class DB {
|
class DB {
|
||||||
use ContainerAware;
|
use ContainerAware;
|
||||||
|
|
||||||
/**
|
|
||||||
* The query builder object
|
|
||||||
* @var \Query\Query_Builder_Interface
|
|
||||||
*/
|
|
||||||
protected $db;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The database connection information array
|
* The database connection information array
|
||||||
* @var array $dbConfig
|
* @var array $dbConfig
|
||||||
|
|
Loading…
Reference in New Issue