Replace hardcoded database path by a function (for future usage)
This commit is contained in:
parent
07e49fa4a7
commit
151c35b9df
@ -9,11 +9,17 @@ require 'schema.php';
|
|||||||
require 'model.php';
|
require 'model.php';
|
||||||
|
|
||||||
|
|
||||||
|
function get_db_filename()
|
||||||
|
{
|
||||||
|
return 'data/db.sqlite';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
PicoTools\container('db', function() {
|
PicoTools\container('db', function() {
|
||||||
|
|
||||||
$db = new PicoDb\Database(array(
|
$db = new PicoDb\Database(array(
|
||||||
'driver' => 'sqlite',
|
'driver' => 'sqlite',
|
||||||
'filename' => 'data/db.sqlite'
|
'filename' => get_db_filename()
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($db->schema()->check(1)) {
|
if ($db->schema()->check(1)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user