Completed
Push — master ( df9929...545913 )
by CodexShaper
05:34
created
src/Commands/DatabaseBackup.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
      */
45 45
     protected function findComposer()
46 46
     {
47
-        if (file_exists(getcwd() . '/composer.phar')) {
48
-            return '"' . PHP_BINARY . '" ' . getcwd() . '/composer.phar';
47
+        if (file_exists(getcwd().'/composer.phar')) {
48
+            return '"'.PHP_BINARY.'" '.getcwd().'/composer.phar';
49 49
         }
50 50
         return 'composer';
51 51
     }
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
     {
55 55
 
56 56
         $prefix = (strlen($table) > 0)
57
-        ? 'table_' . strtolower(str_replace('-', '_', $table)) . "_"
58
-        : 'database_' . strtolower(str_replace('-', '_', $database)) . "_";
57
+        ? 'table_'.strtolower(str_replace('-', '_', $table))."_"
58
+        : 'database_'.strtolower(str_replace('-', '_', $database))."_";
59 59
 
60 60
         $extension = Driver::isMongoDB() ? '' : '.sql';
61
-        $fileName  = $prefix . 'backup_' . date('G_a_m_d_y_h_i_s') . $extension;
61
+        $fileName  = $prefix.'backup_'.date('G_a_m_d_y_h_i_s').$extension;
62 62
 
63 63
         if (Driver::isSqlite()) {
64
-            $fileName = 'backup_' . date('G_a_m_d_y_h_i_s') . $extension;
64
+            $fileName = 'backup_'.date('G_a_m_d_y_h_i_s').$extension;
65 65
         }
66 66
 
67 67
         return $fileName;
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $compressBinaryPath = config('dbm.backup.compress_binary_path', "");
75 75
         $compressCommand    = config('dbm.backup.compress_command', "gzip");
76 76
         $compressExtension  = config('dbm.backup.compress_extension', ".gz");
77
-        $dumpBinaryPath     = config('dbm.backup.' . $data['driver'] . '.binary_path', '');
77
+        $dumpBinaryPath     = config('dbm.backup.'.$data['driver'].'.binary_path', '');
78 78
 
79 79
         switch ($data['driver']) {
80 80
             case 'mysql':
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
         // $hostname = config('database.connections.' . $driver . '.host', '127.0.0.1');
122 122
         // $port     = config('database.connections.' . $driver . '.port', '3306');
123
-        $database = config('database.connections.' . $driver . '.database', 'dbm');
123
+        $database = config('database.connections.'.$driver.'.database', 'dbm');
124 124
         $table    = ($this->option('table') != null) ? $this->option('table') : '';
125 125
         // $username = config('database.connections.' . $driver . '.username', 'root');
126 126
         // $password = config('database.connections.' . $driver . '.password', '');
@@ -130,8 +130,8 @@  discard block
 block discarded – undo
130 130
             $directory = (config('dbm.backup.dir', 'backups') != '')
131 131
             ? DIRECTORY_SEPARATOR . config('dbm.backup.dir', 'backups')
132 132
             : '';
133
-            $directoryPath = storage_path('app') . $directory . DIRECTORY_SEPARATOR . $driver;
134
-            $filePath      = $directoryPath . DIRECTORY_SEPARATOR . $this->getFileName($table, $database);
133
+            $directoryPath = storage_path('app').$directory.DIRECTORY_SEPARATOR.$driver;
134
+            $filePath      = $directoryPath.DIRECTORY_SEPARATOR.$this->getFileName($table, $database);
135 135
 
136 136
             if (!File::isDirectory($directoryPath)) {
137 137
 
Please login to merge, or discard this patch.
src/Commands/DatabaseRestore.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
      */
45 45
     protected function findComposer()
46 46
     {
47
-        if (file_exists(getcwd() . '/composer.phar')) {
48
-            return '"' . PHP_BINARY . '" ' . getcwd() . '/composer.phar';
47
+        if (file_exists(getcwd().'/composer.phar')) {
48
+            return '"'.PHP_BINARY.'" '.getcwd().'/composer.phar';
49 49
         }
50 50
         return 'composer';
51 51
     }
@@ -68,24 +68,24 @@  discard block
 block discarded – undo
68 68
         $password = config('database.connections.mysql.password', '');
69 69
 
70 70
         $driver    = dbm_driver();
71
-        $directory = 'backups' . DIRECTORY_SEPARATOR . $driver;
71
+        $directory = 'backups'.DIRECTORY_SEPARATOR.$driver;
72 72
 
73 73
         if ($this->option('path') != null) {
74 74
             $path = $this->option('path');
75 75
         } else if ($this->option('file') != null) {
76
-            $path = $directory . DIRECTORY_SEPARATOR . $this->option('file');
76
+            $path = $directory.DIRECTORY_SEPARATOR.$this->option('file');
77 77
         } else {
78 78
             $files = array_reverse(Storage::files($directory));
79 79
             $path  = $files[0];
80 80
         }
81 81
 
82
-        $filePath = storage_path('app') . DIRECTORY_SEPARATOR . $path;
82
+        $filePath = storage_path('app').DIRECTORY_SEPARATOR.$path;
83 83
 
84 84
         $isCompress         = config('dbm.backup.compress', false);
85 85
         $compressBinaryPath = config('dbm.backup.compress_binary_path', "");
86 86
         $compressCommand    = config('dbm.backup.uncompress_command', "gunzip");
87 87
         $compressExtension  = config('dbm.backup.compress_extension', ".gz");
88
-        $dumpBinaryPath     = config('dbm.backup.' . $driver . '.binary_path', '');
88
+        $dumpBinaryPath     = config('dbm.backup.'.$driver.'.binary_path', '');
89 89
 
90 90
         try
91 91
         {
Please login to merge, or discard this patch.