@@ -84,6 +84,10 @@ |
||
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
87 | + /** |
|
88 | + * @param string $buffer |
|
89 | + * @param FixedTextDefinition[] $fieldDefinition |
|
90 | + */ |
|
87 | 91 | protected function processBuffer($buffer, $fieldDefinition) |
88 | 92 | { |
89 | 93 | $cntDef = count($fieldDefinition); |
@@ -92,9 +92,9 @@ |
||
92 | 92 | $fieldDef = $fieldDefinition[$i]; |
93 | 93 | |
94 | 94 | $fields[$fieldDef->fieldName] = substr($buffer, $fieldDef->startPos, $fieldDef->length); |
95 | - if (!empty($fieldDef->requiredValue) && (!preg_match("/^[" . $fieldDef->requiredValue . "]$/", |
|
95 | + if (!empty($fieldDef->requiredValue) && (!preg_match("/^[".$fieldDef->requiredValue."]$/", |
|
96 | 96 | $fields[$fieldDef->fieldName]))) { |
97 | - throw new IteratorException("Expected the value '" . $fieldDef->requiredValue . "' and I got '" . $fields[$fieldDef->fieldName] . "'"); |
|
97 | + throw new IteratorException("Expected the value '".$fieldDef->requiredValue."' and I got '".$fields[$fieldDef->fieldName]."'"); |
|
98 | 98 | } elseif (is_array($fieldDef->subTypes)) { |
99 | 99 | $fields[$fieldDef->fieldName] = $this->processBuffer($fields[$fieldDef->fieldName], $fieldDef->subTypes); |
100 | 100 | } |
@@ -56,7 +56,7 @@ |
||
56 | 56 | sqlrcur_prepareQuery($cur, $sql); |
57 | 57 | $bindCount = 1; |
58 | 58 | foreach ($array as $key => $value) { |
59 | - $field = strval($bindCount ++); |
|
59 | + $field = strval($bindCount++); |
|
60 | 60 | sqlrcur_inputBind($cur, $field, $value); |
61 | 61 | } |
62 | 62 | $success = sqlrcur_executeQuery($cur); |
@@ -181,14 +181,14 @@ |
||
181 | 181 | $pat = "/$patDriver($patCredentials$patHost$patDatabase|$patFile)$patExtra/i"; |
182 | 182 | $parts = array(); |
183 | 183 | if (!preg_match($pat, $this->getDbConnectionString(), $parts)) { |
184 | - throw new InvalidArgumentException("Connection string " . $this->getDbConnectionString() . " is invalid! Please fix it."); |
|
184 | + throw new InvalidArgumentException("Connection string ".$this->getDbConnectionString()." is invalid! Please fix it."); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | // Set the Driver |
188 | 188 | $this->setDriver($parts ['driver']); |
189 | 189 | |
190 | 190 | if (!isset($parts['path']) && !isset($parts['host'])) { |
191 | - throw new InvalidArgumentException("Connection string " . $this->getDbConnectionString() . " is invalid! Please fix it."); |
|
191 | + throw new InvalidArgumentException("Connection string ".$this->getDbConnectionString()." is invalid! Please fix it."); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | public function __construct(ConnectionManagement $connMngt) |
12 | 12 | { |
13 | - $strcnn = $connMngt->getDriver() . ":" . $connMngt->getServer(); |
|
13 | + $strcnn = $connMngt->getDriver().":".$connMngt->getServer(); |
|
14 | 14 | |
15 | 15 | parent::__construct($connMngt, $strcnn, [], []); |
16 | 16 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | { |
13 | 13 | for ($i = 0, $numArgs = func_num_args(); $i < $numArgs; $i++) { |
14 | 14 | $var = func_get_arg($i); |
15 | - $sql .= ($i == 0 ? "" : "+") . $var; |
|
15 | + $sql .= ($i == 0 ? "" : "+").$var; |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | return $sql; |
@@ -47,7 +47,7 @@ |
||
47 | 47 | $arg = str_replace("_", SQLBind::keyAdj($key), $paramSubstName); |
48 | 48 | |
49 | 49 | $count = 0; |
50 | - $sql = preg_replace("/(\[\[$key\]\]|:" . $key . "[\s\W]|:$key\$)/", $arg . ' ', $sql, -1, $count); |
|
50 | + $sql = preg_replace("/(\[\[$key\]\]|:".$key."[\s\W]|:$key\$)/", $arg.' ', $sql, -1, $count); |
|
51 | 51 | if ($count === 0) { |
52 | 52 | unset($params[$key]); |
53 | 53 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | public function __construct(ConnectionManagement $connMngt) |
14 | 14 | { |
15 | - $strcnn = $connMngt->getDriver() . ":dbname=" . DBOci8Driver::getTnsString($connMngt); |
|
15 | + $strcnn = $connMngt->getDriver().":dbname=".DBOci8Driver::getTnsString($connMngt); |
|
16 | 16 | |
17 | 17 | $postOptions = [ |
18 | 18 | PDO::ATTR_EMULATE_PREPARES => true |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | $start = 0; |
87 | 87 | if ($debug) { |
88 | 88 | $log = LogHandler::getInstance(); |
89 | - $log->debug("Class name: " . get_class($this)); |
|
90 | - $log->debug("SQL: " . $sql); |
|
89 | + $log->debug("Class name: ".get_class($this)); |
|
90 | + $log->debug("SQL: ".$sql); |
|
91 | 91 | if (!is_null($param)) { |
92 | 92 | $s = ""; |
93 | 93 | foreach ($param as $key => $value) { |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | if ($debug) { |
112 | 112 | $end = microtime(true); |
113 | - $log->debug("Execution time: " . ($end - $start) . " seconds "); |
|
113 | + $log->debug("Execution time: ".($end - $start)." seconds "); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | return $id; |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | $start = 0; |
132 | 132 | if ($debug) { |
133 | 133 | $log = LogHandler::getInstance(); |
134 | - $log->debug("Class name: " . get_class($this)); |
|
135 | - $log->debug("SQL: " . $sql); |
|
134 | + $log->debug("Class name: ".get_class($this)); |
|
135 | + $log->debug("SQL: ".$sql); |
|
136 | 136 | if (!is_null($param)) { |
137 | 137 | $s = ""; |
138 | 138 | foreach ($param as $key => $value) { |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $it = $db->getIterator($sql, $param, $ttl); |
149 | 149 | if ($debug) { |
150 | 150 | $end = microtime(true); |
151 | - $log->debug("Execution Time: " . ($end - $start) . " segundos "); |
|
151 | + $log->debug("Execution Time: ".($end - $start)." segundos "); |
|
152 | 152 | } |
153 | 153 | return $it; |
154 | 154 | } |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | $start = 0; |
162 | 162 | if ($debug) { |
163 | 163 | $log = LogHandler::getInstance(); |
164 | - $log->debug("Class name: " . get_class($this)); |
|
165 | - $log->debug("SQL: " . $sql); |
|
164 | + $log->debug("Class name: ".get_class($this)); |
|
165 | + $log->debug("SQL: ".$sql); |
|
166 | 166 | if (!is_null($param)) { |
167 | 167 | $s = ""; |
168 | 168 | foreach ($param as $key => $value) { |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $scalar = $this->_db->getScalar($sql, $param); |
179 | 179 | if ($debug) { |
180 | 180 | $end = microtime(true); |
181 | - $log->debug("Execution Time: " . ($end - $start) . " segundos "); |
|
181 | + $log->debug("Execution Time: ".($end - $start)." segundos "); |
|
182 | 182 | } |
183 | 183 | return $scalar; |
184 | 184 | } |
@@ -262,14 +262,14 @@ discard block |
||
262 | 262 | $fields = $sr->getFieldNames(); |
263 | 263 | } |
264 | 264 | |
265 | - $line .= '"' . implode('","', $fields) . '"' . "\n"; |
|
265 | + $line .= '"'.implode('","', $fields).'"'."\n"; |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | $raw = array(); |
269 | 269 | foreach ($fields as $field) { |
270 | 270 | $raw[] = $sr->getField($field); |
271 | 271 | } |
272 | - $line .= '"' . implode('","', array_values($raw)) . '"' . "\n"; |
|
272 | + $line .= '"'.implode('","', array_values($raw)).'"'."\n"; |
|
273 | 273 | |
274 | 274 | if ($echoToBrowser) { |
275 | 275 | echo $line; |
@@ -63,9 +63,9 @@ |
||
63 | 63 | |
64 | 64 | $host = $connMngt->getServer(); |
65 | 65 | |
66 | - $tns = "(DESCRIPTION = " . |
|
67 | - " (ADDRESS = (PROTOCOL = $protocol)(HOST = $host)(PORT = $port)) " . |
|
68 | - " (CONNECT_DATA = (SERVICE_NAME = $svcName)) " . |
|
66 | + $tns = "(DESCRIPTION = ". |
|
67 | + " (ADDRESS = (PROTOCOL = $protocol)(HOST = $host)(PORT = $port)) ". |
|
68 | + " (CONNECT_DATA = (SERVICE_NAME = $svcName)) ". |
|
69 | 69 | ")"; |
70 | 70 | |
71 | 71 | return $tns; |