@@ -72,7 +72,7 @@ |
||
72 | 72 | } |
73 | 73 | // Host |
74 | 74 | if(!empty($this->host)) { |
75 | - $options['host'] "--host {$this->host}"; |
|
75 | + $options['host'] "--host {$this->host}"; |
|
76 | 76 | } |
77 | 77 | // Port |
78 | 78 | if(!empty($this->port)) { |
@@ -59,36 +59,36 @@ |
||
59 | 59 | 'authenticationDatabase' => '', |
60 | 60 | ]; |
61 | 61 | // Database |
62 | - if(!empty($this->dbName)) { |
|
63 | - $options['database'] = "--db {$this->dbName}"; |
|
62 | + if (!empty($this->dbName)) { |
|
63 | + $options[ 'database' ] = "--db {$this->dbName}"; |
|
64 | 64 | } |
65 | 65 | // Username |
66 | - if(!empty($this->username)) { |
|
67 | - $options['username'] = "--username {$this->username}"; |
|
66 | + if (!empty($this->username)) { |
|
67 | + $options[ 'username' ] = "--username {$this->username}"; |
|
68 | 68 | } |
69 | 69 | //Password |
70 | - if(!empty($this->password)) { |
|
71 | - $options['password'] = "--password {$this->password}"; |
|
70 | + if (!empty($this->password)) { |
|
71 | + $options[ 'password' ] = "--password {$this->password}"; |
|
72 | 72 | } |
73 | 73 | // Host |
74 | - if(!empty($this->host)) { |
|
75 | - $options['host'] "--host {$this->host}"; |
|
74 | + if (!empty($this->host)) { |
|
75 | + $options[ 'host' ] "--host {$this->host}"; |
|
76 | 76 | } |
77 | 77 | // Port |
78 | - if(!empty($this->port)) { |
|
79 | - $options['port'] = "--port {$this->port}"; |
|
78 | + if (!empty($this->port)) { |
|
79 | + $options[ 'port' ] = "--port {$this->port}"; |
|
80 | 80 | } |
81 | 81 | // Collection |
82 | - if(!empty($this->collection)) { |
|
83 | - $options['collection'] = "--collection {$this->collection}"; |
|
82 | + if (!empty($this->collection)) { |
|
83 | + $options[ 'collection' ] = "--collection {$this->collection}"; |
|
84 | 84 | } |
85 | 85 | // Authentication Database |
86 | - if(!empty($this->authenticationDatabase)) { |
|
87 | - $options[] = "--authenticationDatabase {$this->authenticationDatabase}"; |
|
86 | + if (!empty($this->authenticationDatabase)) { |
|
87 | + $options[ ] = "--authenticationDatabase {$this->authenticationDatabase}"; |
|
88 | 88 | } |
89 | 89 | // Archive |
90 | 90 | if ($this->isCompress) { |
91 | - $options['archive'] = "--archive --gzip"; |
|
91 | + $options[ 'archive' ] = "--archive --gzip"; |
|
92 | 92 | } |
93 | 93 | // Dump Command |
94 | 94 | $dumpCommand = sprintf( |
@@ -80,60 +80,60 @@ |
||
80 | 80 | ]; |
81 | 81 | |
82 | 82 | if (count($this->tables) > 0) { |
83 | - $options['tables'] = '--tables ' . implode(' ', $this->tables); |
|
83 | + $options[ 'tables' ] = '--tables ' . implode(' ', $this->tables); |
|
84 | 84 | } |
85 | 85 | // Ignore Tables |
86 | - $ignoreTables = []; |
|
86 | + $ignoreTables = [ ]; |
|
87 | 87 | foreach ($this->ignoreTables as $tableName) { |
88 | - $ignoreTables[] = "--ignore-table=" . $databaseArg . "." . $tableName; |
|
89 | - $options['ignoreTables'] = implode(' ', $ignoreTables); |
|
88 | + $ignoreTables[ ] = "--ignore-table=" . $databaseArg . "." . $tableName; |
|
89 | + $options[ 'ignoreTables' ] = implode(' ', $ignoreTables); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | if ($this->singleTransaction) { |
93 | - $options['singleTransaction'] = '--single-transaction'; |
|
93 | + $options[ 'singleTransaction' ] = '--single-transaction'; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | if ($this->skipLockTables) { |
97 | - $options['skipLockTables'] = '--skip-lock-tables'; |
|
97 | + $options[ 'skipLockTables' ] = '--skip-lock-tables'; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | if ($this->quick) { |
101 | - $options['quick'] = '--quick'; |
|
101 | + $options[ 'quick' ] = '--quick'; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | if (!$this->createTables) { |
105 | - $options['createTables'] = '--no-create-info'; |
|
105 | + $options[ 'createTables' ] = '--no-create-info'; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | if ($this->skipComments) { |
109 | - $options['skipComments'] = '--skip-comments'; |
|
109 | + $options[ 'skipComments' ] = '--skip-comments'; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | if ($this->socket !== '') { |
113 | - $options['socket'] = "--socket={$this->socket}"; |
|
113 | + $options[ 'socket' ] = "--socket={$this->socket}"; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | if ($this->defaultCharacterSet) { |
117 | - $options['defaultCharacterSet'] = '--default-character-set=' . $this->defaultCharacterSet; |
|
117 | + $options[ 'defaultCharacterSet' ] = '--default-character-set=' . $this->defaultCharacterSet; |
|
118 | 118 | } |
119 | 119 | |
120 | - $options['authenticate'] = "--defaults-extra-file={$credentialFile}"; |
|
120 | + $options[ 'authenticate' ] = "--defaults-extra-file={$credentialFile}"; |
|
121 | 121 | |
122 | 122 | // Dump command |
123 | 123 | $dumpCommand = sprintf( |
124 | 124 | '%smysqldump %s %s %s %s %s %s %s %s %s %s %s', |
125 | 125 | $this->dumpCommandPath, |
126 | - $options['authenticate'], |
|
126 | + $options[ 'authenticate' ], |
|
127 | 127 | $this->dbName, |
128 | - $options['socket'], |
|
129 | - $options['skipComments'], |
|
130 | - $options['createTables'], |
|
131 | - $options['singleTransaction'], |
|
132 | - $options['skipLockTables'], |
|
133 | - $options['quick'], |
|
134 | - $options['defaultCharacterSet'], |
|
135 | - $options['tables'], |
|
136 | - $options['ignoreTables'] |
|
128 | + $options[ 'socket' ], |
|
129 | + $options[ 'skipComments' ], |
|
130 | + $options[ 'createTables' ], |
|
131 | + $options[ 'singleTransaction' ], |
|
132 | + $options[ 'skipLockTables' ], |
|
133 | + $options[ 'quick' ], |
|
134 | + $options[ 'defaultCharacterSet' ], |
|
135 | + $options[ 'tables' ], |
|
136 | + $options[ 'ignoreTables' ] |
|
137 | 137 | ); |
138 | 138 | // Add compressor if compress is enable |
139 | 139 | if ($this->isCompress) { |