public function testLoad1() { $storage = new YamlStorage('test_data/test1.yml'); $storage->setDataChanged(); $storage->save(); $storage = new YamlStorage('test_data/test1.yml'); $storage->load(); $this->assertTrue($storage->isLoaded()); }
public function testLoad1() { $fileName = 'test1_' . date('Ymd_His') . '_' . uniqid('', true) . '.yml'; $storage = new YamlStorage('test_data/' . $fileName); $storage->setDataChanged(); $storage->save(); $storage = new YamlStorage('test_data/' . $fileName); $storage->load(); $this->assertTrue($storage->isLoaded()); }
public function shutdown() { #print __CLASS__.'->'.__FUNCTION__.': '.(int)$this->ipcKernelShutdown."\n"; if (!TEST) { fwrite(STDOUT, PHP_EOL); } $this->getLog()->info('shutdown'); #$this->msgAdd('Shutting down...', true, true); if ($this->getModeChannel()) { $this->talkCloseSend(); } #if(!$this->ipcKernelShutdown){ $this->ipcKernelConnection->execSync('shutdown'); } if ($this->settings->data['console']['history']['enabled'] && $this->settings->data['console']['history']['saveToFile']) { $historyStoragePath = $this->settings->data['datadir'] . '/history.yml'; $historyStorage = new YamlStorage($historyStoragePath); if ($this->settings->data['console']['history']['entriesMax']) { $historyStorage->data = array_slice($this->history, 0, $this->settings->data['console']['history']['entriesMax']); } else { $historyStorage->data = $this->history; } $historyStorage->setDataChanged(true); $historyStorage->save(); } if (!TEST) { $this->sttyReset(); } }