Compare commits

...

2 Commits

Author SHA1 Message Date
Timothy Warren 42ec5faa4a Update phinx.yml file for new version of Phinx, see #20
timw4mail/HummingBirdAnimeClient/develop This commit looks good Details
timw4mail/HummingBirdAnimeClient/PR-21 This commit looks good Details
2019-01-07 14:31:17 -05:00
Timothy Warren 1c3b478d49 Cleanup database logic a bit 2019-01-07 14:29:15 -05:00
4 changed files with 12 additions and 11 deletions

View File

@ -8,4 +8,4 @@ user = ""
pass = ""
port = ""
database = ""
file = "anime_collection.sqlite"
file = "anime_collection.sqlite3"

View File

@ -1,9 +1,9 @@
paths:
migrations: %%PHINX_CONFIG_DIR%%/migrations
migrations: '%%PHINX_CONFIG_DIR%%/migrations'
environments:
default_migration_table: phinxlog
default_database: development
development:
adapter: sqlite
name: ./anime_collection.sqlite
name: ./anime_collection # Phinx will add a .sqlite3 suffix

View File

@ -25,6 +25,12 @@ use PDOException;
*/
class Collection extends DB {
/**
* The query builder object
* @var \Query\Query_Builder_Interface
*/
protected $db;
/**
* Whether the database is valid for querying
* @var boolean
@ -43,6 +49,7 @@ class Collection extends DB {
try
{
$this->db = \Query($this->dbConfig);
$this->validDatabase = TRUE;
}
catch (PDOException $e) {}
@ -62,9 +69,9 @@ class Collection extends DB {
$this->validDatabase = FALSE;
}
}
else
else if ($this->db === NULL)
{
$this->validDatabase = TRUE;
$this->validDatabase = FALSE;
}
}

View File

@ -24,12 +24,6 @@ use Aviat\Ion\Di\{ContainerAware, ContainerInterface};
class DB {
use ContainerAware;
/**
* The query builder object
* @var \Query\Query_Builder_Interface
*/
protected $db;
/**
* The database connection information array
* @var array $dbConfig