Cleaners
5 years ago
Exceptions
5 years ago
Cancel.php
2 years ago
CancelUpdate.php
2 years ago
Cloning.php
2 years ago
CloningProcess.php
2 years ago
Data.php
2 years ago
Database.php
2 years ago
Delete.php
2 years ago
Directories.php
2 years ago
Files.php
2 years ago
Finish.php
1 year ago
Job.php
2 years ago
JobExecutable.php
2 years ago
Logs.php
3 years ago
PreserveDataFirstStep.php
3 years ago
PreserveDataSecondStep.php
2 years ago
ProcessLock.php
2 years ago
Scan.php
2 years ago
SearchReplace.php
2 years ago
TotalStepsAreNumberOfTables.php
5 years ago
Updating.php
2 years ago
Logs.php
51 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WPStaging\Backend\Modules\Jobs; |
| 4 | |
| 5 | use WPStaging\Framework\Facades\Sanitize; |
| 6 | |
| 7 | /** |
| 8 | * Class Logs |
| 9 | * @package WPStaging\Backend\Modules\Jobs |
| 10 | */ |
| 11 | class Logs extends Job |
| 12 | { |
| 13 | private $clone = null; |
| 14 | |
| 15 | /** |
| 16 | * Initialization |
| 17 | */ |
| 18 | public function initialize() |
| 19 | { |
| 20 | if (isset($_POST["clone"])) { |
| 21 | $this->clone = Sanitize::sanitizeString($_POST["clone"]); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * @return string |
| 27 | */ |
| 28 | protected function getCloneFileName() |
| 29 | { |
| 30 | return ($this->clone === null) ? $this->options->clone : $this->clone; |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * @param null $clone |
| 35 | */ |
| 36 | public function setClone($clone) |
| 37 | { |
| 38 | $this->clone = $clone; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Start Module |
| 43 | * @return string |
| 44 | */ |
| 45 | public function start() |
| 46 | { |
| 47 | $logs = explode(PHP_EOL, $this->logger->read($this->getCloneFileName())); |
| 48 | return trim(implode("<br>", array_reverse($logs)), "<br>"); |
| 49 | } |
| 50 | } |
| 51 |