Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
46 | public function execute() |
||
47 | { |
||
48 | $this->getApplication()->outputTitle('Creating Statistics Snapshot'); |
||
49 | |||
50 | // We want the full raw data set for our snapshot |
||
51 | $this->view->isAuthorizedRaw(true); |
||
52 | |||
53 | $file = APPROOT . '/snapshots/' . date('YmdHis'); |
||
54 | |||
55 | if (!file_put_contents($file, $this->view->render())) |
||
56 | { |
||
57 | throw new \RuntimeException('Failed writing snapshot to the filesystem at ' . $file); |
||
58 | } |
||
59 | |||
60 | $this->getApplication()->out('<info>Snapshot successfully recorded.</info>'); |
||
61 | |||
62 | return true; |
||
63 | } |
||
64 | |||
89 |