1 | <?php |
||||
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||||
2 | |||||
3 | /** |
||||
4 | * PHP version of mysqldump cli that comes with MySQL. |
||||
5 | * |
||||
6 | * Tags: mysql mysqldump pdo php7 php5 database php sql hhvm mariadb mysql-backup. |
||||
7 | * |
||||
8 | * @category Library |
||||
0 ignored issues
–
show
|
|||||
9 | * @package Ifsnop\Mysqldump |
||||
0 ignored issues
–
show
|
|||||
10 | * @author Diego Torres <[email protected]> |
||||
0 ignored issues
–
show
|
|||||
11 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License |
||||
0 ignored issues
–
show
|
|||||
12 | * @link https://github.com/ifsnop/mysqldump-php |
||||
13 | * |
||||
14 | */ |
||||
0 ignored issues
–
show
|
|||||
15 | |||||
16 | namespace Ifsnop\Mysqldump; |
||||
17 | |||||
18 | use Exception; |
||||
19 | use PDO; |
||||
20 | use PDOException; |
||||
21 | |||||
22 | /** |
||||
23 | * Class Mysqldump. |
||||
24 | * |
||||
25 | * @category Library |
||||
0 ignored issues
–
show
|
|||||
26 | * @author Diego Torres <[email protected]> |
||||
0 ignored issues
–
show
|
|||||
27 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License |
||||
0 ignored issues
–
show
|
|||||
28 | * @link https://github.com/ifsnop/mysqldump-php |
||||
0 ignored issues
–
show
|
|||||
29 | * |
||||
30 | */ |
||||
0 ignored issues
–
show
|
|||||
31 | class Mysqldump |
||||
32 | { |
||||
0 ignored issues
–
show
|
|||||
33 | |||||
34 | // Same as mysqldump. |
||||
35 | const MAXLINESIZE = 1000000; |
||||
36 | |||||
37 | // List of available compression methods as constants. |
||||
38 | const GZIP = 'Gzip'; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 2 spaces
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
39 | const BZIP2 = 'Bzip2'; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
40 | const NONE = 'None'; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 2 spaces
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
41 | const GZIPSTREAM = 'Gzipstream'; |
||||
42 | |||||
43 | // List of available connection strings. |
||||
44 | const UTF8 = 'utf8'; |
||||
45 | const UTF8MB4 = 'utf8mb4'; |
||||
46 | const BINARY = 'binary'; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
47 | |||||
48 | /** |
||||
49 | * Database username. |
||||
50 | * @var string |
||||
0 ignored issues
–
show
|
|||||
51 | */ |
||||
52 | public $user; |
||||
53 | |||||
54 | /** |
||||
55 | * Database password. |
||||
56 | * @var string |
||||
0 ignored issues
–
show
|
|||||
57 | */ |
||||
58 | public $pass; |
||||
59 | |||||
60 | /** |
||||
61 | * Connection string for PDO. |
||||
62 | * @var string |
||||
0 ignored issues
–
show
|
|||||
63 | */ |
||||
64 | public $dsn; |
||||
65 | |||||
66 | /** |
||||
67 | * Destination filename, defaults to stdout. |
||||
68 | * @var string |
||||
0 ignored issues
–
show
|
|||||
69 | */ |
||||
70 | public $fileName = 'php://stdout'; |
||||
71 | |||||
72 | // Internal stuff. |
||||
73 | private $tables = array(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
74 | private $views = array(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
75 | private $triggers = array(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
76 | private $procedures = array(); |
||||
0 ignored issues
–
show
|
|||||
77 | private $functions = array(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
78 | private $events = array(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
79 | private $dbHandler = null; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
80 | private $dbType = ""; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
81 | private $compressManager; |
||||
0 ignored issues
–
show
|
|||||
82 | private $typeAdapter; |
||||
0 ignored issues
–
show
|
|||||
83 | private $dumpSettings = array(); |
||||
0 ignored issues
–
show
|
|||||
84 | private $pdoSettings = array(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
85 | private $version; |
||||
0 ignored issues
–
show
|
|||||
86 | private $tableColumnTypes = array(); |
||||
0 ignored issues
–
show
|
|||||
87 | private $transformTableRowCallable; |
||||
0 ignored issues
–
show
|
|||||
88 | private $transformColumnValueCallable; |
||||
0 ignored issues
–
show
|
|||||
89 | private $infoCallable; |
||||
0 ignored issues
–
show
|
|||||
90 | |||||
91 | /** |
||||
92 | * Database name, parsed from dsn. |
||||
93 | * @var string |
||||
0 ignored issues
–
show
|
|||||
94 | */ |
||||
95 | private $dbName; |
||||
0 ignored issues
–
show
|
|||||
96 | |||||
97 | /** |
||||
98 | * Host name, parsed from dsn. |
||||
99 | * @var string |
||||
0 ignored issues
–
show
|
|||||
100 | */ |
||||
101 | private $host; |
||||
0 ignored issues
–
show
|
|||||
102 | |||||
103 | /** |
||||
104 | * Dsn string parsed as an array. |
||||
105 | * @var array |
||||
0 ignored issues
–
show
|
|||||
106 | */ |
||||
107 | private $dsnArray = array(); |
||||
0 ignored issues
–
show
|
|||||
108 | |||||
109 | /** |
||||
110 | * Keyed on table name, with the value as the conditions. |
||||
111 | * e.g. - 'users' => 'date_registered > NOW() - INTERVAL 6 MONTH' |
||||
112 | * |
||||
113 | * @var array |
||||
114 | */ |
||||
115 | private $tableWheres = array(); |
||||
0 ignored issues
–
show
|
|||||
116 | private $tableLimits = array(); |
||||
0 ignored issues
–
show
|
|||||
117 | |||||
118 | |||||
119 | /** |
||||
120 | * Constructor of Mysqldump. Note that in the case of an SQLite database |
||||
121 | * connection, the filename must be in the $db parameter. |
||||
122 | * |
||||
123 | * @param string $dsn PDO DSN connection string |
||||
0 ignored issues
–
show
|
|||||
124 | * @param string $user SQL account username |
||||
0 ignored issues
–
show
|
|||||
125 | * @param string $pass SQL account password |
||||
0 ignored issues
–
show
|
|||||
126 | * @param array $dumpSettings SQL database settings |
||||
0 ignored issues
–
show
|
|||||
127 | * @param array $pdoSettings PDO configured attributes |
||||
0 ignored issues
–
show
|
|||||
128 | */ |
||||
0 ignored issues
–
show
|
|||||
129 | public function __construct( |
||||
0 ignored issues
–
show
|
|||||
130 | $dsn = '', |
||||
131 | $user = '', |
||||
132 | $pass = '', |
||||
133 | $dumpSettings = array(), |
||||
0 ignored issues
–
show
|
|||||
134 | $pdoSettings = array() |
||||
0 ignored issues
–
show
|
|||||
135 | ) { |
||||
0 ignored issues
–
show
|
|||||
136 | $dumpSettingsDefault = array( |
||||
0 ignored issues
–
show
|
|||||
137 | 'include-tables' => array(), |
||||
0 ignored issues
–
show
|
|||||
138 | 'exclude-tables' => array(), |
||||
0 ignored issues
–
show
|
|||||
139 | 'include-views' => array(), |
||||
0 ignored issues
–
show
|
|||||
140 | 'compress' => Mysqldump::NONE, |
||||
0 ignored issues
–
show
As per coding style,
self should be used for accessing local static members.
This check looks for accesses to local static members using the fully qualified name instead
of <?php
class Certificate {
const TRIPLEDES_CBC = 'ASDFGHJKL';
private $key;
public function __construct()
{
$this->key = Certificate::TRIPLEDES_CBC;
}
}
While this is perfectly valid, the fully qualified name of
Loading history...
|
|||||
141 | 'init_commands' => array(), |
||||
0 ignored issues
–
show
|
|||||
142 | 'no-data' => array(), |
||||
0 ignored issues
–
show
|
|||||
143 | 'if-not-exists' => false, |
||||
0 ignored issues
–
show
|
|||||
144 | 'reset-auto-increment' => false, |
||||
0 ignored issues
–
show
|
|||||
145 | 'add-drop-database' => false, |
||||
0 ignored issues
–
show
|
|||||
146 | 'add-drop-table' => false, |
||||
0 ignored issues
–
show
|
|||||
147 | 'add-drop-trigger' => true, |
||||
0 ignored issues
–
show
|
|||||
148 | 'add-locks' => true, |
||||
0 ignored issues
–
show
|
|||||
149 | 'complete-insert' => false, |
||||
0 ignored issues
–
show
|
|||||
150 | 'databases' => false, |
||||
0 ignored issues
–
show
|
|||||
151 | 'default-character-set' => Mysqldump::UTF8, |
||||
0 ignored issues
–
show
As per coding style,
self should be used for accessing local static members.
This check looks for accesses to local static members using the fully qualified name instead
of <?php
class Certificate {
const TRIPLEDES_CBC = 'ASDFGHJKL';
private $key;
public function __construct()
{
$this->key = Certificate::TRIPLEDES_CBC;
}
}
While this is perfectly valid, the fully qualified name of
Loading history...
|
|||||
152 | 'disable-keys' => true, |
||||
0 ignored issues
–
show
|
|||||
153 | 'extended-insert' => true, |
||||
0 ignored issues
–
show
|
|||||
154 | 'events' => false, |
||||
0 ignored issues
–
show
|
|||||
155 | 'hex-blob' => true, /* faster than escaped content */ |
||||
0 ignored issues
–
show
|
|||||
156 | 'insert-ignore' => false, |
||||
0 ignored issues
–
show
|
|||||
157 | 'net_buffer_length' => self::MAXLINESIZE, |
||||
0 ignored issues
–
show
|
|||||
158 | 'no-autocommit' => true, |
||||
0 ignored issues
–
show
|
|||||
159 | 'no-create-info' => false, |
||||
0 ignored issues
–
show
|
|||||
160 | 'lock-tables' => true, |
||||
0 ignored issues
–
show
|
|||||
161 | 'routines' => false, |
||||
0 ignored issues
–
show
|
|||||
162 | 'single-transaction' => true, |
||||
0 ignored issues
–
show
|
|||||
163 | 'skip-triggers' => false, |
||||
0 ignored issues
–
show
|
|||||
164 | 'skip-tz-utc' => false, |
||||
0 ignored issues
–
show
|
|||||
165 | 'skip-comments' => false, |
||||
0 ignored issues
–
show
|
|||||
166 | 'skip-dump-date' => false, |
||||
0 ignored issues
–
show
|
|||||
167 | 'skip-definer' => false, |
||||
0 ignored issues
–
show
|
|||||
168 | 'where' => '', |
||||
0 ignored issues
–
show
|
|||||
169 | /* deprecated */ |
||||
0 ignored issues
–
show
|
|||||
170 | 'disable-foreign-keys-check' => true |
||||
0 ignored issues
–
show
|
|||||
171 | ); |
||||
0 ignored issues
–
show
|
|||||
172 | |||||
173 | $pdoSettingsDefault = array( |
||||
0 ignored issues
–
show
|
|||||
174 | PDO::ATTR_PERSISTENT => true, |
||||
0 ignored issues
–
show
|
|||||
175 | PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, |
||||
0 ignored issues
–
show
|
|||||
176 | ); |
||||
0 ignored issues
–
show
|
|||||
177 | |||||
178 | $this->user = $user; |
||||
179 | $this->pass = $pass; |
||||
180 | $this->parseDsn($dsn); |
||||
181 | |||||
182 | // This drops MYSQL dependency, only use the constant if it's defined. |
||||
183 | if ("mysql" === $this->dbType) { |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
mysql does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
184 | $pdoSettingsDefault[PDO::MYSQL_ATTR_USE_BUFFERED_QUERY] = false; |
||||
0 ignored issues
–
show
|
|||||
185 | } |
||||
186 | |||||
187 | $this->pdoSettings = array_replace_recursive($pdoSettingsDefault, $pdoSettings); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 21 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
188 | $this->dumpSettings = array_replace_recursive($dumpSettingsDefault, $dumpSettings); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 20 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
189 | $this->dumpSettings['init_commands'][] = "SET NAMES ".$this->dumpSettings['default-character-set']; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
SET NAMES does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
190 | |||||
191 | if (false === $this->dumpSettings['skip-tz-utc']) { |
||||
0 ignored issues
–
show
|
|||||
192 | $this->dumpSettings['init_commands'][] = "SET TIME_ZONE='+00:00'"; |
||||
193 | } |
||||
194 | |||||
195 | $diff = array_diff(array_keys($this->dumpSettings), array_keys($dumpSettingsDefault)); |
||||
196 | if (count($diff) > 0) { |
||||
197 | throw new Exception("Unexpected value in dumpSettings: (".implode(",", $diff).")"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Unexpected value in dumpSettings: ( does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
, does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
) does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
198 | } |
||||
199 | |||||
200 | if (!is_array($this->dumpSettings['include-tables']) || |
||||
0 ignored issues
–
show
|
|||||
201 | !is_array($this->dumpSettings['exclude-tables'])) { |
||||
0 ignored issues
–
show
|
|||||
202 | throw new Exception("Include-tables and exclude-tables should be arrays"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Include-tables and exclude-tables should be arrays does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
203 | } |
||||
204 | |||||
205 | // If no include-views is passed in, dump the same views as tables, mimic mysqldump behaviour. |
||||
0 ignored issues
–
show
|
|||||
206 | if (!isset($dumpSettings['include-views'])) { |
||||
0 ignored issues
–
show
|
|||||
207 | $this->dumpSettings['include-views'] = $this->dumpSettings['include-tables']; |
||||
208 | } |
||||
209 | |||||
210 | // Create a new compressManager to manage compressed output |
||||
0 ignored issues
–
show
|
|||||
211 | $this->compressManager = CompressManagerFactory::create($this->dumpSettings['compress']); |
||||
212 | } |
||||
0 ignored issues
–
show
|
|||||
213 | |||||
214 | /** |
||||
215 | * Destructor of Mysqldump. Unsets dbHandlers and database objects. |
||||
216 | */ |
||||
217 | public function __destruct() |
||||
218 | { |
||||
0 ignored issues
–
show
|
|||||
219 | $this->dbHandler = null; |
||||
0 ignored issues
–
show
|
|||||
220 | } |
||||
0 ignored issues
–
show
|
|||||
221 | |||||
222 | /** |
||||
223 | * Keyed by table name, with the value as the conditions: |
||||
224 | * e.g. 'users' => 'date_registered > NOW() - INTERVAL 6 MONTH AND deleted=0' |
||||
225 | * |
||||
226 | * @param array $tableWheres |
||||
0 ignored issues
–
show
|
|||||
227 | */ |
||||
0 ignored issues
–
show
|
|||||
228 | public function setTableWheres(array $tableWheres) |
||||
229 | { |
||||
0 ignored issues
–
show
|
|||||
230 | $this->tableWheres = $tableWheres; |
||||
231 | } |
||||
0 ignored issues
–
show
|
|||||
232 | |||||
233 | /** |
||||
0 ignored issues
–
show
|
|||||
234 | * @param $tableName |
||||
0 ignored issues
–
show
|
|||||
235 | * |
||||
236 | * @return boolean|mixed |
||||
237 | */ |
||||
238 | public function getTableWhere($tableName) |
||||
0 ignored issues
–
show
|
|||||
239 | { |
||||
0 ignored issues
–
show
|
|||||
240 | if (!empty($this->tableWheres[$tableName])) { |
||||
0 ignored issues
–
show
|
|||||
241 | return $this->tableWheres[$tableName]; |
||||
242 | } elseif ($this->dumpSettings['where']) { |
||||
0 ignored issues
–
show
|
|||||
243 | return $this->dumpSettings['where']; |
||||
244 | } |
||||
245 | |||||
246 | return false; |
||||
0 ignored issues
–
show
|
|||||
247 | } |
||||
0 ignored issues
–
show
|
|||||
248 | |||||
249 | /** |
||||
250 | * Keyed by table name, with the value as the numeric limit: |
||||
251 | * e.g. 'users' => 3000 |
||||
252 | * |
||||
253 | * @param array $tableLimits |
||||
0 ignored issues
–
show
|
|||||
254 | */ |
||||
0 ignored issues
–
show
|
|||||
255 | public function setTableLimits(array $tableLimits) |
||||
256 | { |
||||
0 ignored issues
–
show
|
|||||
257 | $this->tableLimits = $tableLimits; |
||||
258 | } |
||||
0 ignored issues
–
show
|
|||||
259 | |||||
260 | /** |
||||
0 ignored issues
–
show
|
|||||
261 | * Returns the LIMIT for the table. Must be numeric to be returned. |
||||
262 | * @param $tableName |
||||
0 ignored issues
–
show
|
|||||
263 | * @return boolean |
||||
0 ignored issues
–
show
|
|||||
264 | */ |
||||
265 | public function getTableLimit($tableName) |
||||
0 ignored issues
–
show
|
|||||
266 | { |
||||
0 ignored issues
–
show
|
|||||
267 | if (!isset($this->tableLimits[$tableName])) { |
||||
0 ignored issues
–
show
|
|||||
268 | return false; |
||||
0 ignored issues
–
show
|
|||||
269 | } |
||||
270 | |||||
271 | $limit = $this->tableLimits[$tableName]; |
||||
272 | if (!is_numeric($limit)) { |
||||
0 ignored issues
–
show
|
|||||
273 | return false; |
||||
0 ignored issues
–
show
|
|||||
274 | } |
||||
275 | |||||
276 | return $limit; |
||||
277 | } |
||||
0 ignored issues
–
show
|
|||||
278 | |||||
279 | /** |
||||
280 | * Parse DSN string and extract dbname value |
||||
281 | * Several examples of a DSN string |
||||
282 | * mysql:host=localhost;dbname=testdb |
||||
283 | * mysql:host=localhost;port=3307;dbname=testdb |
||||
284 | * mysql:unix_socket=/tmp/mysql.sock;dbname=testdb |
||||
285 | * |
||||
286 | * @param string $dsn dsn string to parse |
||||
0 ignored issues
–
show
|
|||||
287 | * @return boolean |
||||
0 ignored issues
–
show
|
|||||
288 | */ |
||||
0 ignored issues
–
show
|
|||||
289 | private function parseDsn($dsn) |
||||
0 ignored issues
–
show
|
|||||
290 | { |
||||
0 ignored issues
–
show
|
|||||
291 | if (empty($dsn) || (false === ($pos = strpos($dsn, ":")))) { |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
: does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
292 | throw new Exception("Empty DSN string"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Empty DSN string does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
293 | } |
||||
294 | |||||
295 | $this->dsn = $dsn; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
296 | $this->dbType = strtolower(substr($dsn, 0, $pos)); // always returns a string |
||||
0 ignored issues
–
show
|
|||||
297 | |||||
298 | if (empty($this->dbType)) { |
||||
299 | throw new Exception("Missing database type from DSN string"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Missing database type from DSN string does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
300 | } |
||||
301 | |||||
302 | $dsn = substr($dsn, $pos + 1); |
||||
0 ignored issues
–
show
|
|||||
303 | |||||
304 | foreach (explode(";", $dsn) as $kvp) { |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
305 | $kvpArr = explode("=", $kvp); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 33 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
= does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
306 | $this->dsnArray[strtolower($kvpArr[0])] = $kvpArr[1]; |
||||
307 | } |
||||
308 | |||||
309 | if (empty($this->dsnArray['host']) && |
||||
310 | empty($this->dsnArray['unix_socket'])) { |
||||
0 ignored issues
–
show
|
|||||
311 | throw new Exception("Missing host from DSN string"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Missing host from DSN string does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
312 | } |
||||
0 ignored issues
–
show
|
|||||
313 | $this->host = (!empty($this->dsnArray['host'])) ? |
||||
0 ignored issues
–
show
|
|||||
314 | $this->dsnArray['host'] : $this->dsnArray['unix_socket']; |
||||
315 | |||||
316 | if (empty($this->dsnArray['dbname'])) { |
||||
317 | throw new Exception("Missing database name from DSN string"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Missing database name from DSN string does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
318 | } |
||||
319 | |||||
320 | $this->dbName = $this->dsnArray['dbname']; |
||||
321 | |||||
322 | return true; |
||||
0 ignored issues
–
show
|
|||||
323 | } |
||||
0 ignored issues
–
show
|
|||||
324 | |||||
325 | /** |
||||
326 | * Connect with PDO. |
||||
327 | * |
||||
328 | * @return null |
||||
0 ignored issues
–
show
|
|||||
329 | */ |
||||
0 ignored issues
–
show
|
|||||
330 | private function connect() |
||||
0 ignored issues
–
show
|
|||||
331 | { |
||||
0 ignored issues
–
show
|
|||||
332 | // Connecting with PDO. |
||||
333 | try { |
||||
334 | switch ($this->dbType) { |
||||
335 | case 'sqlite': |
||||
0 ignored issues
–
show
|
|||||
336 | $this->dbHandler = @new PDO("sqlite:".$this->dbName, null, null, $this->pdoSettings); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
sqlite: does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
337 | break; |
||||
0 ignored issues
–
show
|
|||||
338 | case 'mysql': |
||||
0 ignored issues
–
show
|
|||||
339 | case 'pgsql': |
||||
0 ignored issues
–
show
|
|||||
340 | case 'dblib': |
||||
0 ignored issues
–
show
|
|||||
341 | $this->dbHandler = @new PDO( |
||||
0 ignored issues
–
show
|
|||||
342 | $this->dsn, |
||||
343 | $this->user, |
||||
344 | $this->pass, |
||||
345 | $this->pdoSettings |
||||
346 | ); |
||||
347 | // Execute init commands once connected |
||||
0 ignored issues
–
show
|
|||||
348 | foreach ($this->dumpSettings['init_commands'] as $stmt) { |
||||
0 ignored issues
–
show
|
|||||
349 | $this->dbHandler->exec($stmt); |
||||
350 | } |
||||
0 ignored issues
–
show
|
|||||
351 | // Store server version |
||||
0 ignored issues
–
show
|
|||||
352 | $this->version = $this->dbHandler->getAttribute(PDO::ATTR_SERVER_VERSION); |
||||
353 | break; |
||||
0 ignored issues
–
show
|
|||||
354 | default: |
||||
0 ignored issues
–
show
|
|||||
355 | throw new Exception("Unsupported database type (".$this->dbType.")"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Unsupported database type ( does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
) does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Are you sure
$this->dbType of type mixed can be used in concatenation ?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
356 | } |
||||
0 ignored issues
–
show
|
|||||
357 | } catch (PDOException $e) { |
||||
358 | throw new Exception( |
||||
359 | "Connection to ".$this->dbType." failed with message: ". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Connection to does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
failed with message: does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
360 | $e->getMessage() |
||||
361 | ); |
||||
362 | } |
||||
0 ignored issues
–
show
|
|||||
363 | |||||
364 | if (is_null($this->dbHandler)) { |
||||
365 | throw new Exception("Connection to ".$this->dbType."failed"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Connection to does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
failed does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
366 | } |
||||
367 | |||||
368 | $this->dbHandler->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_NATURAL); |
||||
369 | $this->typeAdapter = TypeAdapterFactory::create($this->dbType, $this->dbHandler, $this->dumpSettings); |
||||
0 ignored issues
–
show
|
|||||
370 | } |
||||
0 ignored issues
–
show
|
|||||
371 | |||||
372 | /** |
||||
373 | * Primary function, triggers dumping. |
||||
374 | * |
||||
375 | * @param string $filename Name of file to write sql dump to |
||||
0 ignored issues
–
show
|
|||||
376 | * @return null |
||||
0 ignored issues
–
show
|
|||||
377 | * @throws \Exception |
||||
0 ignored issues
–
show
|
|||||
378 | */ |
||||
0 ignored issues
–
show
|
|||||
379 | public function start($filename = '') |
||||
380 | { |
||||
0 ignored issues
–
show
|
|||||
381 | // Output file can be redefined here |
||||
0 ignored issues
–
show
|
|||||
382 | if (!empty($filename)) { |
||||
0 ignored issues
–
show
|
|||||
383 | $this->fileName = $filename; |
||||
384 | } |
||||
385 | |||||
386 | // Connect to database |
||||
0 ignored issues
–
show
|
|||||
387 | $this->connect(); |
||||
388 | |||||
389 | // Create output file |
||||
0 ignored issues
–
show
|
|||||
390 | $this->compressManager->open($this->fileName); |
||||
391 | |||||
392 | // Write some basic info to output file |
||||
0 ignored issues
–
show
|
|||||
393 | $this->compressManager->write($this->getDumpFileHeader()); |
||||
394 | |||||
395 | // Store server settings and use sanner defaults to dump |
||||
0 ignored issues
–
show
|
|||||
396 | $this->compressManager->write( |
||||
397 | $this->typeAdapter->backup_parameters() |
||||
398 | ); |
||||
399 | |||||
400 | if ($this->dumpSettings['databases']) { |
||||
401 | $this->compressManager->write( |
||||
402 | $this->typeAdapter->getDatabaseHeader($this->dbName) |
||||
403 | ); |
||||
404 | if ($this->dumpSettings['add-drop-database']) { |
||||
405 | $this->compressManager->write( |
||||
406 | $this->typeAdapter->add_drop_database($this->dbName) |
||||
407 | ); |
||||
408 | } |
||||
409 | } |
||||
410 | |||||
411 | // Get table, view, trigger, procedures, functions and events structures from |
||||
412 | // database. |
||||
413 | $this->getDatabaseStructureTables(); |
||||
414 | $this->getDatabaseStructureViews(); |
||||
415 | $this->getDatabaseStructureTriggers(); |
||||
416 | $this->getDatabaseStructureProcedures(); |
||||
417 | $this->getDatabaseStructureFunctions(); |
||||
418 | $this->getDatabaseStructureEvents(); |
||||
419 | |||||
420 | if ($this->dumpSettings['databases']) { |
||||
421 | $this->compressManager->write( |
||||
422 | $this->typeAdapter->databases($this->dbName) |
||||
423 | ); |
||||
424 | } |
||||
425 | |||||
426 | // If there still are some tables/views in include-tables array, |
||||
427 | // that means that some tables or views weren't found. |
||||
428 | // Give proper error and exit. |
||||
429 | // This check will be removed once include-tables supports regexps. |
||||
430 | if (0 < count($this->dumpSettings['include-tables'])) { |
||||
431 | $name = implode(",", $this->dumpSettings['include-tables']); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
, does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
432 | throw new Exception("Table (".$name.") not found in database"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Table ( does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
) not found in database does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
433 | } |
||||
434 | |||||
435 | $this->exportTables(); |
||||
436 | $this->exportTriggers(); |
||||
437 | $this->exportFunctions(); |
||||
438 | $this->exportProcedures(); |
||||
439 | $this->exportViews(); |
||||
440 | $this->exportEvents(); |
||||
441 | |||||
442 | // Restore saved parameters. |
||||
443 | $this->compressManager->write( |
||||
444 | $this->typeAdapter->restore_parameters() |
||||
445 | ); |
||||
446 | // Write some stats to output file. |
||||
447 | $this->compressManager->write($this->getDumpFileFooter()); |
||||
448 | // Close output file. |
||||
449 | $this->compressManager->close(); |
||||
450 | |||||
451 | return; |
||||
0 ignored issues
–
show
|
|||||
452 | } |
||||
0 ignored issues
–
show
|
|||||
453 | |||||
454 | /** |
||||
455 | * Returns header for dump file. |
||||
456 | * |
||||
457 | * @return string |
||||
458 | */ |
||||
459 | private function getDumpFileHeader() |
||||
0 ignored issues
–
show
|
|||||
460 | { |
||||
0 ignored issues
–
show
|
|||||
461 | $header = ''; |
||||
462 | if (!$this->dumpSettings['skip-comments']) { |
||||
0 ignored issues
–
show
|
|||||
463 | // Some info about software, source and time |
||||
0 ignored issues
–
show
|
|||||
464 | $header = "-- mysqldump-php https://github.com/ifsnop/mysqldump-php".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- mysqldump-php https:/...om/ifsnop/mysqldump-php does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
465 | "--".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
466 | "-- Host: {$this->host}\tDatabase: {$this->dbName}".PHP_EOL. |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $this instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
467 | "-- ------------------------------------------------------".PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- ---------------------...----------------------- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
468 | |||||
469 | if (!empty($this->version)) { |
||||
0 ignored issues
–
show
|
|||||
470 | $header .= "-- Server version \t".$this->version.PHP_EOL; |
||||
471 | } |
||||
472 | |||||
473 | if (!$this->dumpSettings['skip-dump-date']) { |
||||
0 ignored issues
–
show
|
|||||
474 | $header .= "-- Date: ".date('r').PHP_EOL.PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- Date: does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
475 | } |
||||
476 | } |
||||
0 ignored issues
–
show
|
|||||
477 | return $header; |
||||
478 | } |
||||
0 ignored issues
–
show
|
|||||
479 | |||||
480 | /** |
||||
481 | * Returns footer for dump file. |
||||
482 | * |
||||
483 | * @return string |
||||
484 | */ |
||||
485 | private function getDumpFileFooter() |
||||
0 ignored issues
–
show
|
|||||
486 | { |
||||
0 ignored issues
–
show
|
|||||
487 | $footer = ''; |
||||
488 | if (!$this->dumpSettings['skip-comments']) { |
||||
0 ignored issues
–
show
|
|||||
489 | $footer .= '-- Dump completed'; |
||||
490 | if (!$this->dumpSettings['skip-dump-date']) { |
||||
0 ignored issues
–
show
|
|||||
491 | $footer .= ' on: '.date('r'); |
||||
492 | } |
||||
0 ignored issues
–
show
|
|||||
493 | $footer .= PHP_EOL; |
||||
494 | } |
||||
495 | |||||
496 | return $footer; |
||||
497 | } |
||||
0 ignored issues
–
show
|
|||||
498 | |||||
499 | /** |
||||
500 | * Reads table names from database. |
||||
501 | * Fills $this->tables array so they will be dumped later. |
||||
502 | * |
||||
503 | * @return null |
||||
504 | */ |
||||
505 | private function getDatabaseStructureTables() |
||||
0 ignored issues
–
show
|
|||||
506 | { |
||||
0 ignored issues
–
show
|
|||||
507 | // Listing all tables from database |
||||
0 ignored issues
–
show
|
|||||
508 | if (empty($this->dumpSettings['include-tables'])) { |
||||
509 | // include all tables for now, blacklisting happens later |
||||
0 ignored issues
–
show
|
|||||
510 | foreach ($this->dbHandler->query($this->typeAdapter->show_tables($this->dbName)) as $row) { |
||||
0 ignored issues
–
show
|
|||||
511 | array_push($this->tables, current($row)); |
||||
512 | } |
||||
513 | } else { |
||||
514 | // include only the tables mentioned in include-tables |
||||
0 ignored issues
–
show
|
|||||
515 | foreach ($this->dbHandler->query($this->typeAdapter->show_tables($this->dbName)) as $row) { |
||||
0 ignored issues
–
show
|
|||||
516 | if (in_array(current($row), $this->dumpSettings['include-tables'], true)) { |
||||
0 ignored issues
–
show
|
|||||
517 | array_push($this->tables, current($row)); |
||||
518 | $elem = array_search( |
||||
519 | current($row), |
||||
520 | $this->dumpSettings['include-tables'] |
||||
521 | ); |
||||
522 | unset($this->dumpSettings['include-tables'][$elem]); |
||||
523 | } |
||||
524 | } |
||||
525 | } |
||||
0 ignored issues
–
show
|
|||||
526 | return; |
||||
0 ignored issues
–
show
|
|||||
527 | } |
||||
0 ignored issues
–
show
|
|||||
528 | |||||
529 | /** |
||||
530 | * Reads view names from database. |
||||
531 | * Fills $this->tables array so they will be dumped later. |
||||
532 | * |
||||
533 | * @return null |
||||
534 | */ |
||||
535 | private function getDatabaseStructureViews() |
||||
0 ignored issues
–
show
|
|||||
536 | { |
||||
0 ignored issues
–
show
|
|||||
537 | // Listing all views from database |
||||
0 ignored issues
–
show
|
|||||
538 | if (empty($this->dumpSettings['include-views'])) { |
||||
539 | // include all views for now, blacklisting happens later |
||||
0 ignored issues
–
show
|
|||||
540 | foreach ($this->dbHandler->query($this->typeAdapter->show_views($this->dbName)) as $row) { |
||||
0 ignored issues
–
show
|
|||||
541 | array_push($this->views, current($row)); |
||||
542 | } |
||||
543 | } else { |
||||
544 | // include only the tables mentioned in include-tables |
||||
0 ignored issues
–
show
|
|||||
545 | foreach ($this->dbHandler->query($this->typeAdapter->show_views($this->dbName)) as $row) { |
||||
0 ignored issues
–
show
|
|||||
546 | if (in_array(current($row), $this->dumpSettings['include-views'], true)) { |
||||
0 ignored issues
–
show
|
|||||
547 | array_push($this->views, current($row)); |
||||
548 | $elem = array_search( |
||||
549 | current($row), |
||||
550 | $this->dumpSettings['include-views'] |
||||
551 | ); |
||||
552 | unset($this->dumpSettings['include-views'][$elem]); |
||||
553 | } |
||||
554 | } |
||||
555 | } |
||||
0 ignored issues
–
show
|
|||||
556 | return; |
||||
0 ignored issues
–
show
|
|||||
557 | } |
||||
0 ignored issues
–
show
|
|||||
558 | |||||
559 | /** |
||||
560 | * Reads trigger names from database. |
||||
561 | * Fills $this->tables array so they will be dumped later. |
||||
562 | * |
||||
563 | * @return null |
||||
564 | */ |
||||
565 | private function getDatabaseStructureTriggers() |
||||
0 ignored issues
–
show
|
|||||
566 | { |
||||
0 ignored issues
–
show
|
|||||
567 | // Listing all triggers from database |
||||
0 ignored issues
–
show
|
|||||
568 | if (false === $this->dumpSettings['skip-triggers']) { |
||||
0 ignored issues
–
show
|
|||||
569 | foreach ($this->dbHandler->query($this->typeAdapter->show_triggers($this->dbName)) as $row) { |
||||
0 ignored issues
–
show
|
|||||
570 | array_push($this->triggers, $row['Trigger']); |
||||
571 | } |
||||
572 | } |
||||
0 ignored issues
–
show
|
|||||
573 | return; |
||||
0 ignored issues
–
show
|
|||||
574 | } |
||||
0 ignored issues
–
show
|
|||||
575 | |||||
576 | /** |
||||
577 | * Reads procedure names from database. |
||||
578 | * Fills $this->tables array so they will be dumped later. |
||||
579 | * |
||||
580 | * @return null |
||||
581 | */ |
||||
582 | private function getDatabaseStructureProcedures() |
||||
0 ignored issues
–
show
|
|||||
583 | { |
||||
0 ignored issues
–
show
|
|||||
584 | // Listing all procedures from database |
||||
0 ignored issues
–
show
|
|||||
585 | if ($this->dumpSettings['routines']) { |
||||
586 | foreach ($this->dbHandler->query($this->typeAdapter->show_procedures($this->dbName)) as $row) { |
||||
0 ignored issues
–
show
|
|||||
587 | array_push($this->procedures, $row['procedure_name']); |
||||
588 | } |
||||
589 | } |
||||
0 ignored issues
–
show
|
|||||
590 | return; |
||||
0 ignored issues
–
show
|
|||||
591 | } |
||||
0 ignored issues
–
show
|
|||||
592 | |||||
593 | /** |
||||
594 | * Reads functions names from database. |
||||
595 | * Fills $this->tables array so they will be dumped later. |
||||
596 | * |
||||
597 | * @return null |
||||
598 | */ |
||||
599 | private function getDatabaseStructureFunctions() |
||||
0 ignored issues
–
show
|
|||||
600 | { |
||||
0 ignored issues
–
show
|
|||||
601 | // Listing all functions from database |
||||
0 ignored issues
–
show
|
|||||
602 | if ($this->dumpSettings['routines']) { |
||||
603 | foreach ($this->dbHandler->query($this->typeAdapter->show_functions($this->dbName)) as $row) { |
||||
0 ignored issues
–
show
|
|||||
604 | array_push($this->functions, $row['function_name']); |
||||
605 | } |
||||
606 | } |
||||
0 ignored issues
–
show
|
|||||
607 | return; |
||||
0 ignored issues
–
show
|
|||||
608 | } |
||||
0 ignored issues
–
show
|
|||||
609 | |||||
610 | /** |
||||
611 | * Reads event names from database. |
||||
612 | * Fills $this->tables array so they will be dumped later. |
||||
613 | * |
||||
614 | * @return null |
||||
615 | */ |
||||
616 | private function getDatabaseStructureEvents() |
||||
0 ignored issues
–
show
|
|||||
617 | { |
||||
0 ignored issues
–
show
|
|||||
618 | // Listing all events from database |
||||
0 ignored issues
–
show
|
|||||
619 | if ($this->dumpSettings['events']) { |
||||
620 | foreach ($this->dbHandler->query($this->typeAdapter->show_events($this->dbName)) as $row) { |
||||
0 ignored issues
–
show
|
|||||
621 | array_push($this->events, $row['event_name']); |
||||
622 | } |
||||
623 | } |
||||
0 ignored issues
–
show
|
|||||
624 | return; |
||||
0 ignored issues
–
show
|
|||||
625 | } |
||||
0 ignored issues
–
show
|
|||||
626 | |||||
627 | /** |
||||
0 ignored issues
–
show
|
|||||
628 | * Compare if $table name matches with a definition inside $arr |
||||
629 | * @param $table string |
||||
0 ignored issues
–
show
|
|||||
630 | * @param $arr array with strings or patterns |
||||
0 ignored issues
–
show
|
|||||
631 | * @return boolean |
||||
0 ignored issues
–
show
|
|||||
632 | */ |
||||
633 | private function matches($table, $arr) |
||||
0 ignored issues
–
show
|
|||||
634 | { |
||||
0 ignored issues
–
show
|
|||||
635 | $match = false; |
||||
0 ignored issues
–
show
|
|||||
636 | |||||
637 | foreach ($arr as $pattern) { |
||||
638 | if ('/' != $pattern[0]) { |
||||
0 ignored issues
–
show
|
|||||
639 | continue; |
||||
640 | } |
||||
0 ignored issues
–
show
|
|||||
641 | if (1 == preg_match($pattern, $table)) { |
||||
0 ignored issues
–
show
|
|||||
642 | $match = true; |
||||
0 ignored issues
–
show
|
|||||
643 | } |
||||
644 | } |
||||
645 | |||||
646 | return in_array($table, $arr) || $match; |
||||
0 ignored issues
–
show
|
|||||
647 | } |
||||
0 ignored issues
–
show
|
|||||
648 | |||||
649 | /** |
||||
650 | * Exports all the tables selected from database |
||||
651 | * |
||||
652 | * @return null |
||||
0 ignored issues
–
show
|
|||||
653 | */ |
||||
654 | private function exportTables() |
||||
0 ignored issues
–
show
|
|||||
655 | { |
||||
0 ignored issues
–
show
|
|||||
656 | // Exporting tables one by one |
||||
0 ignored issues
–
show
|
|||||
657 | foreach ($this->tables as $table) { |
||||
658 | if ($this->matches($table, $this->dumpSettings['exclude-tables'])) { |
||||
659 | continue; |
||||
660 | } |
||||
0 ignored issues
–
show
|
|||||
661 | $this->getTableStructure($table); |
||||
662 | if (false === $this->dumpSettings['no-data']) { // don't break compatibility with old trigger |
||||
0 ignored issues
–
show
|
|||||
663 | $this->listValues($table); |
||||
664 | } elseif (true === $this->dumpSettings['no-data'] |
||||
0 ignored issues
–
show
|
|||||
665 | || $this->matches($table, $this->dumpSettings['no-data'])) { |
||||
0 ignored issues
–
show
|
|||||
666 | continue; |
||||
667 | } else { |
||||
668 | $this->listValues($table); |
||||
669 | } |
||||
670 | } |
||||
671 | } |
||||
0 ignored issues
–
show
|
|||||
672 | |||||
673 | /** |
||||
674 | * Exports all the views found in database |
||||
675 | * |
||||
676 | * @return null |
||||
0 ignored issues
–
show
|
|||||
677 | */ |
||||
678 | private function exportViews() |
||||
0 ignored issues
–
show
|
|||||
679 | { |
||||
0 ignored issues
–
show
|
|||||
680 | if (false === $this->dumpSettings['no-create-info']) { |
||||
0 ignored issues
–
show
|
|||||
681 | // Exporting views one by one |
||||
0 ignored issues
–
show
|
|||||
682 | foreach ($this->views as $view) { |
||||
683 | if ($this->matches($view, $this->dumpSettings['exclude-tables'])) { |
||||
684 | continue; |
||||
685 | } |
||||
0 ignored issues
–
show
|
|||||
686 | $this->tableColumnTypes[$view] = $this->getTableColumnTypes($view); |
||||
687 | $this->getViewStructureTable($view); |
||||
688 | } |
||||
0 ignored issues
–
show
|
|||||
689 | foreach ($this->views as $view) { |
||||
690 | if ($this->matches($view, $this->dumpSettings['exclude-tables'])) { |
||||
691 | continue; |
||||
692 | } |
||||
0 ignored issues
–
show
|
|||||
693 | $this->getViewStructureView($view); |
||||
694 | } |
||||
695 | } |
||||
696 | } |
||||
0 ignored issues
–
show
|
|||||
697 | |||||
698 | /** |
||||
699 | * Exports all the triggers found in database |
||||
700 | * |
||||
701 | * @return null |
||||
0 ignored issues
–
show
|
|||||
702 | */ |
||||
703 | private function exportTriggers() |
||||
0 ignored issues
–
show
|
|||||
704 | { |
||||
0 ignored issues
–
show
|
|||||
705 | // Exporting triggers one by one |
||||
0 ignored issues
–
show
|
|||||
706 | foreach ($this->triggers as $trigger) { |
||||
707 | $this->getTriggerStructure($trigger); |
||||
708 | } |
||||
709 | |||||
710 | } |
||||
0 ignored issues
–
show
|
|||||
711 | |||||
712 | /** |
||||
713 | * Exports all the procedures found in database |
||||
714 | * |
||||
715 | * @return null |
||||
0 ignored issues
–
show
|
|||||
716 | */ |
||||
717 | private function exportProcedures() |
||||
0 ignored issues
–
show
|
|||||
718 | { |
||||
0 ignored issues
–
show
|
|||||
719 | // Exporting triggers one by one |
||||
0 ignored issues
–
show
|
|||||
720 | foreach ($this->procedures as $procedure) { |
||||
721 | $this->getProcedureStructure($procedure); |
||||
722 | } |
||||
723 | } |
||||
0 ignored issues
–
show
|
|||||
724 | |||||
725 | /** |
||||
726 | * Exports all the functions found in database |
||||
727 | * |
||||
728 | * @return null |
||||
0 ignored issues
–
show
|
|||||
729 | */ |
||||
730 | private function exportFunctions() |
||||
0 ignored issues
–
show
|
|||||
731 | { |
||||
0 ignored issues
–
show
|
|||||
732 | // Exporting triggers one by one |
||||
0 ignored issues
–
show
|
|||||
733 | foreach ($this->functions as $function) { |
||||
734 | $this->getFunctionStructure($function); |
||||
735 | } |
||||
736 | } |
||||
0 ignored issues
–
show
|
|||||
737 | |||||
738 | /** |
||||
739 | * Exports all the events found in database |
||||
740 | * |
||||
741 | * @return null |
||||
0 ignored issues
–
show
|
|||||
742 | */ |
||||
743 | private function exportEvents() |
||||
0 ignored issues
–
show
|
|||||
744 | { |
||||
0 ignored issues
–
show
|
|||||
745 | // Exporting triggers one by one |
||||
0 ignored issues
–
show
|
|||||
746 | foreach ($this->events as $event) { |
||||
747 | $this->getEventStructure($event); |
||||
748 | } |
||||
749 | } |
||||
0 ignored issues
–
show
|
|||||
750 | |||||
751 | /** |
||||
752 | * Table structure extractor |
||||
753 | * |
||||
754 | * @todo move specific mysql code to typeAdapter |
||||
0 ignored issues
–
show
Comment refers to a TODO task
This check looks ``TODO``s show that something is left unfinished and should be attended to.
Loading history...
|
|||||
755 | * @param string $tableName Name of table to export |
||||
0 ignored issues
–
show
|
|||||
756 | * @return null |
||||
0 ignored issues
–
show
|
|||||
757 | */ |
||||
758 | private function getTableStructure($tableName) |
||||
0 ignored issues
–
show
|
|||||
759 | { |
||||
0 ignored issues
–
show
|
|||||
760 | if (!$this->dumpSettings['no-create-info']) { |
||||
0 ignored issues
–
show
|
|||||
761 | $ret = ''; |
||||
762 | if (!$this->dumpSettings['skip-comments']) { |
||||
0 ignored issues
–
show
|
|||||
763 | $ret = "--".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
764 | "-- Table structure for table `$tableName`".PHP_EOL. |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $tableName instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
765 | "--".PHP_EOL.PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
766 | } |
||||
0 ignored issues
–
show
|
|||||
767 | $stmt = $this->typeAdapter->show_create_table($tableName); |
||||
768 | foreach ($this->dbHandler->query($stmt) as $r) { |
||||
769 | $this->compressManager->write($ret); |
||||
770 | if ($this->dumpSettings['add-drop-table']) { |
||||
771 | $this->compressManager->write( |
||||
772 | $this->typeAdapter->drop_table($tableName) |
||||
773 | ); |
||||
774 | } |
||||
0 ignored issues
–
show
|
|||||
775 | $this->compressManager->write( |
||||
776 | $this->typeAdapter->create_table($r) |
||||
777 | ); |
||||
778 | break; |
||||
779 | } |
||||
780 | } |
||||
0 ignored issues
–
show
|
|||||
781 | $this->tableColumnTypes[$tableName] = $this->getTableColumnTypes($tableName); |
||||
782 | return; |
||||
0 ignored issues
–
show
|
|||||
783 | } |
||||
0 ignored issues
–
show
|
|||||
784 | |||||
785 | /** |
||||
786 | * Store column types to create data dumps and for Stand-In tables |
||||
787 | * |
||||
788 | * @param string $tableName Name of table to export |
||||
0 ignored issues
–
show
|
|||||
789 | * @return array type column types detailed |
||||
0 ignored issues
–
show
|
|||||
790 | */ |
||||
0 ignored issues
–
show
|
|||||
791 | |||||
792 | private function getTableColumnTypes($tableName) |
||||
0 ignored issues
–
show
|
|||||
793 | { |
||||
0 ignored issues
–
show
|
|||||
794 | $columnTypes = array(); |
||||
0 ignored issues
–
show
|
|||||
795 | $columns = $this->dbHandler->query( |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
796 | $this->typeAdapter->show_columns($tableName) |
||||
797 | ); |
||||
798 | $columns->setFetchMode(PDO::FETCH_ASSOC); |
||||
799 | |||||
800 | foreach ($columns as $key => $col) { |
||||
801 | $types = $this->typeAdapter->parseColumnType($col); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 22 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
802 | $columnTypes[$col['Field']] = array( |
||||
0 ignored issues
–
show
|
|||||
803 | 'is_numeric'=> $types['is_numeric'], |
||||
0 ignored issues
–
show
|
|||||
804 | 'is_blob' => $types['is_blob'], |
||||
0 ignored issues
–
show
|
|||||
805 | 'type' => $types['type'], |
||||
0 ignored issues
–
show
|
|||||
806 | 'type_sql' => $col['Type'], |
||||
0 ignored issues
–
show
|
|||||
807 | 'is_virtual' => $types['is_virtual'] |
||||
0 ignored issues
–
show
|
|||||
808 | ); |
||||
0 ignored issues
–
show
|
|||||
809 | } |
||||
810 | |||||
811 | return $columnTypes; |
||||
812 | } |
||||
0 ignored issues
–
show
|
|||||
813 | |||||
814 | /** |
||||
815 | * View structure extractor, create table (avoids cyclic references) |
||||
816 | * |
||||
817 | * @todo move mysql specific code to typeAdapter |
||||
0 ignored issues
–
show
Comment refers to a TODO task
This check looks ``TODO``s show that something is left unfinished and should be attended to.
Loading history...
|
|||||
818 | * @param string $viewName Name of view to export |
||||
0 ignored issues
–
show
|
|||||
819 | * @return null |
||||
0 ignored issues
–
show
|
|||||
820 | */ |
||||
821 | private function getViewStructureTable($viewName) |
||||
0 ignored issues
–
show
|
|||||
822 | { |
||||
0 ignored issues
–
show
|
|||||
823 | if (!$this->dumpSettings['skip-comments']) { |
||||
0 ignored issues
–
show
|
|||||
824 | $ret = "--".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
825 | "-- Stand-In structure for view `${viewName}`".PHP_EOL. |
||||
0 ignored issues
–
show
|
|||||
826 | "--".PHP_EOL.PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
827 | $this->compressManager->write($ret); |
||||
828 | } |
||||
0 ignored issues
–
show
|
|||||
829 | $stmt = $this->typeAdapter->show_create_view($viewName); |
||||
830 | |||||
831 | // create views as tables, to resolve dependencies |
||||
0 ignored issues
–
show
|
|||||
832 | foreach ($this->dbHandler->query($stmt) as $r) { |
||||
833 | if ($this->dumpSettings['add-drop-table']) { |
||||
834 | $this->compressManager->write( |
||||
835 | $this->typeAdapter->drop_view($viewName) |
||||
836 | ); |
||||
837 | } |
||||
838 | |||||
839 | $this->compressManager->write( |
||||
840 | $this->createStandInTable($viewName) |
||||
841 | ); |
||||
842 | break; |
||||
843 | } |
||||
844 | } |
||||
0 ignored issues
–
show
|
|||||
845 | |||||
846 | /** |
||||
847 | * Write a create table statement for the table Stand-In, show create |
||||
848 | * table would return a create algorithm when used on a view |
||||
849 | * |
||||
850 | * @param string $viewName Name of view to export |
||||
0 ignored issues
–
show
|
|||||
851 | * @return string create statement |
||||
0 ignored issues
–
show
|
|||||
852 | */ |
||||
853 | public function createStandInTable($viewName) |
||||
854 | { |
||||
0 ignored issues
–
show
|
|||||
855 | $ret = array(); |
||||
0 ignored issues
–
show
|
|||||
856 | foreach ($this->tableColumnTypes[$viewName] as $k => $v) { |
||||
857 | $ret[] = "`${k}` ${v['type_sql']}"; |
||||
858 | } |
||||
0 ignored issues
–
show
|
|||||
859 | $ret = implode(PHP_EOL.",", $ret); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
, does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
860 | |||||
861 | $ret = "CREATE TABLE IF NOT EXISTS `$viewName` (". |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $viewName instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
862 | PHP_EOL.$ret.PHP_EOL.");".PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
); does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
863 | |||||
864 | return $ret; |
||||
865 | } |
||||
0 ignored issues
–
show
|
|||||
866 | |||||
867 | /** |
||||
868 | * View structure extractor, create view |
||||
869 | * |
||||
870 | * @todo move mysql specific code to typeAdapter |
||||
0 ignored issues
–
show
Comment refers to a TODO task
This check looks ``TODO``s show that something is left unfinished and should be attended to.
Loading history...
|
|||||
871 | * @param string $viewName Name of view to export |
||||
0 ignored issues
–
show
|
|||||
872 | * @return null |
||||
0 ignored issues
–
show
|
|||||
873 | */ |
||||
874 | private function getViewStructureView($viewName) |
||||
0 ignored issues
–
show
|
|||||
875 | { |
||||
0 ignored issues
–
show
|
|||||
876 | if (!$this->dumpSettings['skip-comments']) { |
||||
0 ignored issues
–
show
|
|||||
877 | $ret = "--".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
878 | "-- View structure for view `${viewName}`".PHP_EOL. |
||||
0 ignored issues
–
show
|
|||||
879 | "--".PHP_EOL.PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
880 | $this->compressManager->write($ret); |
||||
881 | } |
||||
0 ignored issues
–
show
|
|||||
882 | $stmt = $this->typeAdapter->show_create_view($viewName); |
||||
883 | |||||
884 | // create views, to resolve dependencies |
||||
0 ignored issues
–
show
|
|||||
885 | // replacing tables with views |
||||
0 ignored issues
–
show
|
|||||
886 | foreach ($this->dbHandler->query($stmt) as $r) { |
||||
887 | // because we must replace table with view, we should delete it |
||||
0 ignored issues
–
show
|
|||||
888 | $this->compressManager->write( |
||||
889 | $this->typeAdapter->drop_view($viewName) |
||||
890 | ); |
||||
891 | $this->compressManager->write( |
||||
892 | $this->typeAdapter->create_view($r) |
||||
893 | ); |
||||
894 | break; |
||||
895 | } |
||||
896 | } |
||||
0 ignored issues
–
show
|
|||||
897 | |||||
898 | /** |
||||
899 | * Trigger structure extractor |
||||
900 | * |
||||
901 | * @param string $triggerName Name of trigger to export |
||||
0 ignored issues
–
show
|
|||||
902 | * @return null |
||||
0 ignored issues
–
show
|
|||||
903 | */ |
||||
904 | private function getTriggerStructure($triggerName) |
||||
0 ignored issues
–
show
|
|||||
905 | { |
||||
0 ignored issues
–
show
|
|||||
906 | $stmt = $this->typeAdapter->show_create_trigger($triggerName); |
||||
907 | foreach ($this->dbHandler->query($stmt) as $r) { |
||||
908 | if ($this->dumpSettings['add-drop-trigger']) { |
||||
909 | $this->compressManager->write( |
||||
910 | $this->typeAdapter->add_drop_trigger($triggerName) |
||||
911 | ); |
||||
912 | } |
||||
0 ignored issues
–
show
|
|||||
913 | $this->compressManager->write( |
||||
914 | $this->typeAdapter->create_trigger($r) |
||||
915 | ); |
||||
916 | return; |
||||
0 ignored issues
–
show
|
|||||
917 | } |
||||
918 | } |
||||
0 ignored issues
–
show
|
|||||
919 | |||||
920 | /** |
||||
921 | * Procedure structure extractor |
||||
922 | * |
||||
923 | * @param string $procedureName Name of procedure to export |
||||
0 ignored issues
–
show
|
|||||
924 | * @return null |
||||
0 ignored issues
–
show
|
|||||
925 | */ |
||||
926 | private function getProcedureStructure($procedureName) |
||||
0 ignored issues
–
show
|
|||||
927 | { |
||||
0 ignored issues
–
show
|
|||||
928 | if (!$this->dumpSettings['skip-comments']) { |
||||
0 ignored issues
–
show
|
|||||
929 | $ret = "--".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
930 | "-- Dumping routines for database '".$this->dbName."'".PHP_EOL. |
||||
0 ignored issues
–
show
|
|||||
931 | "--".PHP_EOL.PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
932 | $this->compressManager->write($ret); |
||||
933 | } |
||||
0 ignored issues
–
show
|
|||||
934 | $stmt = $this->typeAdapter->show_create_procedure($procedureName); |
||||
935 | foreach ($this->dbHandler->query($stmt) as $r) { |
||||
936 | $this->compressManager->write( |
||||
937 | $this->typeAdapter->create_procedure($r) |
||||
938 | ); |
||||
939 | return; |
||||
0 ignored issues
–
show
|
|||||
940 | } |
||||
941 | } |
||||
0 ignored issues
–
show
|
|||||
942 | |||||
943 | /** |
||||
944 | * Function structure extractor |
||||
945 | * |
||||
946 | * @param string $functionName Name of function to export |
||||
0 ignored issues
–
show
|
|||||
947 | * @return null |
||||
0 ignored issues
–
show
|
|||||
948 | */ |
||||
949 | private function getFunctionStructure($functionName) |
||||
0 ignored issues
–
show
|
|||||
950 | { |
||||
0 ignored issues
–
show
|
|||||
951 | if (!$this->dumpSettings['skip-comments']) { |
||||
0 ignored issues
–
show
|
|||||
952 | $ret = "--".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
953 | "-- Dumping routines for database '".$this->dbName."'".PHP_EOL. |
||||
0 ignored issues
–
show
|
|||||
954 | "--".PHP_EOL.PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
955 | $this->compressManager->write($ret); |
||||
956 | } |
||||
0 ignored issues
–
show
|
|||||
957 | $stmt = $this->typeAdapter->show_create_function($functionName); |
||||
958 | foreach ($this->dbHandler->query($stmt) as $r) { |
||||
959 | $this->compressManager->write( |
||||
960 | $this->typeAdapter->create_function($r) |
||||
961 | ); |
||||
962 | return; |
||||
0 ignored issues
–
show
|
|||||
963 | } |
||||
964 | } |
||||
0 ignored issues
–
show
|
|||||
965 | |||||
966 | /** |
||||
967 | * Event structure extractor |
||||
968 | * |
||||
969 | * @param string $eventName Name of event to export |
||||
0 ignored issues
–
show
|
|||||
970 | * @return null |
||||
0 ignored issues
–
show
|
|||||
971 | */ |
||||
972 | private function getEventStructure($eventName) |
||||
0 ignored issues
–
show
|
|||||
973 | { |
||||
0 ignored issues
–
show
|
|||||
974 | if (!$this->dumpSettings['skip-comments']) { |
||||
0 ignored issues
–
show
|
|||||
975 | $ret = "--".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
976 | "-- Dumping events for database '".$this->dbName."'".PHP_EOL. |
||||
0 ignored issues
–
show
|
|||||
977 | "--".PHP_EOL.PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
978 | $this->compressManager->write($ret); |
||||
979 | } |
||||
0 ignored issues
–
show
|
|||||
980 | $stmt = $this->typeAdapter->show_create_event($eventName); |
||||
981 | foreach ($this->dbHandler->query($stmt) as $r) { |
||||
982 | $this->compressManager->write( |
||||
983 | $this->typeAdapter->create_event($r) |
||||
984 | ); |
||||
985 | return; |
||||
0 ignored issues
–
show
|
|||||
986 | } |
||||
987 | } |
||||
0 ignored issues
–
show
|
|||||
988 | |||||
989 | /** |
||||
990 | * Prepare values for output |
||||
991 | * |
||||
992 | * @param string $tableName Name of table which contains rows |
||||
0 ignored issues
–
show
|
|||||
993 | * @param array $row Associative array of column names and values to be |
||||
0 ignored issues
–
show
|
|||||
994 | * quoted |
||||
0 ignored issues
–
show
|
|||||
995 | * |
||||
996 | * @return array |
||||
997 | */ |
||||
998 | private function prepareColumnValues($tableName, array $row) |
||||
0 ignored issues
–
show
|
|||||
999 | { |
||||
0 ignored issues
–
show
|
|||||
1000 | $ret = array(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 9 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
1001 | $columnTypes = $this->tableColumnTypes[$tableName]; |
||||
1002 | |||||
1003 | if ($this->transformTableRowCallable) { |
||||
1004 | $row = call_user_func($this->transformTableRowCallable, $tableName, $row); |
||||
1005 | } |
||||
1006 | |||||
1007 | foreach ($row as $colName => $colValue) { |
||||
1008 | if ($this->transformColumnValueCallable) { |
||||
1009 | $colValue = call_user_func($this->transformColumnValueCallable, $tableName, $colName, $colValue, $row); |
||||
0 ignored issues
–
show
|
|||||
1010 | } |
||||
1011 | |||||
1012 | $ret[] = $this->escape($colValue, $columnTypes[$colName]); |
||||
1013 | } |
||||
1014 | |||||
1015 | return $ret; |
||||
1016 | } |
||||
0 ignored issues
–
show
|
|||||
1017 | |||||
1018 | /** |
||||
0 ignored issues
–
show
|
|||||
1019 | * Escape values with quotes when needed |
||||
1020 | * |
||||
1021 | * @param string $tableName Name of table which contains rows |
||||
0 ignored issues
–
show
|
|||||
1022 | * @param array $row Associative array of column names and values to be quoted |
||||
0 ignored issues
–
show
|
|||||
1023 | * |
||||
1024 | * @return string |
||||
1025 | */ |
||||
1026 | private function escape($colValue, $colType) |
||||
0 ignored issues
–
show
|
|||||
1027 | { |
||||
0 ignored issues
–
show
|
|||||
1028 | if (is_null($colValue)) { |
||||
1029 | return "NULL"; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
NULL does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1030 | } elseif ($this->dumpSettings['hex-blob'] && $colType['is_blob']) { |
||||
0 ignored issues
–
show
|
|||||
1031 | if ($colType['type'] == 'bit' || !empty($colValue)) { |
||||
0 ignored issues
–
show
|
|||||
1032 | return "0x${colValue}"; |
||||
1033 | } else { |
||||
1034 | return "''"; |
||||
1035 | } |
||||
1036 | } elseif ($colType['is_numeric']) { |
||||
0 ignored issues
–
show
|
|||||
1037 | return $colValue; |
||||
1038 | } |
||||
1039 | |||||
1040 | return $this->dbHandler->quote($colValue); |
||||
1041 | } |
||||
0 ignored issues
–
show
|
|||||
1042 | |||||
1043 | /** |
||||
1044 | * Set a callable that will be used to transform table rows |
||||
1045 | * |
||||
1046 | * @param callable $callable |
||||
0 ignored issues
–
show
|
|||||
1047 | * |
||||
1048 | * @return void |
||||
1049 | */ |
||||
1050 | public function setTransformTableRowHook($callable) |
||||
0 ignored issues
–
show
|
|||||
1051 | { |
||||
0 ignored issues
–
show
|
|||||
1052 | $this->transformTableRowCallable = $callable; |
||||
1053 | } |
||||
0 ignored issues
–
show
|
|||||
1054 | |||||
1055 | /** |
||||
1056 | * Set a callable that will be used to transform column values |
||||
1057 | * |
||||
1058 | * @param callable $callable |
||||
0 ignored issues
–
show
|
|||||
1059 | * |
||||
1060 | * @return void |
||||
1061 | * |
||||
1062 | * @deprecated Use setTransformTableRowHook instead for better performance |
||||
1063 | */ |
||||
1064 | public function setTransformColumnValueHook($callable) |
||||
0 ignored issues
–
show
|
|||||
1065 | { |
||||
0 ignored issues
–
show
|
|||||
1066 | $this->transformColumnValueCallable = $callable; |
||||
1067 | } |
||||
0 ignored issues
–
show
|
|||||
1068 | |||||
1069 | /** |
||||
1070 | * Set a callable that will be used to report dump information |
||||
1071 | * |
||||
1072 | * @param callable $callable |
||||
0 ignored issues
–
show
|
|||||
1073 | * |
||||
1074 | * @return void |
||||
1075 | */ |
||||
1076 | public function setInfoHook($callable) |
||||
0 ignored issues
–
show
|
|||||
1077 | { |
||||
0 ignored issues
–
show
|
|||||
1078 | $this->infoCallable = $callable; |
||||
1079 | } |
||||
0 ignored issues
–
show
|
|||||
1080 | |||||
1081 | /** |
||||
1082 | * Table rows extractor |
||||
1083 | * |
||||
1084 | * @param string $tableName Name of table to export |
||||
0 ignored issues
–
show
|
|||||
1085 | * |
||||
1086 | * @return null |
||||
0 ignored issues
–
show
|
|||||
1087 | */ |
||||
1088 | private function listValues($tableName) |
||||
0 ignored issues
–
show
|
|||||
1089 | { |
||||
0 ignored issues
–
show
|
|||||
1090 | $this->prepareListValues($tableName); |
||||
1091 | |||||
1092 | $onlyOnce = true; |
||||
0 ignored issues
–
show
|
|||||
1093 | $lineSize = 0; |
||||
1094 | |||||
1095 | // colStmt is used to form a query to obtain row values |
||||
0 ignored issues
–
show
|
|||||
1096 | $colStmt = $this->getColumnStmt($tableName); |
||||
1097 | // colNames is used to get the name of the columns when using complete-insert |
||||
0 ignored issues
–
show
|
|||||
1098 | if ($this->dumpSettings['complete-insert']) { |
||||
1099 | $colNames = $this->getColumnNames($tableName); |
||||
1100 | } |
||||
1101 | |||||
1102 | $stmt = "SELECT ".implode(",", $colStmt)." FROM `$tableName`"; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
SELECT does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
, does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
As per coding-style, please use concatenation or
sprintf for the variable $tableName instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
1103 | |||||
1104 | // Table specific conditions override the default 'where' |
||||
0 ignored issues
–
show
|
|||||
1105 | $condition = $this->getTableWhere($tableName); |
||||
1106 | |||||
1107 | if ($condition) { |
||||
1108 | $stmt .= " WHERE {$condition}"; |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $condition instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
1109 | } |
||||
1110 | |||||
1111 | $limit = $this->getTableLimit($tableName); |
||||
1112 | |||||
1113 | if ($limit !== false) { |
||||
0 ignored issues
–
show
|
|||||
1114 | $stmt .= " LIMIT {$limit}"; |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $limit instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
1115 | } |
||||
1116 | |||||
1117 | $resultSet = $this->dbHandler->query($stmt); |
||||
1118 | $resultSet->setFetchMode(PDO::FETCH_ASSOC); |
||||
1119 | |||||
1120 | $ignore = $this->dumpSettings['insert-ignore'] ? ' IGNORE' : ''; |
||||
0 ignored issues
–
show
|
|||||
1121 | |||||
1122 | $count = 0; |
||||
1123 | foreach ($resultSet as $row) { |
||||
1124 | $count++; |
||||
1125 | $vals = $this->prepareColumnValues($tableName, $row); |
||||
1126 | if ($onlyOnce || !$this->dumpSettings['extended-insert']) { |
||||
0 ignored issues
–
show
|
|||||
1127 | if ($this->dumpSettings['complete-insert']) { |
||||
1128 | $lineSize += $this->compressManager->write( |
||||
1129 | "INSERT$ignore INTO `$tableName` (". |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $ignore instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
As per coding-style, please use concatenation or
sprintf for the variable $tableName instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
1130 | implode(", ", $colNames). |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
, does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Comprehensibility
Best Practice
introduced
by
|
|||||
1131 | ") VALUES (".implode(",", $vals).")" |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
) VALUES ( does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
, does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
) does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1132 | ); |
||||
1133 | } else { |
||||
1134 | $lineSize += $this->compressManager->write( |
||||
1135 | "INSERT$ignore INTO `$tableName` VALUES (".implode(",", $vals).")" |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $ignore instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
As per coding-style, please use concatenation or
sprintf for the variable $tableName instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
, does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
) does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1136 | ); |
||||
1137 | } |
||||
0 ignored issues
–
show
|
|||||
1138 | $onlyOnce = false; |
||||
0 ignored issues
–
show
|
|||||
1139 | } else { |
||||
1140 | $lineSize += $this->compressManager->write(",(".implode(",", $vals).")"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
,( does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
, does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
) does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1141 | } |
||||
0 ignored issues
–
show
|
|||||
1142 | if (($lineSize > $this->dumpSettings['net_buffer_length']) || |
||||
1143 | !$this->dumpSettings['extended-insert']) { |
||||
0 ignored issues
–
show
|
|||||
1144 | $onlyOnce = true; |
||||
0 ignored issues
–
show
|
|||||
1145 | $lineSize = $this->compressManager->write(";".PHP_EOL); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1146 | } |
||||
1147 | } |
||||
0 ignored issues
–
show
|
|||||
1148 | $resultSet->closeCursor(); |
||||
1149 | |||||
1150 | if (!$onlyOnce) { |
||||
0 ignored issues
–
show
|
|||||
1151 | $this->compressManager->write(";".PHP_EOL); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1152 | } |
||||
1153 | |||||
1154 | $this->endListValues($tableName, $count); |
||||
1155 | |||||
1156 | if ($this->infoCallable) { |
||||
1157 | call_user_func($this->infoCallable, 'table', array('name' => $tableName, 'rowCount' => $count)); |
||||
0 ignored issues
–
show
|
|||||
1158 | } |
||||
1159 | } |
||||
0 ignored issues
–
show
|
|||||
1160 | |||||
1161 | /** |
||||
1162 | * Table rows extractor, append information prior to dump |
||||
1163 | * |
||||
1164 | * @param string $tableName Name of table to export |
||||
0 ignored issues
–
show
|
|||||
1165 | * |
||||
1166 | * @return null |
||||
1167 | */ |
||||
1168 | public function prepareListValues($tableName) |
||||
1169 | { |
||||
0 ignored issues
–
show
|
|||||
1170 | if (!$this->dumpSettings['skip-comments']) { |
||||
0 ignored issues
–
show
|
|||||
1171 | $this->compressManager->write( |
||||
1172 | "--".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1173 | "-- Dumping data for table `$tableName`".PHP_EOL. |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $tableName instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
1174 | "--".PHP_EOL.PHP_EOL |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1175 | ); |
||||
1176 | } |
||||
1177 | |||||
1178 | if ($this->dumpSettings['single-transaction']) { |
||||
1179 | $this->dbHandler->exec($this->typeAdapter->setup_transaction()); |
||||
1180 | $this->dbHandler->exec($this->typeAdapter->start_transaction()); |
||||
1181 | } |
||||
1182 | |||||
1183 | if ($this->dumpSettings['lock-tables'] && !$this->dumpSettings['single-transaction']) { |
||||
0 ignored issues
–
show
|
|||||
1184 | $this->typeAdapter->lock_table($tableName); |
||||
1185 | } |
||||
1186 | |||||
1187 | if ($this->dumpSettings['add-locks']) { |
||||
1188 | $this->compressManager->write( |
||||
1189 | $this->typeAdapter->start_add_lock_table($tableName) |
||||
1190 | ); |
||||
1191 | } |
||||
1192 | |||||
1193 | if ($this->dumpSettings['disable-keys']) { |
||||
1194 | $this->compressManager->write( |
||||
1195 | $this->typeAdapter->start_add_disable_keys($tableName) |
||||
1196 | ); |
||||
1197 | } |
||||
1198 | |||||
1199 | // Disable autocommit for faster reload |
||||
0 ignored issues
–
show
|
|||||
1200 | if ($this->dumpSettings['no-autocommit']) { |
||||
1201 | $this->compressManager->write( |
||||
1202 | $this->typeAdapter->start_disable_autocommit() |
||||
1203 | ); |
||||
1204 | } |
||||
1205 | |||||
1206 | return; |
||||
0 ignored issues
–
show
|
|||||
1207 | } |
||||
0 ignored issues
–
show
|
|||||
1208 | |||||
1209 | /** |
||||
1210 | * Table rows extractor, close locks and commits after dump |
||||
1211 | * |
||||
1212 | * @param string $tableName Name of table to export. |
||||
0 ignored issues
–
show
|
|||||
1213 | * @param integer $count Number of rows inserted. |
||||
0 ignored issues
–
show
|
|||||
1214 | * |
||||
1215 | * @return void |
||||
1216 | */ |
||||
1217 | public function endListValues($tableName, $count = 0) |
||||
1218 | { |
||||
0 ignored issues
–
show
|
|||||
1219 | if ($this->dumpSettings['disable-keys']) { |
||||
1220 | $this->compressManager->write( |
||||
1221 | $this->typeAdapter->end_add_disable_keys($tableName) |
||||
1222 | ); |
||||
1223 | } |
||||
1224 | |||||
1225 | if ($this->dumpSettings['add-locks']) { |
||||
1226 | $this->compressManager->write( |
||||
1227 | $this->typeAdapter->end_add_lock_table($tableName) |
||||
1228 | ); |
||||
1229 | } |
||||
1230 | |||||
1231 | if ($this->dumpSettings['single-transaction']) { |
||||
1232 | $this->dbHandler->exec($this->typeAdapter->commit_transaction()); |
||||
1233 | } |
||||
1234 | |||||
1235 | if ($this->dumpSettings['lock-tables'] && !$this->dumpSettings['single-transaction']) { |
||||
0 ignored issues
–
show
|
|||||
1236 | $this->typeAdapter->unlock_table($tableName); |
||||
1237 | } |
||||
1238 | |||||
1239 | // Commit to enable autocommit |
||||
0 ignored issues
–
show
|
|||||
1240 | if ($this->dumpSettings['no-autocommit']) { |
||||
1241 | $this->compressManager->write( |
||||
1242 | $this->typeAdapter->end_disable_autocommit() |
||||
1243 | ); |
||||
1244 | } |
||||
1245 | |||||
1246 | $this->compressManager->write(PHP_EOL); |
||||
1247 | |||||
1248 | if (!$this->dumpSettings['skip-comments']) { |
||||
0 ignored issues
–
show
|
|||||
1249 | $this->compressManager->write( |
||||
1250 | "-- Dumped table `".$tableName."` with $count row(s)".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- Dumped table ` does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
As per coding-style, please use concatenation or
sprintf for the variable $count instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
1251 | '--'.PHP_EOL.PHP_EOL |
||||
1252 | ); |
||||
1253 | } |
||||
1254 | |||||
1255 | return; |
||||
0 ignored issues
–
show
|
|||||
1256 | } |
||||
0 ignored issues
–
show
|
|||||
1257 | |||||
1258 | /** |
||||
1259 | * Build SQL List of all columns on current table which will be used for selecting |
||||
1260 | * |
||||
1261 | * @param string $tableName Name of table to get columns |
||||
0 ignored issues
–
show
|
|||||
1262 | * |
||||
1263 | * @return array SQL sentence with columns for select |
||||
1264 | */ |
||||
1265 | public function getColumnStmt($tableName) |
||||
1266 | { |
||||
0 ignored issues
–
show
|
|||||
1267 | $colStmt = array(); |
||||
0 ignored issues
–
show
|
|||||
1268 | foreach ($this->tableColumnTypes[$tableName] as $colName => $colType) { |
||||
1269 | if ($colType['type'] == 'bit' && $this->dumpSettings['hex-blob']) { |
||||
0 ignored issues
–
show
|
|||||
1270 | $colStmt[] = "LPAD(HEX(`${colName}`),2,'0') AS `${colName}`"; |
||||
1271 | } elseif ($colType['is_blob'] && $this->dumpSettings['hex-blob']) { |
||||
0 ignored issues
–
show
|
|||||
1272 | $colStmt[] = "HEX(`${colName}`) AS `${colName}`"; |
||||
1273 | } elseif ($colType['is_virtual']) { |
||||
0 ignored issues
–
show
|
|||||
1274 | $this->dumpSettings['complete-insert'] = true; |
||||
0 ignored issues
–
show
|
|||||
1275 | continue; |
||||
1276 | } else { |
||||
1277 | $colStmt[] = "`${colName}`"; |
||||
1278 | } |
||||
1279 | } |
||||
1280 | |||||
1281 | return $colStmt; |
||||
1282 | } |
||||
0 ignored issues
–
show
|
|||||
1283 | |||||
1284 | /** |
||||
1285 | * Build SQL List of all columns on current table which will be used for inserting |
||||
1286 | * |
||||
1287 | * @param string $tableName Name of table to get columns |
||||
0 ignored issues
–
show
|
|||||
1288 | * |
||||
1289 | * @return array columns for sql sentence for insert |
||||
1290 | */ |
||||
1291 | public function getColumnNames($tableName) |
||||
1292 | { |
||||
0 ignored issues
–
show
|
|||||
1293 | $colNames = array(); |
||||
0 ignored issues
–
show
|
|||||
1294 | foreach ($this->tableColumnTypes[$tableName] as $colName => $colType) { |
||||
1295 | if ($colType['is_virtual']) { |
||||
1296 | $this->dumpSettings['complete-insert'] = true; |
||||
0 ignored issues
–
show
|
|||||
1297 | continue; |
||||
1298 | } else { |
||||
1299 | $colNames[] = "`${colName}`"; |
||||
1300 | } |
||||
1301 | } |
||||
0 ignored issues
–
show
|
|||||
1302 | return $colNames; |
||||
1303 | } |
||||
0 ignored issues
–
show
|
|||||
1304 | } |
||||
0 ignored issues
–
show
|
|||||
1305 | |||||
1306 | /** |
||||
1307 | * Enum with all available compression methods |
||||
1308 | * |
||||
1309 | */ |
||||
0 ignored issues
–
show
|
|||||
1310 | abstract class CompressMethod |
||||
0 ignored issues
–
show
|
|||||
1311 | { |
||||
0 ignored issues
–
show
|
|||||
1312 | public static $enums = array( |
||||
0 ignored issues
–
show
|
|||||
1313 | Mysqldump::NONE, |
||||
0 ignored issues
–
show
|
|||||
1314 | Mysqldump::GZIP, |
||||
0 ignored issues
–
show
|
|||||
1315 | Mysqldump::BZIP2, |
||||
0 ignored issues
–
show
|
|||||
1316 | Mysqldump::GZIPSTREAM, |
||||
0 ignored issues
–
show
|
|||||
1317 | ); |
||||
0 ignored issues
–
show
|
|||||
1318 | |||||
1319 | /** |
||||
0 ignored issues
–
show
|
|||||
1320 | * @param string $c |
||||
0 ignored issues
–
show
|
|||||
1321 | * @return boolean |
||||
1322 | */ |
||||
1323 | public static function isValid($c) |
||||
0 ignored issues
–
show
|
|||||
1324 | { |
||||
0 ignored issues
–
show
|
|||||
1325 | return in_array($c, self::$enums); |
||||
1326 | } |
||||
0 ignored issues
–
show
|
|||||
1327 | } |
||||
0 ignored issues
–
show
|
|||||
1328 | |||||
1329 | abstract class CompressManagerFactory |
||||
0 ignored issues
–
show
|
|||||
1330 | { |
||||
0 ignored issues
–
show
|
|||||
1331 | /** |
||||
0 ignored issues
–
show
|
|||||
1332 | * @param string $c |
||||
0 ignored issues
–
show
|
|||||
1333 | * @return CompressBzip2|CompressGzip|CompressNone |
||||
1334 | */ |
||||
0 ignored issues
–
show
|
|||||
1335 | public static function create($c) |
||||
0 ignored issues
–
show
|
|||||
1336 | { |
||||
0 ignored issues
–
show
|
|||||
1337 | $c = ucfirst(strtolower($c)); |
||||
1338 | if (!CompressMethod::isValid($c)) { |
||||
0 ignored issues
–
show
|
|||||
1339 | throw new Exception("Compression method ($c) is not defined yet"); |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $c instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
1340 | } |
||||
1341 | |||||
1342 | $method = __NAMESPACE__."\\"."Compress".$c; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
\\ does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
Compress does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1343 | |||||
1344 | return new $method; |
||||
1345 | } |
||||
0 ignored issues
–
show
|
|||||
1346 | } |
||||
0 ignored issues
–
show
|
|||||
1347 | |||||
1348 | class CompressBzip2 extends CompressManagerFactory |
||||
0 ignored issues
–
show
|
|||||
1349 | { |
||||
0 ignored issues
–
show
|
|||||
1350 | private $fileHandler = null; |
||||
0 ignored issues
–
show
|
|||||
1351 | |||||
1352 | public function __construct() |
||||
0 ignored issues
–
show
|
|||||
1353 | { |
||||
0 ignored issues
–
show
|
|||||
1354 | if (!function_exists("bzopen")) { |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
bzopen does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1355 | throw new Exception("Compression is enabled, but bzip2 lib is not installed or configured properly"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Compression is enabled, ... or configured properly does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1356 | } |
||||
1357 | } |
||||
0 ignored issues
–
show
|
|||||
1358 | |||||
1359 | /** |
||||
0 ignored issues
–
show
|
|||||
1360 | * @param string $filename |
||||
0 ignored issues
–
show
|
|||||
1361 | */ |
||||
0 ignored issues
–
show
|
|||||
1362 | public function open($filename) |
||||
1363 | { |
||||
0 ignored issues
–
show
|
|||||
1364 | $this->fileHandler = bzopen($filename, "w"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
w does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1365 | if (false === $this->fileHandler) { |
||||
0 ignored issues
–
show
|
|||||
1366 | throw new Exception("Output file is not writable"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Output file is not writable does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1367 | } |
||||
1368 | |||||
1369 | return true; |
||||
0 ignored issues
–
show
|
|||||
1370 | } |
||||
0 ignored issues
–
show
|
|||||
1371 | |||||
1372 | public function write($str) |
||||
0 ignored issues
–
show
|
|||||
1373 | { |
||||
0 ignored issues
–
show
|
|||||
1374 | $bytesWritten = bzwrite($this->fileHandler, $str); |
||||
1375 | if (false === $bytesWritten) { |
||||
0 ignored issues
–
show
|
|||||
1376 | throw new Exception("Writting to file failed! Probably, there is no more free space left?"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Writting to file failed!...o more free space left? does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1377 | } |
||||
0 ignored issues
–
show
|
|||||
1378 | return $bytesWritten; |
||||
1379 | } |
||||
0 ignored issues
–
show
|
|||||
1380 | |||||
1381 | public function close() |
||||
0 ignored issues
–
show
|
|||||
1382 | { |
||||
0 ignored issues
–
show
|
|||||
1383 | return bzclose($this->fileHandler); |
||||
1384 | } |
||||
0 ignored issues
–
show
|
|||||
1385 | } |
||||
0 ignored issues
–
show
|
|||||
1386 | |||||
1387 | class CompressGzip extends CompressManagerFactory |
||||
0 ignored issues
–
show
|
|||||
1388 | { |
||||
0 ignored issues
–
show
|
|||||
1389 | private $fileHandler = null; |
||||
0 ignored issues
–
show
|
|||||
1390 | |||||
1391 | public function __construct() |
||||
0 ignored issues
–
show
|
|||||
1392 | { |
||||
0 ignored issues
–
show
|
|||||
1393 | if (!function_exists("gzopen")) { |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
gzopen does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1394 | throw new Exception("Compression is enabled, but gzip lib is not installed or configured properly"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Compression is enabled, ... or configured properly does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1395 | } |
||||
1396 | } |
||||
0 ignored issues
–
show
|
|||||
1397 | |||||
1398 | /** |
||||
0 ignored issues
–
show
|
|||||
1399 | * @param string $filename |
||||
0 ignored issues
–
show
|
|||||
1400 | */ |
||||
0 ignored issues
–
show
|
|||||
1401 | public function open($filename) |
||||
1402 | { |
||||
0 ignored issues
–
show
|
|||||
1403 | $this->fileHandler = gzopen($filename, "wb"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
wb does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1404 | if (false === $this->fileHandler) { |
||||
0 ignored issues
–
show
|
|||||
1405 | throw new Exception("Output file is not writable"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Output file is not writable does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1406 | } |
||||
1407 | |||||
1408 | return true; |
||||
0 ignored issues
–
show
|
|||||
1409 | } |
||||
0 ignored issues
–
show
|
|||||
1410 | |||||
1411 | public function write($str) |
||||
0 ignored issues
–
show
|
|||||
1412 | { |
||||
0 ignored issues
–
show
|
|||||
1413 | $bytesWritten = gzwrite($this->fileHandler, $str); |
||||
1414 | if (false === $bytesWritten) { |
||||
0 ignored issues
–
show
|
|||||
1415 | throw new Exception("Writting to file failed! Probably, there is no more free space left?"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Writting to file failed!...o more free space left? does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1416 | } |
||||
0 ignored issues
–
show
|
|||||
1417 | return $bytesWritten; |
||||
1418 | } |
||||
0 ignored issues
–
show
|
|||||
1419 | |||||
1420 | public function close() |
||||
0 ignored issues
–
show
|
|||||
1421 | { |
||||
0 ignored issues
–
show
|
|||||
1422 | return gzclose($this->fileHandler); |
||||
1423 | } |
||||
0 ignored issues
–
show
|
|||||
1424 | } |
||||
0 ignored issues
–
show
|
|||||
1425 | |||||
1426 | class CompressNone extends CompressManagerFactory |
||||
0 ignored issues
–
show
|
|||||
1427 | { |
||||
0 ignored issues
–
show
|
|||||
1428 | private $fileHandler = null; |
||||
0 ignored issues
–
show
|
|||||
1429 | |||||
1430 | /** |
||||
0 ignored issues
–
show
|
|||||
1431 | * @param string $filename |
||||
0 ignored issues
–
show
|
|||||
1432 | */ |
||||
0 ignored issues
–
show
|
|||||
1433 | public function open($filename) |
||||
0 ignored issues
–
show
|
|||||
1434 | { |
||||
0 ignored issues
–
show
|
|||||
1435 | $this->fileHandler = fopen($filename, "wb"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
wb does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1436 | if (false === $this->fileHandler) { |
||||
0 ignored issues
–
show
|
|||||
1437 | throw new Exception("Output file is not writable"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Output file is not writable does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1438 | } |
||||
1439 | |||||
1440 | return true; |
||||
0 ignored issues
–
show
|
|||||
1441 | } |
||||
0 ignored issues
–
show
|
|||||
1442 | |||||
1443 | public function write($str) |
||||
0 ignored issues
–
show
|
|||||
1444 | { |
||||
0 ignored issues
–
show
|
|||||
1445 | $bytesWritten = fwrite($this->fileHandler, $str); |
||||
1446 | if (false === $bytesWritten) { |
||||
0 ignored issues
–
show
|
|||||
1447 | throw new Exception("Writting to file failed! Probably, there is no more free space left?"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Writting to file failed!...o more free space left? does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1448 | } |
||||
0 ignored issues
–
show
|
|||||
1449 | return $bytesWritten; |
||||
1450 | } |
||||
0 ignored issues
–
show
|
|||||
1451 | |||||
1452 | public function close() |
||||
0 ignored issues
–
show
|
|||||
1453 | { |
||||
0 ignored issues
–
show
|
|||||
1454 | return fclose($this->fileHandler); |
||||
1455 | } |
||||
0 ignored issues
–
show
|
|||||
1456 | } |
||||
0 ignored issues
–
show
|
|||||
1457 | |||||
1458 | class CompressGzipstream extends CompressManagerFactory |
||||
0 ignored issues
–
show
|
|||||
1459 | { |
||||
0 ignored issues
–
show
|
|||||
1460 | private $fileHandler = null; |
||||
0 ignored issues
–
show
|
|||||
1461 | |||||
1462 | private $compressContext; |
||||
0 ignored issues
–
show
|
|||||
1463 | |||||
1464 | /** |
||||
0 ignored issues
–
show
|
|||||
1465 | * @param string $filename |
||||
0 ignored issues
–
show
|
|||||
1466 | */ |
||||
0 ignored issues
–
show
|
|||||
1467 | public function open($filename) |
||||
0 ignored issues
–
show
|
|||||
1468 | { |
||||
0 ignored issues
–
show
|
|||||
1469 | $this->fileHandler = fopen($filename, "wb"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
wb does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1470 | if (false === $this->fileHandler) { |
||||
0 ignored issues
–
show
|
|||||
1471 | throw new Exception("Output file is not writable"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Output file is not writable does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1472 | } |
||||
0 ignored issues
–
show
|
|||||
1473 | |||||
1474 | $this->compressContext = deflate_init(ZLIB_ENCODING_GZIP, array('level' => 9)); |
||||
0 ignored issues
–
show
|
|||||
1475 | return true; |
||||
0 ignored issues
–
show
|
|||||
1476 | } |
||||
0 ignored issues
–
show
|
|||||
1477 | |||||
1478 | public function write($str) |
||||
0 ignored issues
–
show
|
|||||
1479 | { |
||||
0 ignored issues
–
show
|
|||||
1480 | |||||
1481 | $bytesWritten = fwrite($this->fileHandler, deflate_add($this->compressContext, $str, ZLIB_NO_FLUSH)); |
||||
0 ignored issues
–
show
|
|||||
1482 | if (false === $bytesWritten) { |
||||
0 ignored issues
–
show
|
|||||
1483 | throw new Exception("Writting to file failed! Probably, there is no more free space left?"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Writting to file failed!...o more free space left? does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1484 | } |
||||
0 ignored issues
–
show
|
|||||
1485 | return $bytesWritten; |
||||
0 ignored issues
–
show
|
|||||
1486 | } |
||||
0 ignored issues
–
show
|
|||||
1487 | |||||
1488 | public function close() |
||||
0 ignored issues
–
show
|
|||||
1489 | { |
||||
0 ignored issues
–
show
|
|||||
1490 | fwrite($this->fileHandler, deflate_add($this->compressContext, '', ZLIB_FINISH)); |
||||
0 ignored issues
–
show
|
|||||
1491 | return fclose($this->fileHandler); |
||||
0 ignored issues
–
show
|
|||||
1492 | } |
||||
0 ignored issues
–
show
|
|||||
1493 | } |
||||
0 ignored issues
–
show
|
|||||
1494 | |||||
1495 | /** |
||||
1496 | * Enum with all available TypeAdapter implementations |
||||
1497 | * |
||||
1498 | */ |
||||
0 ignored issues
–
show
|
|||||
1499 | abstract class TypeAdapter |
||||
0 ignored issues
–
show
|
|||||
1500 | { |
||||
0 ignored issues
–
show
|
|||||
1501 | public static $enums = array( |
||||
0 ignored issues
–
show
|
|||||
1502 | "Sqlite", |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Sqlite does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1503 | "Mysql" |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Mysql does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1504 | ); |
||||
0 ignored issues
–
show
|
|||||
1505 | |||||
1506 | /** |
||||
0 ignored issues
–
show
|
|||||
1507 | * @param string $c |
||||
0 ignored issues
–
show
|
|||||
1508 | * @return boolean |
||||
1509 | */ |
||||
1510 | public static function isValid($c) |
||||
0 ignored issues
–
show
|
|||||
1511 | { |
||||
0 ignored issues
–
show
|
|||||
1512 | return in_array($c, self::$enums); |
||||
1513 | } |
||||
0 ignored issues
–
show
|
|||||
1514 | } |
||||
0 ignored issues
–
show
|
|||||
1515 | |||||
1516 | /** |
||||
1517 | * TypeAdapter Factory |
||||
1518 | * |
||||
1519 | */ |
||||
0 ignored issues
–
show
|
|||||
1520 | abstract class TypeAdapterFactory |
||||
0 ignored issues
–
show
|
|||||
1521 | { |
||||
0 ignored issues
–
show
|
|||||
1522 | protected $dbHandler = null; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
1523 | protected $dumpSettings = array(); |
||||
0 ignored issues
–
show
|
|||||
1524 | |||||
1525 | /** |
||||
0 ignored issues
–
show
|
|||||
1526 | * @param string $c Type of database factory to create (Mysql, Sqlite,...) |
||||
0 ignored issues
–
show
|
|||||
1527 | * @param PDO $dbHandler |
||||
0 ignored issues
–
show
|
|||||
1528 | */ |
||||
0 ignored issues
–
show
|
|||||
1529 | public static function create($c, $dbHandler = null, $dumpSettings = array()) |
||||
0 ignored issues
–
show
|
|||||
1530 | { |
||||
0 ignored issues
–
show
|
|||||
1531 | $c = ucfirst(strtolower($c)); |
||||
1532 | if (!TypeAdapter::isValid($c)) { |
||||
0 ignored issues
–
show
|
|||||
1533 | throw new Exception("Database type support for ($c) not yet available"); |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $c instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
1534 | } |
||||
0 ignored issues
–
show
|
|||||
1535 | $method = __NAMESPACE__."\\"."TypeAdapter".$c; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
\\ does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
TypeAdapter does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1536 | return new $method($dbHandler, $dumpSettings); |
||||
1537 | } |
||||
0 ignored issues
–
show
|
|||||
1538 | |||||
1539 | public function __construct($dbHandler = null, $dumpSettings = array()) |
||||
0 ignored issues
–
show
|
|||||
1540 | { |
||||
0 ignored issues
–
show
|
|||||
1541 | $this->dbHandler = $dbHandler; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
1542 | $this->dumpSettings = $dumpSettings; |
||||
1543 | } |
||||
0 ignored issues
–
show
|
|||||
1544 | |||||
1545 | /** |
||||
1546 | * function databases Add sql to create and use database |
||||
0 ignored issues
–
show
|
|||||
1547 | * @todo make it do something with sqlite |
||||
0 ignored issues
–
show
Comment refers to a TODO task
This check looks ``TODO``s show that something is left unfinished and should be attended to.
Loading history...
|
|||||
1548 | */ |
||||
0 ignored issues
–
show
|
|||||
1549 | public function databases() |
||||
1550 | { |
||||
0 ignored issues
–
show
|
|||||
1551 | return ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1552 | } |
||||
0 ignored issues
–
show
|
|||||
1553 | |||||
1554 | public function show_create_table($tableName) |
||||
0 ignored issues
–
show
|
|||||
1555 | { |
||||
0 ignored issues
–
show
|
|||||
1556 | return "SELECT tbl_name as 'Table', sql as 'Create Table' ". |
||||
0 ignored issues
–
show
|
|||||
1557 | "FROM sqlite_master ". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
FROM sqlite_master does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1558 | "WHERE type='table' AND tbl_name='$tableName'"; |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $tableName instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
1559 | } |
||||
0 ignored issues
–
show
|
|||||
1560 | |||||
1561 | /** |
||||
0 ignored issues
–
show
|
|||||
1562 | * function create_table Get table creation code from database |
||||
0 ignored issues
–
show
|
|||||
1563 | * @todo make it do something with sqlite |
||||
0 ignored issues
–
show
Comment refers to a TODO task
This check looks ``TODO``s show that something is left unfinished and should be attended to.
Loading history...
|
|||||
1564 | */ |
||||
0 ignored issues
–
show
|
|||||
1565 | public function create_table($row) |
||||
0 ignored issues
–
show
|
|||||
1566 | { |
||||
0 ignored issues
–
show
|
|||||
1567 | return ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1568 | } |
||||
0 ignored issues
–
show
|
|||||
1569 | |||||
1570 | public function show_create_view($viewName) |
||||
0 ignored issues
–
show
|
|||||
1571 | { |
||||
0 ignored issues
–
show
|
|||||
1572 | return "SELECT tbl_name as 'View', sql as 'Create View' ". |
||||
0 ignored issues
–
show
|
|||||
1573 | "FROM sqlite_master ". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
FROM sqlite_master does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1574 | "WHERE type='view' AND tbl_name='$viewName'"; |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $viewName instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
1575 | } |
||||
0 ignored issues
–
show
|
|||||
1576 | |||||
1577 | /** |
||||
0 ignored issues
–
show
|
|||||
1578 | * function create_view Get view creation code from database |
||||
0 ignored issues
–
show
|
|||||
1579 | * @todo make it do something with sqlite |
||||
0 ignored issues
–
show
Comment refers to a TODO task
This check looks ``TODO``s show that something is left unfinished and should be attended to.
Loading history...
|
|||||
1580 | */ |
||||
0 ignored issues
–
show
|
|||||
1581 | public function create_view($row) |
||||
0 ignored issues
–
show
|
|||||
1582 | { |
||||
0 ignored issues
–
show
|
|||||
1583 | return ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1584 | } |
||||
0 ignored issues
–
show
|
|||||
1585 | |||||
1586 | /** |
||||
0 ignored issues
–
show
|
|||||
1587 | * function show_create_trigger Get trigger creation code from database |
||||
0 ignored issues
–
show
|
|||||
1588 | * @todo make it do something with sqlite |
||||
0 ignored issues
–
show
Comment refers to a TODO task
This check looks ``TODO``s show that something is left unfinished and should be attended to.
Loading history...
|
|||||
1589 | */ |
||||
0 ignored issues
–
show
|
|||||
1590 | public function show_create_trigger($triggerName) |
||||
0 ignored issues
–
show
|
|||||
1591 | { |
||||
0 ignored issues
–
show
|
|||||
1592 | return ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1593 | } |
||||
0 ignored issues
–
show
|
|||||
1594 | |||||
1595 | /** |
||||
0 ignored issues
–
show
|
|||||
1596 | * function create_trigger Modify trigger code, add delimiters, etc |
||||
0 ignored issues
–
show
|
|||||
1597 | * @todo make it do something with sqlite |
||||
0 ignored issues
–
show
Comment refers to a TODO task
This check looks ``TODO``s show that something is left unfinished and should be attended to.
Loading history...
|
|||||
1598 | */ |
||||
0 ignored issues
–
show
|
|||||
1599 | public function create_trigger($triggerName) |
||||
0 ignored issues
–
show
|
|||||
1600 | { |
||||
0 ignored issues
–
show
|
|||||
1601 | return ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1602 | } |
||||
0 ignored issues
–
show
|
|||||
1603 | |||||
1604 | /** |
||||
0 ignored issues
–
show
|
|||||
1605 | * function create_procedure Modify procedure code, add delimiters, etc |
||||
0 ignored issues
–
show
|
|||||
1606 | * @todo make it do something with sqlite |
||||
0 ignored issues
–
show
Comment refers to a TODO task
This check looks ``TODO``s show that something is left unfinished and should be attended to.
Loading history...
|
|||||
1607 | */ |
||||
0 ignored issues
–
show
|
|||||
1608 | public function create_procedure($procedureName) |
||||
0 ignored issues
–
show
|
|||||
1609 | { |
||||
0 ignored issues
–
show
|
|||||
1610 | return ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1611 | } |
||||
0 ignored issues
–
show
|
|||||
1612 | |||||
1613 | /** |
||||
0 ignored issues
–
show
|
|||||
1614 | * function create_function Modify function code, add delimiters, etc |
||||
0 ignored issues
–
show
|
|||||
1615 | * @todo make it do something with sqlite |
||||
0 ignored issues
–
show
Comment refers to a TODO task
This check looks ``TODO``s show that something is left unfinished and should be attended to.
Loading history...
|
|||||
1616 | */ |
||||
0 ignored issues
–
show
|
|||||
1617 | public function create_function($functionName) |
||||
0 ignored issues
–
show
|
|||||
1618 | { |
||||
0 ignored issues
–
show
|
|||||
1619 | return ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1620 | } |
||||
0 ignored issues
–
show
|
|||||
1621 | |||||
1622 | public function show_tables() |
||||
0 ignored issues
–
show
|
|||||
1623 | { |
||||
0 ignored issues
–
show
|
|||||
1624 | return "SELECT tbl_name FROM sqlite_master WHERE type='table'"; |
||||
1625 | } |
||||
0 ignored issues
–
show
|
|||||
1626 | |||||
1627 | public function show_views() |
||||
0 ignored issues
–
show
|
|||||
1628 | { |
||||
0 ignored issues
–
show
|
|||||
1629 | return "SELECT tbl_name FROM sqlite_master WHERE type='view'"; |
||||
1630 | } |
||||
0 ignored issues
–
show
|
|||||
1631 | |||||
1632 | public function show_triggers() |
||||
0 ignored issues
–
show
|
|||||
1633 | { |
||||
0 ignored issues
–
show
|
|||||
1634 | return "SELECT name FROM sqlite_master WHERE type='trigger'"; |
||||
1635 | } |
||||
0 ignored issues
–
show
|
|||||
1636 | |||||
1637 | public function show_columns() |
||||
0 ignored issues
–
show
|
|||||
1638 | { |
||||
0 ignored issues
–
show
|
|||||
1639 | if (func_num_args() != 1) { |
||||
0 ignored issues
–
show
|
|||||
1640 | return ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1641 | } |
||||
1642 | |||||
1643 | $args = func_get_args(); |
||||
1644 | |||||
1645 | return "pragma table_info(${args[0]})"; |
||||
1646 | } |
||||
0 ignored issues
–
show
|
|||||
1647 | |||||
1648 | public function show_procedures() |
||||
0 ignored issues
–
show
|
|||||
1649 | { |
||||
0 ignored issues
–
show
|
|||||
1650 | return ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1651 | } |
||||
0 ignored issues
–
show
|
|||||
1652 | |||||
1653 | public function show_functions() |
||||
0 ignored issues
–
show
|
|||||
1654 | { |
||||
0 ignored issues
–
show
|
|||||
1655 | return ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1656 | } |
||||
0 ignored issues
–
show
|
|||||
1657 | |||||
1658 | public function show_events() |
||||
0 ignored issues
–
show
|
|||||
1659 | { |
||||
0 ignored issues
–
show
|
|||||
1660 | return ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1661 | } |
||||
0 ignored issues
–
show
|
|||||
1662 | |||||
1663 | public function setup_transaction() |
||||
0 ignored issues
–
show
|
|||||
1664 | { |
||||
0 ignored issues
–
show
|
|||||
1665 | return ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1666 | } |
||||
0 ignored issues
–
show
|
|||||
1667 | |||||
1668 | public function start_transaction() |
||||
0 ignored issues
–
show
|
|||||
1669 | { |
||||
0 ignored issues
–
show
|
|||||
1670 | return "BEGIN EXCLUSIVE"; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
BEGIN EXCLUSIVE does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1671 | } |
||||
0 ignored issues
–
show
|
|||||
1672 | |||||
1673 | public function commit_transaction() |
||||
0 ignored issues
–
show
|
|||||
1674 | { |
||||
0 ignored issues
–
show
|
|||||
1675 | return "COMMIT"; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
COMMIT does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1676 | } |
||||
0 ignored issues
–
show
|
|||||
1677 | |||||
1678 | public function lock_table() |
||||
0 ignored issues
–
show
|
|||||
1679 | { |
||||
0 ignored issues
–
show
|
|||||
1680 | return ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1681 | } |
||||
0 ignored issues
–
show
|
|||||
1682 | |||||
1683 | public function unlock_table() |
||||
0 ignored issues
–
show
|
|||||
1684 | { |
||||
0 ignored issues
–
show
|
|||||
1685 | return ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1686 | } |
||||
0 ignored issues
–
show
|
|||||
1687 | |||||
1688 | public function start_add_lock_table() |
||||
0 ignored issues
–
show
|
|||||
1689 | { |
||||
0 ignored issues
–
show
|
|||||
1690 | return PHP_EOL; |
||||
1691 | } |
||||
0 ignored issues
–
show
|
|||||
1692 | |||||
1693 | public function end_add_lock_table() |
||||
0 ignored issues
–
show
|
|||||
1694 | { |
||||
0 ignored issues
–
show
|
|||||
1695 | return PHP_EOL; |
||||
1696 | } |
||||
0 ignored issues
–
show
|
|||||
1697 | |||||
1698 | public function start_add_disable_keys() |
||||
0 ignored issues
–
show
|
|||||
1699 | { |
||||
0 ignored issues
–
show
|
|||||
1700 | return PHP_EOL; |
||||
1701 | } |
||||
0 ignored issues
–
show
|
|||||
1702 | |||||
1703 | public function end_add_disable_keys() |
||||
0 ignored issues
–
show
|
|||||
1704 | { |
||||
0 ignored issues
–
show
|
|||||
1705 | return PHP_EOL; |
||||
1706 | } |
||||
0 ignored issues
–
show
|
|||||
1707 | |||||
1708 | public function start_disable_foreign_keys_check() |
||||
0 ignored issues
–
show
|
|||||
1709 | { |
||||
0 ignored issues
–
show
|
|||||
1710 | return PHP_EOL; |
||||
1711 | } |
||||
0 ignored issues
–
show
|
|||||
1712 | |||||
1713 | public function end_disable_foreign_keys_check() |
||||
0 ignored issues
–
show
|
|||||
1714 | { |
||||
0 ignored issues
–
show
|
|||||
1715 | return PHP_EOL; |
||||
1716 | } |
||||
0 ignored issues
–
show
|
|||||
1717 | |||||
1718 | public function add_drop_database() |
||||
0 ignored issues
–
show
|
|||||
1719 | { |
||||
0 ignored issues
–
show
|
|||||
1720 | return PHP_EOL; |
||||
1721 | } |
||||
0 ignored issues
–
show
|
|||||
1722 | |||||
1723 | public function add_drop_trigger() |
||||
0 ignored issues
–
show
|
|||||
1724 | { |
||||
0 ignored issues
–
show
|
|||||
1725 | return PHP_EOL; |
||||
1726 | } |
||||
0 ignored issues
–
show
|
|||||
1727 | |||||
1728 | public function drop_table() |
||||
0 ignored issues
–
show
|
|||||
1729 | { |
||||
0 ignored issues
–
show
|
|||||
1730 | return PHP_EOL; |
||||
1731 | } |
||||
0 ignored issues
–
show
|
|||||
1732 | |||||
1733 | public function drop_view() |
||||
0 ignored issues
–
show
|
|||||
1734 | { |
||||
0 ignored issues
–
show
|
|||||
1735 | return PHP_EOL; |
||||
1736 | } |
||||
0 ignored issues
–
show
|
|||||
1737 | |||||
1738 | /** |
||||
1739 | * Decode column metadata and fill info structure. |
||||
1740 | * type, is_numeric and is_blob will always be available. |
||||
1741 | * |
||||
1742 | * @param array $colType Array returned from "SHOW COLUMNS FROM tableName" |
||||
0 ignored issues
–
show
|
|||||
1743 | * @return array |
||||
0 ignored issues
–
show
|
|||||
1744 | */ |
||||
1745 | public function parseColumnType($colType) |
||||
0 ignored issues
–
show
|
|||||
1746 | { |
||||
0 ignored issues
–
show
|
|||||
1747 | return array(); |
||||
0 ignored issues
–
show
|
|||||
1748 | } |
||||
0 ignored issues
–
show
|
|||||
1749 | |||||
1750 | public function backup_parameters() |
||||
0 ignored issues
–
show
|
|||||
1751 | { |
||||
0 ignored issues
–
show
|
|||||
1752 | return PHP_EOL; |
||||
1753 | } |
||||
0 ignored issues
–
show
|
|||||
1754 | |||||
1755 | public function restore_parameters() |
||||
0 ignored issues
–
show
|
|||||
1756 | { |
||||
0 ignored issues
–
show
|
|||||
1757 | return PHP_EOL; |
||||
1758 | } |
||||
0 ignored issues
–
show
|
|||||
1759 | } |
||||
0 ignored issues
–
show
|
|||||
1760 | |||||
1761 | class TypeAdapterPgsql extends TypeAdapterFactory |
||||
0 ignored issues
–
show
|
|||||
1762 | { |
||||
0 ignored issues
–
show
|
|||||
1763 | } |
||||
0 ignored issues
–
show
|
|||||
1764 | |||||
1765 | class TypeAdapterDblib extends TypeAdapterFactory |
||||
0 ignored issues
–
show
|
|||||
1766 | { |
||||
0 ignored issues
–
show
|
|||||
1767 | } |
||||
0 ignored issues
–
show
|
|||||
1768 | |||||
1769 | class TypeAdapterSqlite extends TypeAdapterFactory |
||||
0 ignored issues
–
show
|
|||||
1770 | { |
||||
0 ignored issues
–
show
|
|||||
1771 | } |
||||
0 ignored issues
–
show
|
|||||
1772 | |||||
1773 | class TypeAdapterMysql extends TypeAdapterFactory |
||||
0 ignored issues
–
show
|
|||||
1774 | { |
||||
0 ignored issues
–
show
|
|||||
1775 | const DEFINER_RE = 'DEFINER=`(?:[^`]|``)*`@`(?:[^`]|``)*`'; |
||||
1776 | |||||
1777 | |||||
1778 | // Numerical Mysql types |
||||
0 ignored issues
–
show
|
|||||
1779 | public $mysqlTypes = array( |
||||
0 ignored issues
–
show
|
|||||
1780 | 'numerical' => array( |
||||
0 ignored issues
–
show
|
|||||
1781 | 'bit', |
||||
0 ignored issues
–
show
|
|||||
1782 | 'tinyint', |
||||
0 ignored issues
–
show
|
|||||
1783 | 'smallint', |
||||
0 ignored issues
–
show
|
|||||
1784 | 'mediumint', |
||||
0 ignored issues
–
show
|
|||||
1785 | 'int', |
||||
0 ignored issues
–
show
|
|||||
1786 | 'integer', |
||||
0 ignored issues
–
show
|
|||||
1787 | 'bigint', |
||||
0 ignored issues
–
show
|
|||||
1788 | 'real', |
||||
0 ignored issues
–
show
|
|||||
1789 | 'double', |
||||
0 ignored issues
–
show
|
|||||
1790 | 'float', |
||||
0 ignored issues
–
show
|
|||||
1791 | 'decimal', |
||||
0 ignored issues
–
show
|
|||||
1792 | 'numeric' |
||||
0 ignored issues
–
show
|
|||||
1793 | ), |
||||
0 ignored issues
–
show
|
|||||
1794 | 'blob' => array( |
||||
0 ignored issues
–
show
|
|||||
1795 | 'tinyblob', |
||||
0 ignored issues
–
show
|
|||||
1796 | 'blob', |
||||
0 ignored issues
–
show
|
|||||
1797 | 'mediumblob', |
||||
0 ignored issues
–
show
|
|||||
1798 | 'longblob', |
||||
0 ignored issues
–
show
|
|||||
1799 | 'binary', |
||||
0 ignored issues
–
show
|
|||||
1800 | 'varbinary', |
||||
0 ignored issues
–
show
|
|||||
1801 | 'bit', |
||||
0 ignored issues
–
show
|
|||||
1802 | 'geometry', /* http://bugs.mysql.com/bug.php?id=43544 */ |
||||
0 ignored issues
–
show
|
|||||
1803 | 'point', |
||||
0 ignored issues
–
show
|
|||||
1804 | 'linestring', |
||||
0 ignored issues
–
show
|
|||||
1805 | 'polygon', |
||||
0 ignored issues
–
show
|
|||||
1806 | 'multipoint', |
||||
0 ignored issues
–
show
|
|||||
1807 | 'multilinestring', |
||||
0 ignored issues
–
show
|
|||||
1808 | 'multipolygon', |
||||
0 ignored issues
–
show
|
|||||
1809 | 'geometrycollection', |
||||
0 ignored issues
–
show
|
|||||
1810 | ) |
||||
0 ignored issues
–
show
|
|||||
1811 | ); |
||||
0 ignored issues
–
show
|
|||||
1812 | |||||
1813 | public function databases() |
||||
0 ignored issues
–
show
|
|||||
1814 | { |
||||
0 ignored issues
–
show
|
|||||
1815 | $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__); |
||||
0 ignored issues
–
show
|
|||||
1816 | $args = func_get_args(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 55 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
1817 | $databaseName = $args[0]; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 47 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
1818 | |||||
1819 | $resultSet = $this->dbHandler->query("SHOW VARIABLES LIKE 'character_set_database';"); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
1820 | $characterSet = $resultSet->fetchColumn(1); |
||||
1821 | $resultSet->closeCursor(); |
||||
1822 | |||||
1823 | $resultSet = $this->dbHandler->query("SHOW VARIABLES LIKE 'collation_database';"); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
1824 | $collationDb = $resultSet->fetchColumn(1); |
||||
1825 | $resultSet->closeCursor(); |
||||
1826 | $ret = ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1827 | |||||
1828 | $ret .= "CREATE DATABASE /*!32312 IF NOT EXISTS*/ `${databaseName}`". |
||||
0 ignored issues
–
show
|
|||||
1829 | " /*!40100 DEFAULT CHARACTER SET ${characterSet} ". |
||||
0 ignored issues
–
show
|
|||||
1830 | " COLLATE ${collationDb} */;".PHP_EOL.PHP_EOL. |
||||
0 ignored issues
–
show
|
|||||
1831 | "USE `${databaseName}`;".PHP_EOL.PHP_EOL; |
||||
1832 | |||||
1833 | return $ret; |
||||
1834 | } |
||||
0 ignored issues
–
show
|
|||||
1835 | |||||
1836 | public function show_create_table($tableName) |
||||
0 ignored issues
–
show
|
|||||
1837 | { |
||||
0 ignored issues
–
show
|
|||||
1838 | return "SHOW CREATE TABLE `$tableName`"; |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $tableName instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
1839 | } |
||||
0 ignored issues
–
show
|
|||||
1840 | |||||
1841 | public function show_create_view($viewName) |
||||
0 ignored issues
–
show
|
|||||
1842 | { |
||||
0 ignored issues
–
show
|
|||||
1843 | return "SHOW CREATE VIEW `$viewName`"; |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $viewName instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
1844 | } |
||||
0 ignored issues
–
show
|
|||||
1845 | |||||
1846 | public function show_create_trigger($triggerName) |
||||
0 ignored issues
–
show
|
|||||
1847 | { |
||||
0 ignored issues
–
show
|
|||||
1848 | return "SHOW CREATE TRIGGER `$triggerName`"; |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $triggerName instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
1849 | } |
||||
0 ignored issues
–
show
|
|||||
1850 | |||||
1851 | public function show_create_procedure($procedureName) |
||||
0 ignored issues
–
show
|
|||||
1852 | { |
||||
0 ignored issues
–
show
|
|||||
1853 | return "SHOW CREATE PROCEDURE `$procedureName`"; |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $procedureName instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
1854 | } |
||||
0 ignored issues
–
show
|
|||||
1855 | |||||
1856 | public function show_create_function($functionName) |
||||
0 ignored issues
–
show
|
|||||
1857 | { |
||||
0 ignored issues
–
show
|
|||||
1858 | return "SHOW CREATE FUNCTION `$functionName`"; |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $functionName instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
1859 | } |
||||
0 ignored issues
–
show
|
|||||
1860 | |||||
1861 | public function show_create_event($eventName) |
||||
0 ignored issues
–
show
|
|||||
1862 | { |
||||
0 ignored issues
–
show
|
|||||
1863 | return "SHOW CREATE EVENT `$eventName`"; |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $eventName instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
1864 | } |
||||
0 ignored issues
–
show
|
|||||
1865 | |||||
1866 | public function create_table($row) |
||||
0 ignored issues
–
show
|
|||||
1867 | { |
||||
0 ignored issues
–
show
|
|||||
1868 | if (!isset($row['Create Table'])) { |
||||
0 ignored issues
–
show
|
|||||
1869 | throw new Exception("Error getting table code, unknown output"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Error getting table code, unknown output does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1870 | } |
||||
1871 | |||||
1872 | $createTable = $row['Create Table']; |
||||
1873 | if ($this->dumpSettings['reset-auto-increment']) { |
||||
1874 | $match = "/AUTO_INCREMENT=[0-9]+/s"; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
/AUTO_INCREMENT=[0-9]+/s does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1875 | $replace = ""; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1876 | $createTable = preg_replace($match, $replace, $createTable); |
||||
1877 | } |
||||
1878 | |||||
1879 | if ($this->dumpSettings['if-not-exists'] ) { |
||||
0 ignored issues
–
show
|
|||||
1880 | $createTable = preg_replace('/^CREATE TABLE/', 'CREATE TABLE IF NOT EXISTS', $createTable); |
||||
0 ignored issues
–
show
|
|||||
1881 | } |
||||
0 ignored issues
–
show
|
|||||
1882 | |||||
1883 | $ret = "/*!40101 SET @saved_cs_client = @@character_set_client */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET @saved_cs_c...haracter_set_client */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1884 | "/*!40101 SET character_set_client = ".$this->dumpSettings['default-character-set']." */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET character_set_client = does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
*/; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1885 | $createTable.";".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1886 | "/*!40101 SET character_set_client = @saved_cs_client */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET character_s... = @saved_cs_client */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1887 | PHP_EOL; |
||||
1888 | return $ret; |
||||
1889 | } |
||||
0 ignored issues
–
show
|
|||||
1890 | |||||
1891 | public function create_view($row) |
||||
0 ignored issues
–
show
|
|||||
1892 | { |
||||
0 ignored issues
–
show
|
|||||
1893 | $ret = ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1894 | if (!isset($row['Create View'])) { |
||||
0 ignored issues
–
show
|
|||||
1895 | throw new Exception("Error getting view structure, unknown output"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Error getting view structure, unknown output does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1896 | } |
||||
1897 | |||||
1898 | $viewStmt = $row['Create View']; |
||||
1899 | |||||
1900 | $definerStr = $this->dumpSettings['skip-definer'] ? '' : '/*!50013 \2 */'.PHP_EOL; |
||||
0 ignored issues
–
show
|
|||||
1901 | |||||
1902 | if ($viewStmtReplaced = preg_replace( |
||||
0 ignored issues
–
show
|
|||||
1903 | '/^(CREATE(?:\s+ALGORITHM=(?:UNDEFINED|MERGE|TEMPTABLE))?)\s+(' |
||||
1904 | .self::DEFINER_RE.'(?:\s+SQL SECURITY DEFINER|INVOKER)?)?\s+(VIEW .+)$/', |
||||
0 ignored issues
–
show
|
|||||
1905 | '/*!50001 \1 */'.PHP_EOL.$definerStr.'/*!50001 \3 */', |
||||
1906 | $viewStmt, |
||||
1907 | 1 |
||||
1908 | )) { |
||||
0 ignored issues
–
show
|
|||||
1909 | $viewStmt = $viewStmtReplaced; |
||||
1910 | }; |
||||
1911 | |||||
1912 | $ret .= $viewStmt.';'.PHP_EOL.PHP_EOL; |
||||
1913 | return $ret; |
||||
1914 | } |
||||
0 ignored issues
–
show
|
|||||
1915 | |||||
1916 | public function create_trigger($row) |
||||
0 ignored issues
–
show
|
|||||
1917 | { |
||||
0 ignored issues
–
show
|
|||||
1918 | $ret = ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1919 | if (!isset($row['SQL Original Statement'])) { |
||||
0 ignored issues
–
show
|
|||||
1920 | throw new Exception("Error getting trigger code, unknown output"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Error getting trigger code, unknown output does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1921 | } |
||||
1922 | |||||
1923 | $triggerStmt = $row['SQL Original Statement']; |
||||
1924 | $definerStr = $this->dumpSettings['skip-definer'] ? '' : '/*!50017 \2*/ '; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
1925 | if ($triggerStmtReplaced = preg_replace( |
||||
0 ignored issues
–
show
|
|||||
1926 | '/^(CREATE)\s+('.self::DEFINER_RE.')?\s+(TRIGGER\s.*)$/s', |
||||
1927 | '/*!50003 \1*/ '.$definerStr.'/*!50003 \3 */', |
||||
1928 | $triggerStmt, |
||||
1929 | 1 |
||||
1930 | )) { |
||||
0 ignored issues
–
show
|
|||||
1931 | $triggerStmt = $triggerStmtReplaced; |
||||
1932 | } |
||||
1933 | |||||
1934 | $ret .= "DELIMITER ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
DELIMITER ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1935 | $triggerStmt.";;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1936 | "DELIMITER ;".PHP_EOL.PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
DELIMITER ; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1937 | return $ret; |
||||
1938 | } |
||||
0 ignored issues
–
show
|
|||||
1939 | |||||
1940 | public function create_procedure($row) |
||||
0 ignored issues
–
show
|
|||||
1941 | { |
||||
0 ignored issues
–
show
|
|||||
1942 | $ret = ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1943 | if (!isset($row['Create Procedure'])) { |
||||
0 ignored issues
–
show
|
|||||
1944 | throw new Exception("Error getting procedure code, unknown output. ". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Error getting procedure code, unknown output. does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1945 | "Please check 'https://bugs.mysql.com/bug.php?id=14564'"); |
||||
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
Loading history...
|
|||||
1946 | } |
||||
0 ignored issues
–
show
|
|||||
1947 | $procedureStmt = $row['Create Procedure']; |
||||
1948 | if ($this->dumpSettings['skip-definer']) { |
||||
1949 | if ($procedureStmtReplaced = preg_replace( |
||||
0 ignored issues
–
show
|
|||||
1950 | '/^(CREATE)\s+('.self::DEFINER_RE.')?\s+(PROCEDURE\s.*)$/s', |
||||
1951 | '\1 \3', |
||||
1952 | $procedureStmt, |
||||
1953 | 1 |
||||
1954 | )) { |
||||
0 ignored issues
–
show
|
|||||
1955 | $procedureStmt = $procedureStmtReplaced; |
||||
1956 | } |
||||
1957 | } |
||||
1958 | |||||
1959 | $ret .= "/*!50003 DROP PROCEDURE IF EXISTS `". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 DROP PROCEDURE IF EXISTS ` does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1960 | $row['Procedure']."` */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
` */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1961 | "/*!40101 SET @saved_cs_client = @@character_set_client */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET @saved_cs_c...haracter_set_client */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1962 | "/*!40101 SET character_set_client = ".$this->dumpSettings['default-character-set']." */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET character_set_client = does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
*/; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1963 | "DELIMITER ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
DELIMITER ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1964 | $procedureStmt." ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1965 | "DELIMITER ;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
DELIMITER ; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1966 | "/*!40101 SET character_set_client = @saved_cs_client */;".PHP_EOL.PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET character_s... = @saved_cs_client */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1967 | |||||
1968 | return $ret; |
||||
1969 | } |
||||
0 ignored issues
–
show
|
|||||
1970 | |||||
1971 | public function create_function($row) |
||||
0 ignored issues
–
show
|
|||||
1972 | { |
||||
0 ignored issues
–
show
|
|||||
1973 | $ret = ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1974 | if (!isset($row['Create Function'])) { |
||||
0 ignored issues
–
show
|
|||||
1975 | throw new Exception("Error getting function code, unknown output. ". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Error getting function code, unknown output. does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1976 | "Please check 'https://bugs.mysql.com/bug.php?id=14564'"); |
||||
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
Loading history...
|
|||||
1977 | } |
||||
0 ignored issues
–
show
|
|||||
1978 | $functionStmt = $row['Create Function']; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
1979 | $characterSetClient = $row['character_set_client']; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
1980 | $collationConnection = $row['collation_connection']; |
||||
1981 | $sqlMode = $row['sql_mode']; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 13 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
1982 | if ( $this->dumpSettings['skip-definer'] ) { |
||||
0 ignored issues
–
show
|
|||||
1983 | if ($functionStmtReplaced = preg_replace( |
||||
0 ignored issues
–
show
|
|||||
1984 | '/^(CREATE)\s+('.self::DEFINER_RE.')?\s+(FUNCTION\s.*)$/s', |
||||
1985 | '\1 \3', |
||||
1986 | $functionStmt, |
||||
1987 | 1 |
||||
1988 | )) { |
||||
0 ignored issues
–
show
|
|||||
1989 | $functionStmt = $functionStmtReplaced; |
||||
1990 | } |
||||
1991 | } |
||||
1992 | |||||
1993 | $ret .= "/*!50003 DROP FUNCTION IF EXISTS `". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 DROP FUNCTION IF EXISTS ` does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1994 | $row['Function']."` */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
` */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1995 | "/*!40101 SET @saved_cs_client = @@character_set_client */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET @saved_cs_c...haracter_set_client */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1996 | "/*!50003 SET @saved_cs_results = @@character_set_results */ ;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET @saved_cs_r...racter_set_results */ ; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1997 | "/*!50003 SET @saved_col_connection = @@collation_connection */ ;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET @saved_col_...llation_connection */ ; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1998 | "/*!40101 SET character_set_client = ".$characterSetClient." */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET character_set_client = does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
*/; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
1999 | "/*!40101 SET character_set_results = ".$characterSetClient." */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET character_set_results = does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
*/; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2000 | "/*!50003 SET collation_connection = ".$collationConnection." */ ;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET collation_connection = does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
*/ ; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2001 | "/*!50003 SET @saved_sql_mode = @@sql_mode */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET @saved_sql_... = @@sql_mode */ ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2002 | "/*!50003 SET sql_mode = '".$sqlMode."' */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
|
|||||
2003 | "/*!50003 SET @saved_time_zone = @@time_zone */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET @saved_time... = @@time_zone */ ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2004 | "/*!50003 SET time_zone = 'SYSTEM' */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
|
|||||
2005 | "DELIMITER ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
DELIMITER ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2006 | $functionStmt." ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2007 | "DELIMITER ;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
DELIMITER ; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2008 | "/*!50003 SET sql_mode = @saved_sql_mode */ ;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET sql_mode ... = @saved_sql_mode */ ; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2009 | "/*!50003 SET character_set_client = @saved_cs_client */ ;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET character_s...= @saved_cs_client */ ; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2010 | "/*!50003 SET character_set_results = @saved_cs_results */ ;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET character_s... @saved_cs_results */ ; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2011 | "/*!50003 SET collation_connection = @saved_col_connection */ ;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET collation_c...ved_col_connection */ ; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2012 | "/*!50106 SET TIME_ZONE= @saved_time_zone */ ;".PHP_EOL.PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50106 SET TIME_ZONE= @saved_time_zone */ ; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2013 | |||||
0 ignored issues
–
show
|
|||||
2014 | |||||
2015 | return $ret; |
||||
2016 | } |
||||
0 ignored issues
–
show
|
|||||
2017 | |||||
2018 | public function create_event($row) |
||||
0 ignored issues
–
show
|
|||||
2019 | { |
||||
0 ignored issues
–
show
|
|||||
2020 | $ret = ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2021 | if (!isset($row['Create Event'])) { |
||||
0 ignored issues
–
show
|
|||||
2022 | throw new Exception("Error getting event code, unknown output. ". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Error getting event code, unknown output. does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2023 | "Please check 'http://stackoverflow.com/questions/10853826/mysql-5-5-create-event-gives-syntax-error'"); |
||||
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
Loading history...
|
|||||
2024 | } |
||||
0 ignored issues
–
show
|
|||||
2025 | $eventName = $row['Event']; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2026 | $eventStmt = $row['Create Event']; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2027 | $sqlMode = $row['sql_mode']; |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2028 | $definerStr = $this->dumpSettings['skip-definer'] ? '' : '/*!50117 \2*/ '; |
||||
0 ignored issues
–
show
|
|||||
2029 | |||||
2030 | if ($eventStmtReplaced = preg_replace( |
||||
0 ignored issues
–
show
|
|||||
2031 | '/^(CREATE)\s+('.self::DEFINER_RE.')?\s+(EVENT .*)$/', |
||||
2032 | '/*!50106 \1*/ '.$definerStr.'/*!50106 \3 */', |
||||
2033 | $eventStmt, |
||||
2034 | 1 |
||||
2035 | )) { |
||||
0 ignored issues
–
show
|
|||||
2036 | $eventStmt = $eventStmtReplaced; |
||||
2037 | } |
||||
2038 | |||||
2039 | $ret .= "/*!50106 SET @save_time_zone= @@TIME_ZONE */ ;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50106 SET @save_time_zone= @@TIME_ZONE */ ; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2040 | "/*!50106 DROP EVENT IF EXISTS `".$eventName."` */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50106 DROP EVENT IF EXISTS ` does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
` */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2041 | "DELIMITER ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
DELIMITER ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2042 | "/*!50003 SET @saved_cs_client = @@character_set_client */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET @saved_cs_c...racter_set_client */ ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2043 | "/*!50003 SET @saved_cs_results = @@character_set_results */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET @saved_cs_r...acter_set_results */ ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2044 | "/*!50003 SET @saved_col_connection = @@collation_connection */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET @saved_col_...lation_connection */ ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2045 | "/*!50003 SET character_set_client = utf8 */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET character_set_client = utf8 */ ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2046 | "/*!50003 SET character_set_results = utf8 */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET character_set_results = utf8 */ ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2047 | "/*!50003 SET collation_connection = utf8_general_ci */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET collation_c...= utf8_general_ci */ ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2048 | "/*!50003 SET @saved_sql_mode = @@sql_mode */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET @saved_sql_... = @@sql_mode */ ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2049 | "/*!50003 SET sql_mode = '".$sqlMode."' */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
|
|||||
2050 | "/*!50003 SET @saved_time_zone = @@time_zone */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET @saved_time... = @@time_zone */ ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2051 | "/*!50003 SET time_zone = 'SYSTEM' */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
|
|||||
2052 | $eventStmt." ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2053 | "/*!50003 SET time_zone = @saved_time_zone */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET time_zone ... @saved_time_zone */ ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2054 | "/*!50003 SET sql_mode = @saved_sql_mode */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET sql_mode ...= @saved_sql_mode */ ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2055 | "/*!50003 SET character_set_client = @saved_cs_client */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET character_s... @saved_cs_client */ ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2056 | "/*!50003 SET character_set_results = @saved_cs_results */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET character_s...@saved_cs_results */ ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2057 | "/*!50003 SET collation_connection = @saved_col_connection */ ;;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50003 SET collation_c...ed_col_connection */ ;; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2058 | "DELIMITER ;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
DELIMITER ; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2059 | "/*!50106 SET TIME_ZONE= @save_time_zone */ ;".PHP_EOL.PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!50106 SET TIME_ZONE= @save_time_zone */ ; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2060 | // Commented because we are doing this in restore_parameters() |
||||
2061 | // "/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;" . PHP_EOL . PHP_EOL; |
||||
0 ignored issues
–
show
|
|||||
2062 | |||||
2063 | return $ret; |
||||
2064 | } |
||||
0 ignored issues
–
show
|
|||||
2065 | |||||
2066 | public function show_tables() |
||||
0 ignored issues
–
show
|
|||||
2067 | { |
||||
0 ignored issues
–
show
|
|||||
2068 | $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__); |
||||
0 ignored issues
–
show
|
|||||
2069 | $args = func_get_args(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 55 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2070 | return "SELECT TABLE_NAME AS tbl_name ". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
SELECT TABLE_NAME AS tbl_name does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2071 | "FROM INFORMATION_SCHEMA.TABLES ". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
FROM INFORMATION_SCHEMA.TABLES does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2072 | "WHERE TABLE_TYPE='BASE TABLE' AND TABLE_SCHEMA='${args[0]}'"; |
||||
2073 | } |
||||
0 ignored issues
–
show
|
|||||
2074 | |||||
2075 | public function show_views() |
||||
0 ignored issues
–
show
|
|||||
2076 | { |
||||
0 ignored issues
–
show
|
|||||
2077 | $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__); |
||||
0 ignored issues
–
show
|
|||||
2078 | $args = func_get_args(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 55 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2079 | return "SELECT TABLE_NAME AS tbl_name ". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
SELECT TABLE_NAME AS tbl_name does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2080 | "FROM INFORMATION_SCHEMA.TABLES ". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
FROM INFORMATION_SCHEMA.TABLES does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2081 | "WHERE TABLE_TYPE='VIEW' AND TABLE_SCHEMA='${args[0]}'"; |
||||
2082 | } |
||||
0 ignored issues
–
show
|
|||||
2083 | |||||
2084 | public function show_triggers() |
||||
0 ignored issues
–
show
|
|||||
2085 | { |
||||
0 ignored issues
–
show
|
|||||
2086 | $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__); |
||||
0 ignored issues
–
show
|
|||||
2087 | $args = func_get_args(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 55 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2088 | return "SHOW TRIGGERS FROM `${args[0]}`;"; |
||||
2089 | } |
||||
0 ignored issues
–
show
|
|||||
2090 | |||||
2091 | public function show_columns() |
||||
0 ignored issues
–
show
|
|||||
2092 | { |
||||
0 ignored issues
–
show
|
|||||
2093 | $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__); |
||||
0 ignored issues
–
show
|
|||||
2094 | $args = func_get_args(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 55 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2095 | return "SHOW COLUMNS FROM `${args[0]}`;"; |
||||
2096 | } |
||||
0 ignored issues
–
show
|
|||||
2097 | |||||
2098 | public function show_procedures() |
||||
0 ignored issues
–
show
|
|||||
2099 | { |
||||
0 ignored issues
–
show
|
|||||
2100 | $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__); |
||||
0 ignored issues
–
show
|
|||||
2101 | $args = func_get_args(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 55 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2102 | return "SELECT SPECIFIC_NAME AS procedure_name ". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
SELECT SPECIFIC_NAME AS procedure_name does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2103 | "FROM INFORMATION_SCHEMA.ROUTINES ". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
FROM INFORMATION_SCHEMA.ROUTINES does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2104 | "WHERE ROUTINE_TYPE='PROCEDURE' AND ROUTINE_SCHEMA='${args[0]}'"; |
||||
2105 | } |
||||
0 ignored issues
–
show
|
|||||
2106 | |||||
2107 | public function show_functions() |
||||
0 ignored issues
–
show
|
|||||
2108 | { |
||||
0 ignored issues
–
show
|
|||||
2109 | $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__); |
||||
0 ignored issues
–
show
|
|||||
2110 | $args = func_get_args(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 55 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2111 | return "SELECT SPECIFIC_NAME AS function_name ". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
SELECT SPECIFIC_NAME AS function_name does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2112 | "FROM INFORMATION_SCHEMA.ROUTINES ". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
FROM INFORMATION_SCHEMA.ROUTINES does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2113 | "WHERE ROUTINE_TYPE='FUNCTION' AND ROUTINE_SCHEMA='${args[0]}'"; |
||||
2114 | } |
||||
0 ignored issues
–
show
|
|||||
2115 | |||||
2116 | /** |
||||
2117 | * Get query string to ask for names of events from current database. |
||||
2118 | * |
||||
2119 | * @param string Name of database |
||||
0 ignored issues
–
show
The type
Ifsnop\Mysqldump\Name was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths
Loading history...
|
|||||
2120 | * @return string |
||||
0 ignored issues
–
show
|
|||||
2121 | */ |
||||
2122 | public function show_events() |
||||
0 ignored issues
–
show
|
|||||
2123 | { |
||||
0 ignored issues
–
show
|
|||||
2124 | $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__); |
||||
0 ignored issues
–
show
|
|||||
2125 | $args = func_get_args(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 55 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2126 | return "SELECT EVENT_NAME AS event_name ". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
SELECT EVENT_NAME AS event_name does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2127 | "FROM INFORMATION_SCHEMA.EVENTS ". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
FROM INFORMATION_SCHEMA.EVENTS does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2128 | "WHERE EVENT_SCHEMA='${args[0]}'"; |
||||
2129 | } |
||||
0 ignored issues
–
show
|
|||||
2130 | |||||
2131 | public function setup_transaction() |
||||
0 ignored issues
–
show
|
|||||
2132 | { |
||||
0 ignored issues
–
show
|
|||||
2133 | return "SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ"; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
SET SESSION TRANSACTION ...N LEVEL REPEATABLE READ does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2134 | } |
||||
0 ignored issues
–
show
|
|||||
2135 | |||||
2136 | public function start_transaction() |
||||
0 ignored issues
–
show
|
|||||
2137 | { |
||||
0 ignored issues
–
show
|
|||||
2138 | return "START TRANSACTION ". |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
START TRANSACTION does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2139 | "/*!40100 WITH CONSISTENT SNAPSHOT */"; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40100 WITH CONSISTENT SNAPSHOT */ does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2140 | } |
||||
0 ignored issues
–
show
|
|||||
2141 | |||||
2142 | |||||
2143 | public function commit_transaction() |
||||
0 ignored issues
–
show
|
|||||
2144 | { |
||||
0 ignored issues
–
show
|
|||||
2145 | return "COMMIT"; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
COMMIT does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2146 | } |
||||
0 ignored issues
–
show
|
|||||
2147 | |||||
2148 | public function lock_table() |
||||
0 ignored issues
–
show
|
|||||
2149 | { |
||||
0 ignored issues
–
show
|
|||||
2150 | $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__); |
||||
0 ignored issues
–
show
|
|||||
2151 | $args = func_get_args(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 55 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2152 | return $this->dbHandler->exec("LOCK TABLES `${args[0]}` READ LOCAL"); |
||||
2153 | } |
||||
0 ignored issues
–
show
|
|||||
2154 | |||||
2155 | public function unlock_table() |
||||
0 ignored issues
–
show
|
|||||
2156 | { |
||||
0 ignored issues
–
show
|
|||||
2157 | return $this->dbHandler->exec("UNLOCK TABLES"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
UNLOCK TABLES does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2158 | } |
||||
0 ignored issues
–
show
|
|||||
2159 | |||||
2160 | public function start_add_lock_table() |
||||
0 ignored issues
–
show
|
|||||
2161 | { |
||||
0 ignored issues
–
show
|
|||||
2162 | $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__); |
||||
0 ignored issues
–
show
|
|||||
2163 | $args = func_get_args(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 55 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2164 | return "LOCK TABLES `${args[0]}` WRITE;".PHP_EOL; |
||||
2165 | } |
||||
0 ignored issues
–
show
|
|||||
2166 | |||||
2167 | public function end_add_lock_table() |
||||
0 ignored issues
–
show
|
|||||
2168 | { |
||||
0 ignored issues
–
show
|
|||||
2169 | return "UNLOCK TABLES;".PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
UNLOCK TABLES; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2170 | } |
||||
0 ignored issues
–
show
|
|||||
2171 | |||||
2172 | public function start_add_disable_keys() |
||||
0 ignored issues
–
show
|
|||||
2173 | { |
||||
0 ignored issues
–
show
|
|||||
2174 | $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__); |
||||
0 ignored issues
–
show
|
|||||
2175 | $args = func_get_args(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 55 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2176 | return "/*!40000 ALTER TABLE `${args[0]}` DISABLE KEYS */;". |
||||
0 ignored issues
–
show
|
|||||
2177 | PHP_EOL; |
||||
2178 | } |
||||
0 ignored issues
–
show
|
|||||
2179 | |||||
2180 | public function end_add_disable_keys() |
||||
0 ignored issues
–
show
|
|||||
2181 | { |
||||
0 ignored issues
–
show
|
|||||
2182 | $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__); |
||||
0 ignored issues
–
show
|
|||||
2183 | $args = func_get_args(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 55 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2184 | return "/*!40000 ALTER TABLE `${args[0]}` ENABLE KEYS */;". |
||||
0 ignored issues
–
show
|
|||||
2185 | PHP_EOL; |
||||
2186 | } |
||||
0 ignored issues
–
show
|
|||||
2187 | |||||
2188 | public function start_disable_autocommit() |
||||
0 ignored issues
–
show
|
|||||
2189 | { |
||||
0 ignored issues
–
show
|
|||||
2190 | return "SET autocommit=0;".PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
SET autocommit=0; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2191 | } |
||||
0 ignored issues
–
show
|
|||||
2192 | |||||
2193 | public function end_disable_autocommit() |
||||
0 ignored issues
–
show
|
|||||
2194 | { |
||||
0 ignored issues
–
show
|
|||||
2195 | return "COMMIT;".PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
COMMIT; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2196 | } |
||||
0 ignored issues
–
show
|
|||||
2197 | |||||
2198 | public function add_drop_database() |
||||
0 ignored issues
–
show
|
|||||
2199 | { |
||||
0 ignored issues
–
show
|
|||||
2200 | $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__); |
||||
0 ignored issues
–
show
|
|||||
2201 | $args = func_get_args(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 55 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2202 | return "/*!40000 DROP DATABASE IF EXISTS `${args[0]}`*/;". |
||||
0 ignored issues
–
show
|
|||||
2203 | PHP_EOL.PHP_EOL; |
||||
2204 | } |
||||
0 ignored issues
–
show
|
|||||
2205 | |||||
2206 | public function add_drop_trigger() |
||||
0 ignored issues
–
show
|
|||||
2207 | { |
||||
0 ignored issues
–
show
|
|||||
2208 | $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__); |
||||
0 ignored issues
–
show
|
|||||
2209 | $args = func_get_args(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 55 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2210 | return "DROP TRIGGER IF EXISTS `${args[0]}`;".PHP_EOL; |
||||
2211 | } |
||||
0 ignored issues
–
show
|
|||||
2212 | |||||
2213 | public function drop_table() |
||||
0 ignored issues
–
show
|
|||||
2214 | { |
||||
0 ignored issues
–
show
|
|||||
2215 | $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__); |
||||
0 ignored issues
–
show
|
|||||
2216 | $args = func_get_args(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 55 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2217 | return "DROP TABLE IF EXISTS `${args[0]}`;".PHP_EOL; |
||||
2218 | } |
||||
0 ignored issues
–
show
|
|||||
2219 | |||||
2220 | public function drop_view() |
||||
0 ignored issues
–
show
|
|||||
2221 | { |
||||
0 ignored issues
–
show
|
|||||
2222 | $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__); |
||||
0 ignored issues
–
show
|
|||||
2223 | $args = func_get_args(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 55 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2224 | return "DROP TABLE IF EXISTS `${args[0]}`;".PHP_EOL. |
||||
0 ignored issues
–
show
|
|||||
2225 | "/*!50001 DROP VIEW IF EXISTS `${args[0]}`*/;".PHP_EOL; |
||||
2226 | } |
||||
0 ignored issues
–
show
|
|||||
2227 | |||||
2228 | public function getDatabaseHeader() |
||||
0 ignored issues
–
show
|
|||||
2229 | { |
||||
0 ignored issues
–
show
|
|||||
2230 | $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__); |
||||
0 ignored issues
–
show
|
|||||
2231 | $args = func_get_args(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 55 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2232 | return "--".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2233 | "-- Current Database: `${args[0]}`".PHP_EOL. |
||||
0 ignored issues
–
show
|
|||||
2234 | "--".PHP_EOL.PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
-- does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2235 | } |
||||
0 ignored issues
–
show
|
|||||
2236 | |||||
2237 | /** |
||||
2238 | * Decode column metadata and fill info structure. |
||||
2239 | * type, is_numeric and is_blob will always be available. |
||||
2240 | * |
||||
2241 | * @param array $colType Array returned from "SHOW COLUMNS FROM tableName" |
||||
0 ignored issues
–
show
|
|||||
2242 | * @return array |
||||
0 ignored issues
–
show
|
|||||
2243 | */ |
||||
2244 | public function parseColumnType($colType) |
||||
0 ignored issues
–
show
|
|||||
2245 | { |
||||
0 ignored issues
–
show
|
|||||
2246 | $colInfo = array(); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2247 | $colParts = explode(" ", $colType['Type']); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2248 | |||||
2249 | if ($fparen = strpos($colParts[0], "(")) { |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
( does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2250 | $colInfo['type'] = substr($colParts[0], 0, $fparen); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2251 | $colInfo['length'] = str_replace(")", "", substr($colParts[0], $fparen + 1)); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
) does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2252 | $colInfo['attributes'] = isset($colParts[1]) ? $colParts[1] : null; |
||||
0 ignored issues
–
show
|
|||||
2253 | } else { |
||||
2254 | $colInfo['type'] = $colParts[0]; |
||||
2255 | } |
||||
0 ignored issues
–
show
|
|||||
2256 | $colInfo['is_numeric'] = in_array($colInfo['type'], $this->mysqlTypes['numerical']); |
||||
2257 | $colInfo['is_blob'] = in_array($colInfo['type'], $this->mysqlTypes['blob']); |
||||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues.
Loading history...
|
|||||
2258 | // for virtual columns that are of type 'Extra', column type |
||||
0 ignored issues
–
show
|
|||||
2259 | // could by "STORED GENERATED" or "VIRTUAL GENERATED" |
||||
2260 | // MySQL reference: https://dev.mysql.com/doc/refman/5.7/en/create-table-generated-columns.html |
||||
0 ignored issues
–
show
|
|||||
2261 | $colInfo['is_virtual'] = strpos($colType['Extra'], "VIRTUAL GENERATED") !== false || strpos($colType['Extra'], "STORED GENERATED") !== false; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
VIRTUAL GENERATED does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
STORED GENERATED does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2262 | |||||
2263 | return $colInfo; |
||||
2264 | } |
||||
0 ignored issues
–
show
|
|||||
2265 | |||||
2266 | public function backup_parameters() |
||||
0 ignored issues
–
show
|
|||||
2267 | { |
||||
0 ignored issues
–
show
|
|||||
2268 | $ret = "/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET @OLD_CHARAC...HARACTER_SET_CLIENT */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2269 | "/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET @OLD_CHARAC...ARACTER_SET_RESULTS */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2270 | "/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET @OLD_COLLAT...OLLATION_CONNECTION */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2271 | "/*!40101 SET NAMES ".$this->dumpSettings['default-character-set']." */;".PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET NAMES does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
Coding Style
Comprehensibility
introduced
by
The string literal
*/; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2272 | |||||
2273 | if (false === $this->dumpSettings['skip-tz-utc']) { |
||||
0 ignored issues
–
show
|
|||||
2274 | $ret .= "/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2275 | "/*!40103 SET TIME_ZONE='+00:00' */;".PHP_EOL; |
||||
2276 | } |
||||
2277 | |||||
2278 | if ($this->dumpSettings['no-autocommit']) { |
||||
2279 | $ret .= "/*!40101 SET @OLD_AUTOCOMMIT=@@AUTOCOMMIT */;".PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET @OLD_AUTOCOMMIT=@@AUTOCOMMIT */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2280 | } |
||||
2281 | |||||
2282 | $ret .= "/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40014 SET @OLD_UNIQUE...KS, UNIQUE_CHECKS=0 */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2283 | "/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40014 SET @OLD_FOREIG...OREIGN_KEY_CHECKS=0 */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2284 | "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;".PHP_EOL. |
||||
0 ignored issues
–
show
|
|||||
2285 | "/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;".PHP_EOL.PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40111 SET @OLD_SQL_NO..._NOTES, SQL_NOTES=0 */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2286 | |||||
2287 | return $ret; |
||||
2288 | } |
||||
0 ignored issues
–
show
|
|||||
2289 | |||||
2290 | public function restore_parameters() |
||||
0 ignored issues
–
show
|
|||||
2291 | { |
||||
0 ignored issues
–
show
|
|||||
2292 | $ret = ""; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2293 | |||||
2294 | if (false === $this->dumpSettings['skip-tz-utc']) { |
||||
0 ignored issues
–
show
|
|||||
2295 | $ret .= "/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;".PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2296 | } |
||||
2297 | |||||
2298 | if ($this->dumpSettings['no-autocommit']) { |
||||
2299 | $ret .= "/*!40101 SET AUTOCOMMIT=@OLD_AUTOCOMMIT */;".PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET AUTOCOMMIT=@OLD_AUTOCOMMIT */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2300 | } |
||||
2301 | |||||
2302 | $ret .= "/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2303 | "/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40014 SET FOREIGN_KEY..._FOREIGN_KEY_CHECKS */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2304 | "/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2305 | "/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET CHARACTER_S...HARACTER_SET_CLIENT */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2306 | "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET CHARACTER_S...ARACTER_SET_RESULTS */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2307 | "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;".PHP_EOL. |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40101 SET COLLATION_C...OLLATION_CONNECTION */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2308 | "/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;".PHP_EOL.PHP_EOL; |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation.
Loading history...
|
|||||
2309 | |||||
2310 | return $ret; |
||||
2311 | } |
||||
0 ignored issues
–
show
|
|||||
2312 | |||||
2313 | /** |
||||
2314 | * Check number of parameters passed to function, useful when inheriting. |
||||
2315 | * Raise exception if unexpected. |
||||
2316 | * |
||||
2317 | * @param integer $num_args |
||||
0 ignored issues
–
show
|
|||||
2318 | * @param integer $expected_num_args |
||||
0 ignored issues
–
show
|
|||||
2319 | * @param string $method_name |
||||
0 ignored issues
–
show
|
|||||
2320 | */ |
||||
0 ignored issues
–
show
|
|||||
2321 | private function check_parameters($num_args, $expected_num_args, $method_name) |
||||
0 ignored issues
–
show
This method is not in camel caps format.
This check looks for method names that are not written in camelCase. In camelCase names are written without any punctuation, the start of each new
word being marked by a capital letter. Thus the name
database connection seeker becomes
Loading history...
|
|||||
2322 | { |
||||
0 ignored issues
–
show
|
|||||
2323 | if ($num_args != $expected_num_args) { |
||||
0 ignored issues
–
show
|
|||||
2324 | throw new Exception("Unexpected parameter passed to $method_name"); |
||||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $method_name instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||||
2325 | } |
||||
0 ignored issues
–
show
|
|||||
2326 | return; |
||||
0 ignored issues
–
show
|
|||||
2327 | } |
||||
0 ignored issues
–
show
|
|||||
2328 | } |
||||
0 ignored issues
–
show
|
|||||
2329 |