Replace hardcoded database path by a function (for future usage)

This commit is contained in:
Frederic Guillot 2013-03-26 21:55:35 -04:00
parent 07e49fa4a7
commit 151c35b9df

View File

@ -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)) {