Skip to content
This repository was archived by the owner on Mar 30, 2024. It is now read-only.

Commit 393efde

Browse files
committed
Fix #1
1 parent bc344e9 commit 393efde

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

core/Config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public static function getStorageDir() : string {
7878

7979
public static function getRecordStatus() : bool {
8080
$c = self::getStorageReader('config');
81+
ReaderManager::addReader($c);
8182
if( !self::$statusSetup && !$c->isValue(['status']) ){
8283
$s->setValue(['status'], true);
8384
self::$statusSetup = true;

core/JSONReader.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ public function __construct( $filename, $lockex = false, $otherpath = ''){
8484
if( is_file( $this->filepath ) && is_writeable( $this->filepath ) ){
8585
$this->writeable = true;
8686
}
87-
88-
// add to ReaderManager
89-
ReaderManager::addReader($this);
9087
}
9188

9289
/**

core/Recorder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function __construct(bool $inTerminal = false) {
2929

3030
public function record(bool $forcenew = false) : void {
3131
$r = Config::getStorageReader('current');
32+
ReaderManager::addReader($r);
3233
if( empty($r->getArray())){ // first start etc.
3334
$r->setArray(array(
3435
'name' => '',
@@ -64,6 +65,7 @@ private function saveTaskTime(JSONReader $r) : void {
6465
is_int($r->getValue(['begin'])) ? $r->getValue(['begin']) : time()
6566
)
6667
);
68+
ReaderManager::addReader($data);
6769
$data->setValue([null], array(
6870
"begin" => $r->getValue(['begin']),
6971
"end" => $r->getValue(['lastopend']) + Config::getSleepTime(),

core/StatsData.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,23 @@ public function getAllDatasets() : array {
7373
}
7474

7575
public function merge($merge, $mergeTo) : bool {
76-
$this->loadContents();
7776
if( $merge === $mergeTo){
78-
79-
/**
80-
* ToDo
81-
*/
82-
8377
return true;
8478
}
8579

80+
$ret = true;
81+
foreach( $this->filelist as $f ){
82+
$r = Config::getStorageReader($f);
83+
foreach( $r->getArray() as $k => $a ){
84+
if( $a['name'] === $merge ){
85+
$ret &= $r->setValue([$k, 'name'], $mergeTo);
86+
}
87+
}
88+
unset($r);
89+
}
90+
8691
$this->loadContents(true); //force reload
87-
return false;
92+
return $ret;
8893
}
8994
}
9095
?>

core/Utilities.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55
class Utilities {
66

7-
const VERSION = 'v0.7.5 alpha';
7+
const VERSION = 'v0.8.0 alpha';
88

99
/**
1010
* OS Consts

0 commit comments

Comments
 (0)