@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | try { |
38 | 38 | $reflection = new ReflectionClass($object); |
39 | 39 | } catch (ReflectionException $e) { |
40 | - throw new ReflectionException("Failed setting Protected property. Exception thrown: " . $e->getMessage()); |
|
40 | + throw new ReflectionException("Failed setting Protected property. Exception thrown: ".$e->getMessage()); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | $reflection_property = $reflection->getProperty($property); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | try { |
56 | 56 | $reflection = new ReflectionClass($object); |
57 | 57 | } catch (ReflectionException $e) { |
58 | - throw new ReflectionException("Failed getting Protected property. Exception thrown: " . $e->getMessage()); |
|
58 | + throw new ReflectionException("Failed getting Protected property. Exception thrown: ".$e->getMessage()); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | $reflection_property = $reflection->getProperty($property); |
@@ -16,13 +16,13 @@ discard block |
||
16 | 16 | $process = Process::fromShellCommandline($command, null, null, null, 999.00); |
17 | 17 | |
18 | 18 | $processStatus = true; |
19 | - $process->run(function ($type, $buffer) use ($processStatus): bool { |
|
19 | + $process->run(function($type, $buffer) use ($processStatus): bool { |
|
20 | 20 | if (Process::OUT === $type) { |
21 | - Log::debug('Process buffer: ' . $buffer); |
|
21 | + Log::debug('Process buffer: '.$buffer); |
|
22 | 22 | } |
23 | 23 | if (Process::ERR === $type) { |
24 | 24 | if (!strpos($buffer, '[Warning]')) { |
25 | - Log::error('Error will running processor. Output of buffer: ' . $buffer); |
|
25 | + Log::error('Error will running processor. Output of buffer: '.$buffer); |
|
26 | 26 | $processStatus = false; |
27 | 27 | } |
28 | 28 | } |
@@ -42,12 +42,12 @@ discard block |
||
42 | 42 | $process = new Process($command); |
43 | 43 | |
44 | 44 | $processStatus = true; |
45 | - $process->run(function ($type, $buffer) use ($processStatus): bool { |
|
45 | + $process->run(function($type, $buffer) use ($processStatus): bool { |
|
46 | 46 | if (Process::OUT === $type) { |
47 | - Log::debug('Success buffer: ' . $buffer); |
|
47 | + Log::debug('Success buffer: '.$buffer); |
|
48 | 48 | } |
49 | 49 | if (Process::ERR === $type) { |
50 | - Log::error('Error whilst performing zip action. Output of buffer: ' . $buffer); |
|
50 | + Log::error('Error whilst performing zip action. Output of buffer: '.$buffer); |
|
51 | 51 | $processStatus = false; |
52 | 52 | } |
53 | 53 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $configStoragePath = Config::get('db-backup.backup_folder'); |
31 | 31 | if (substr($configStoragePath, -1, 1) !== DIRECTORY_SEPARATOR) { |
32 | 32 | Log::info('Stored back-up folder is not probably set. Fixing.'); |
33 | - $configStoragePath = $configStoragePath . DIRECTORY_SEPARATOR; |
|
33 | + $configStoragePath = $configStoragePath.DIRECTORY_SEPARATOR; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | return $configStoragePath; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function generateBackupFilename(string $databaseIdentifier, string $databaseFileExtension): string |
68 | 68 | { |
69 | - return $this->backupFilename = $this->storagePath . $databaseIdentifier . '-' . time() . '.' . $databaseFileExtension; |
|
69 | + return $this->backupFilename = $this->storagePath.$databaseIdentifier.'-'.time().'.'.$databaseFileExtension; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | $process = new Process(['gzip', '-d', $workableFile]); |
88 | - $process->run(function ($type, $buffer): bool { |
|
88 | + $process->run(function($type, $buffer): bool { |
|
89 | 89 | if (Process::OUT === $type) { |
90 | - Log::debug('gzip buffer: ' . $buffer); |
|
90 | + Log::debug('gzip buffer: '.$buffer); |
|
91 | 91 | } |
92 | 92 | if (Process::ERR === $type) { |
93 | - Log::error('Error whilst performing zip action. Output of buffer: ' . $buffer); |
|
93 | + Log::error('Error whilst performing zip action. Output of buffer: '.$buffer); |
|
94 | 94 | |
95 | 95 | return false; |
96 | 96 | } |
@@ -111,13 +111,13 @@ discard block |
||
111 | 111 | protected function createTmpFile(string $backupFile, Database $database): ?string |
112 | 112 | { |
113 | 113 | Log::debug('Creating temp back-up file to not corrupt the archives.'); |
114 | - $tmpFilename = 'tmp.' . microtime(true) . '.' . $database->getRealDatabase()->getFileExtension() . '.gz'; |
|
115 | - $filePath = $this->storagePath . $tmpFilename; |
|
114 | + $tmpFilename = 'tmp.'.microtime(true).'.'.$database->getRealDatabase()->getFileExtension().'.gz'; |
|
115 | + $filePath = $this->storagePath.$tmpFilename; |
|
116 | 116 | |
117 | 117 | try { |
118 | 118 | File::copy($backupFile, $filePath); |
119 | 119 | } catch (Exception $e) { |
120 | - Log::error('Could not create temporary archive file. Exception throw: ' . $e->getMessage()); |
|
120 | + Log::error('Could not create temporary archive file. Exception throw: '.$e->getMessage()); |
|
121 | 121 | |
122 | 122 | return null; |
123 | 123 | } |
@@ -98,7 +98,7 @@ |
||
98 | 98 | Log::debug('Starting MySQL import procedure.'); |
99 | 99 | |
100 | 100 | $startTimeImport = microtime(true); |
101 | - $backupFile = '"' . addcslashes($backupFile, '\\"') . '"'; |
|
101 | + $backupFile = '"'.addcslashes($backupFile, '\\"').'"'; |
|
102 | 102 | $command = sprintf('mysql %s %s < %s', $this->getCredentials(), $this->database, $backupFile); |
103 | 103 | |
104 | 104 | if (false === $this->processHandler->run($command)) { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function __construct() |
33 | 33 | { |
34 | 34 | $this->database = Config::get('database.default'); |
35 | - $this->realDatabase = Config::get('database.connections.' . $this->database); |
|
35 | + $this->realDatabase = Config::get('database.connections.'.$this->database); |
|
36 | 36 | $this->processHandler = new ProcessHandler(); |
37 | 37 | |
38 | 38 | // Check if the current database driver is supported |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | public function generateBackupFilename(string $databaseIdentifier, string $databaseFileExtension): string |
91 | 91 | { |
92 | 92 | dd($this); |
93 | - return $this->backupFilename = $this->storage->getStorageFolder() . $databaseIdentifier . '-' . time() . '.' . $databaseFileExtension; |
|
93 | + return $this->backupFilename = $this->storage->getStorageFolder().$databaseIdentifier.'-'.time().'.'.$databaseFileExtension; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |