@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | protected function getFlushRecord(string $code): ?FlushRecord |
| 72 | 72 | { |
| 73 | 73 | /** @var FlushRecord $obj */ |
| 74 | - $obj = FlushRecord::get()->filter(['Done' => false, 'Code' => $code])->first(); |
|
| 74 | + $obj = FlushRecord::get()->filter([ 'Done' => false, 'Code' => $code ])->first(); |
|
| 75 | 75 | if ($obj) { |
| 76 | 76 | return $obj; |
| 77 | 77 | } |
@@ -84,11 +84,11 @@ discard block |
||
| 84 | 84 | // Function to delete files and folders recursively |
| 85 | 85 | private function deleteFolderContents(string $folderPath) |
| 86 | 86 | { |
| 87 | - if (! is_dir($folderPath)) { |
|
| 87 | + if (!is_dir($folderPath)) { |
|
| 88 | 88 | return; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - $files = array_diff(scandir($folderPath), ['.', '..']); |
|
| 91 | + $files = array_diff(scandir($folderPath), [ '.', '..' ]); |
|
| 92 | 92 | |
| 93 | 93 | foreach ($files as $file) { |
| 94 | 94 | $filePath = $folderPath . '/' . $file; |
@@ -28,9 +28,11 @@ |
||
| 28 | 28 | return self::join_links(self::my_url_segment(), $action); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - public function do($request) |
|
| 31 | + public function do { |
|
| 32 | + ($request) |
|
| 32 | 33 | { |
| 33 | 34 | $code = $request->param('ID'); |
| 35 | + } |
|
| 34 | 36 | $obj = $this->getFlushRecord($code); |
| 35 | 37 | if ($obj) { |
| 36 | 38 | $this->doFlush(); |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | { |
| 73 | 73 | if (Security::database_is_ready() && Director::is_cli() && false === self::$done) { |
| 74 | 74 | self::$done = true; |
| 75 | - register_shutdown_function(function () { |
|
| 75 | + register_shutdown_function(function() { |
|
| 76 | 76 | $obj = \Sunnysideup\FlushFrontEnd\Model\FlushRecord::create(); |
| 77 | 77 | $obj->write(); |
| 78 | 78 | sleep(2); |