Opened 11 months ago

Closed 11 months ago

Last modified 11 months ago

#1863 closed Bug/Fehler (fixed)

Magnalister DB Connect Problem

Reported by: ckoch@… Owned by: somebody
Priority: normal Milestone: modified-shop-2.0.6.0
Component: Module Version: 2.0.5.1

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)

MagnaDB.php (38.1 KB) - added by Tomcraft 11 months ago.
changeset_12862.zip (964.5 KB) - added by Tomcraft 11 months ago.
changeset_12863.zip (6.0 KB) - added by Tomcraft 11 months ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 11 months ago by Tomcraft

  • Component changed from Admin to Module

comment:2 Changed 11 months ago by Tomcraft

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');
		}
	}

Changed 11 months ago by Tomcraft

comment:3 Changed 11 months ago by Tomcraft

  • Resolution set to fixed
  • Status changed from new to closed

In 12862:

fix #1863 - Updated magnalister build version 7832 to latest modified-shop compatible build version 8106

Changed 11 months ago by Tomcraft

comment:4 Changed 11 months ago by Tomcraft

In 12863:

fix r12862 (fix #1863 - Updated magnalister build version 7832 to latest modified-shop compatible build version 8106)

Changed 11 months ago by Tomcraft

Add Comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.