Skip to content

Commit

Permalink
Get directory from config factory
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffersoncasimir authored Feb 14, 2024
1 parent 812e412 commit 851106f
Showing 1 changed file with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,11 @@ class ElectrophysioEvents
*/
function updateFiles(): void
{
$db = \NDB_Factory::singleton()->database();
$db = \NDB_Factory::singleton()->database();

//Get data directory base path from Config
$dataDir = $db->pselectOne(
'SELECT Value
FROM Config AS config
INNER JOIN ConfigSettings AS c
ON c.Name=:name AND config.ConfigID=c.ID',
['name' => 'dataDirBasepath']
);
$config = \NDB_Factory::singleton()->config();
$dataDir = $config->getSetting("dataDirBasepath");

$tsv = $db->pselect(
"SELECT
Expand Down Expand Up @@ -369,15 +364,12 @@ class ElectrophysioEvents
*/
function _updateArchives(array $paths) : void
{
$db = \NDB_Factory::singleton()->database();
$db = \NDB_Factory::singleton()->database();

//Get data directory base path from Config
$config = \NDB_Factory::singleton()->config();
$dataDir = $config->getSetting("dataDirBasepath");

$dataDir = $db->pselectOne(
'SELECT Value
FROM Config AS config
INNER JOIN ConfigSettings AS c
ON c.Name=:name AND config.ConfigID=c.ID',
['name' => 'dataDirBasepath']
);
$archive_table_names = [
'physiological_event_archive',
'physiological_archive'
Expand Down

0 comments on commit 851106f

Please sign in to comment.