// MERGE with 1.4 r7770
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7776 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+12
-7
@@ -47,7 +47,7 @@ class MySQLCore extends Db
|
||||
|
||||
return $this->_link;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see DbCore::disconnect()
|
||||
*/
|
||||
@@ -137,11 +137,19 @@ class MySQLCore extends Db
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DbCore::tryToConnect()
|
||||
* tryToConnect return 0 if the connection succeed and the database can be selected.
|
||||
* @since 1.4.4.0, the parameter $newDbLink (default true) has been added.
|
||||
*
|
||||
* @param string $server mysql server name
|
||||
* @param string $user mysql user
|
||||
* @param string $pwd mysql user password
|
||||
* @param string $db mysql database name
|
||||
* @param boolean $newDbLink if set to true, the function will not create a new link if one already exists.
|
||||
* @return integer
|
||||
*/
|
||||
static public function tryToConnect($server, $user, $pwd, $db)
|
||||
public static function tryToConnect($server, $user, $pwd, $db, $newDbLink = true)
|
||||
{
|
||||
if (!$link = @mysql_connect($server, $user, $pwd))
|
||||
if (!$link = @mysql_connect($server, $user, $pwd, $newDbLink))
|
||||
return 1;
|
||||
if (!@mysql_select_db($db, $link))
|
||||
return 2;
|
||||
@@ -149,9 +157,6 @@ class MySQLCore extends Db
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DbCore::tryUTF8()
|
||||
*/
|
||||
static public function tryUTF8($server, $user, $pwd)
|
||||
{
|
||||
$link = @mysql_connect($server, $user, $pwd);
|
||||
|
||||
Reference in New Issue
Block a user