@@ -28,8 +28,7 @@ |
||
28 | 28 | $this->headers = $data->getHeaders(); |
29 | 29 | $this->columns = $data->getColumns(); |
30 | 30 | $this->fp = $data->getData(); |
31 | - } |
|
32 | - else { |
|
31 | + } else { |
|
33 | 32 | if (is_null($headers) || is_null($columns)) { |
34 | 33 | throw new Exception('Not correct data in Record class'); |
35 | 34 | } |
@@ -47,26 +47,26 @@ discard block |
||
47 | 47 | |
48 | 48 | private $charsets = [ |
49 | 49 | 0 => 866, //If charset not defined |
50 | - 1 => 437, 2 => 850, 3 => 1252, 4 => 10000, 8 => 865, |
|
51 | - 9 => 437, 10 => 850, 11 => 437, 13 => 437, 14 => 850, |
|
52 | - 15 => 437, 16 => 850, 17 => 437, 18 => 850, 19 => 932, |
|
53 | - 20 => 850, 21 => 850, 22 => 437, 23 => 850, 24 => 437, |
|
54 | - 25 => 437, 26 => 850, 27 => 437, 28 => 863, 29 => 850, |
|
55 | - 31 => 852, 34 => 852, 35 => 852, 36 => 860, 37 => 850, |
|
56 | - 38 => 866, 55 => 850, 64 => 852, 77 => 936, 78 => 949, |
|
57 | - 79 => 950, 80 => 874, 88 => 1252, 89 => 1252, 100 => 852, |
|
58 | - 101 => 866, 102 => 865, 103 => 861, 104 => 895, 105 => 866, |
|
59 | - 106 => 737, 107 => 857, 108 => 863, 120 => 950, 121 => 949, |
|
60 | - 122 => 936, 123 => 932, 124 => 874, 134 => 737, 135 => 852, |
|
61 | - 136 => 857, 150 => 10007, 151 => 10029, 152 => 10006, 200 => 1250, |
|
62 | - 201 => 1251, 202 => 1254, 203 => 1253, 204 => 1257 |
|
50 | + 1 => 437, 2 => 850, 3 => 1252, 4 => 10000, 8 => 865, |
|
51 | + 9 => 437, 10 => 850, 11 => 437, 13 => 437, 14 => 850, |
|
52 | + 15 => 437, 16 => 850, 17 => 437, 18 => 850, 19 => 932, |
|
53 | + 20 => 850, 21 => 850, 22 => 437, 23 => 850, 24 => 437, |
|
54 | + 25 => 437, 26 => 850, 27 => 437, 28 => 863, 29 => 850, |
|
55 | + 31 => 852, 34 => 852, 35 => 852, 36 => 860, 37 => 850, |
|
56 | + 38 => 866, 55 => 850, 64 => 852, 77 => 936, 78 => 949, |
|
57 | + 79 => 950, 80 => 874, 88 => 1252, 89 => 1252, 100 => 852, |
|
58 | + 101 => 866, 102 => 865, 103 => 861, 104 => 895, 105 => 866, |
|
59 | + 106 => 737, 107 => 857, 108 => 863, 120 => 950, 121 => 949, |
|
60 | + 122 => 936, 123 => 932, 124 => 874, 134 => 737, 135 => 852, |
|
61 | + 136 => 857, 150 => 10007, 151 => 10029, 152 => 10006, 200 => 1250, |
|
62 | + 201 => 1251, 202 => 1254, 203 => 1253, 204 => 1257 |
|
63 | 63 | ]; |
64 | 64 | private $dbase7 = false, $v_foxpro = false; |
65 | 65 | |
66 | 66 | /** |
67 | 67 | * @throws Exception |
68 | 68 | */ |
69 | - public function __construct($dbPath, $charset = null){ |
|
69 | + public function __construct($dbPath, $charset = null) { |
|
70 | 70 | $this->db = $dbPath; |
71 | 71 | if (!is_null($charset)) { |
72 | 72 | if (!is_numeric($charset)) { |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $this->error_info = "Not correct DBF file by headers"; |
143 | 143 | return; |
144 | 144 | } |
145 | - $this->headers["charset_name"] = "cp" . $this->charsets[$this->headers["charset"]]; |
|
145 | + $this->headers["charset_name"] = "cp".$this->charsets[$this->headers["charset"]]; |
|
146 | 146 | |
147 | 147 | if (in_array("dBASE 7", $this->versions[$this->headers["version"]])) { |
148 | 148 | $this->dbase7 = true; |
@@ -159,11 +159,11 @@ discard block |
||
159 | 159 | $this->headers["memo"] = in_array($this->headers["version"], $this->memo["versions"]); |
160 | 160 | } |
161 | 161 | if ($this->headers["memo"]) { |
162 | - $this->headers["memo_file"] = ($mfile = $this->getMemoFile($file["dirname"] . "/" . $file["filename"])) ? $mfile : null; |
|
162 | + $this->headers["memo_file"] = ($mfile = $this->getMemoFile($file["dirname"]."/".$file["filename"])) ? $mfile : null; |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | $this->headers["version_name"] = |
166 | - implode(", ", $this->versions[$this->headers["version"]]) . " " . ($this->headers["memo"] ? "with" : "without") . " memo-fields"; |
|
166 | + implode(", ", $this->versions[$this->headers["version"]])." ".($this->headers["memo"] ? "with" : "without")." memo-fields"; |
|
167 | 167 | unset($this->headers["checks"], $this->headers["header_length"]); |
168 | 168 | } |
169 | 169 | |
@@ -243,10 +243,10 @@ discard block |
||
243 | 243 | |
244 | 244 | // Handle case-insensitive requests |
245 | 245 | $directoryName = dirname($fileName); |
246 | - $fileArray = glob($directoryName . '/*', GLOB_NOSORT); |
|
246 | + $fileArray = glob($directoryName.'/*', GLOB_NOSORT); |
|
247 | 247 | $fileNameLowerCase = strtolower($fileName); |
248 | - foreach($fileArray as $file) { |
|
249 | - if(strtolower($file) == $fileNameLowerCase) { |
|
248 | + foreach ($fileArray as $file) { |
|
249 | + if (strtolower($file) == $fileNameLowerCase) { |
|
250 | 250 | return $file; |
251 | 251 | } |
252 | 252 | } |
@@ -183,8 +183,7 @@ discard block |
||
183 | 183 | "mdx_flag" => unpack("C", $data[37])[1], |
184 | 184 | "auto_increment" => unpack("L", substr($data, 40, 4))[1] |
185 | 185 | ]; |
186 | - } |
|
187 | - else { |
|
186 | + } else { |
|
188 | 187 | $this->columns[$i] = [ |
189 | 188 | "name" => strtolower(trim(substr($data, 0, 11))), |
190 | 189 | "type" => $data[11], |
@@ -202,8 +201,7 @@ discard block |
||
202 | 201 | $this->columns[$i]["auto_increment_next"] = unpack("L", substr($data, 19, 4))[1]; |
203 | 202 | $this->columns[$i]["auto_increment_step"] = unpack("C", $data[23])[1]; |
204 | 203 | } |
205 | - } |
|
206 | - else { |
|
204 | + } else { |
|
207 | 205 | $this->columns[$i]["mdx_flag"] = unpack("C", $data[31])[1]; |
208 | 206 | } |
209 | 207 | } |