#1863 closed Bug/Fehler (fixed)
Magnalister DB Connect Problem
| Reported by: | Owned by: | somebody | |
|---|---|---|---|
| Priority: | normal | Milestone: | modified-shop-2.0.6.0 |
| Component: | Module | Version: | 2.0.5.1 |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: |
Description
Durch die Änderung der configure.php für MySQL Sockets findet der Magnalister die Login Credentials nicht mehr richtig.
Fix:
Datei: MagnaDB.php
protected function detectConnectionType() {
if (strpos($this->accesshost, '
') !== false) {
$this->accesstype = 'pipe'; Windows named pipe based connection. e.g.
.\pipe\MySQL$this->accesssock = $this->accesshost;$this->accesshost = '.';
} else if (strpos($this->accesshost, '.sock') !== false) {
$this->accesstype = 'socket'; Unix domain sockets use the file system as their address name space.$msock = array();if (preg_match('/([\:]+)\:(.*)$/', $this->accesshost, $msock)) {
$this->accesshost = $msock[1];$this->accesssock = $msock[3];
} else {
Hier war der Verweis auf msock[2] drin.
Hauptproblem dabei ist, dass der ganze Shop einen Fehler meldet, wenn der Magnalister aktiviert ist. Die Frage für mich ist, ob die Datei /includes/extra/application_top/application_top_end/40_magnalister.php so überhaupt sinnvoll ist. Eigentlich braucht nur der MagnaCallback die Magnalister Dateien. Normale Shop Dateien sollten das eigentlich nicht brauchen.
Danke.
Attachments (3)
Change History (7)
comment:1 by , 5 years ago
| Component: | Admin → Module |
|---|
comment:2 by , 5 years ago
by , 5 years ago
| Attachment: | MagnaDB.php added |
|---|
by , 5 years ago
| Attachment: | changeset_12862.zip added |
|---|
by , 5 years ago
| Attachment: | changeset_12863.zip added |
|---|

Ich habe folgende korrigierte Funktion detectConnectionType() von Magnalister zurück erhalten und bitte mal um Prüfung:
protected function detectConnectionType() { if (strpos($this->access['host'], '\\') !== false) { $this->access['type'] = 'pipe'; // Windows named pipe based connection. e.g. \\.\pipe\MySQL $this->access['sock'] = $this->access['host']; $this->access['host'] = '.'; } else if (strpos($this->access['host'], '.sock') !== false) { // modified >= 2.0.5.0: $blMsock3 = false; if (is_file(DIR_FS_INC.'get_database_version.inc.php')) { require_once(DIR_FS_INC.'get_database_version.inc.php'); $modified_shop_version = get_database_version(); if ($shop_version['plain'] >= '2.0.5.0') { $blMsock3 = true; } } $this->access['type'] = 'socket'; // Unix domain sockets use the file system as their address name space. $msock = array(); if (preg_match('/^([^\:]+)\:(.*)$/', $this->access['host'], $msock)) { $this->access['host'] = $msock[1]; $this->access['sock'] = $msock[2]; if ($blMsock3) { $this->access['sock'] = $msock[3]; } } else { $this->access['sock'] = $this->access['host']; $this->access['host'] = ''; } } else { $this->access['type'] = 'tcpip'; $mport = array(); if (preg_match('/^[^\:]+\:([0-9]+)$/', $this->access['host'], $mport)) { $this->access['port'] = (int)$mport[1]; $this->access['host'] = str_replace(':'.$this->access['port'], '', $this->access['host']); } else { $this->access['port'] = (int)ini_get('mysqli.default_port'); } if (empty($this->access['port'])) { $this->access['port'] = 3306; } } // for non tcpip connections if (empty($this->access['port'])) { $this->access['port'] = (int)ini_get('mysqli.default_port'); } }