From 8c8eb83239bfbd239ccd7805161cc587930b28ab Mon Sep 17 00:00:00 2001 From: rMalie Date: Wed, 21 Sep 2011 07:46:12 +0000 Subject: [PATCH] // Fix install with Db --- classes/db/Db.php | 2 +- install-dev/classes/ToolsInstall.php | 54 ++++++++++++++-------------- install-dev/xml/checkShopInfos.php | 6 ++-- install-dev/xml/createDB.php | 2 +- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/classes/db/Db.php b/classes/db/Db.php index 586b50dd0..30c9f367b 100644 --- a/classes/db/Db.php +++ b/classes/db/Db.php @@ -511,7 +511,7 @@ abstract class DbCore */ static public function checkEncoding($server, $user, $pwd) { - return call_user_func_array(array(Db::getClass(), 'tryToConnect'), array($server, $user, $pwd)); + return call_user_func_array(array(Db::getClass(), 'tryUTF8'), array($server, $user, $pwd)); } /** diff --git a/install-dev/classes/ToolsInstall.php b/install-dev/classes/ToolsInstall.php index d09db608d..389ed74d1 100644 --- a/install-dev/classes/ToolsInstall.php +++ b/install-dev/classes/ToolsInstall.php @@ -1,6 +1,6 @@ setUsername($smtpLogin); $smtp->setpassword($smtpPassword); @@ -129,9 +129,9 @@ class ToolsInstall { $swift = new Swift(new Swift_Connection_NativeMail()); } - + $message = new Swift_Message($subject, $content, $type); - + if ($swift->send($message, $to, $from)) { $result = true; @@ -150,15 +150,15 @@ class ToolsInstall { $result = $e->getCode(); } - return $result; + return $result; } - + public static function getNotificationMail($shopName, $shopUrl, $shopLogo, $firstname, $lastname, $password, $email) { $iso_code = $_GET['isoCodeLocalLanguage']; $pathTpl = INSTALL_PATH.'/../mails/en/employee_password.html'; $pathTplLocal = INSTALL_PATH.'/../mails/'.$iso_code.'/employee_password.html'; - + $content = (file_exists($pathTplLocal)) ? file_get_contents($pathTplLocal) : file_get_contents($pathTpl); $content = str_replace('{shop_name}', $shopName, $content); $content = str_replace('{shop_url}', $shopUrl, $content); @@ -169,7 +169,7 @@ class ToolsInstall $content = str_replace('{email}', $email, $content); return $content; } - + public static function getLangString($idLang) { switch ($idLang) @@ -192,19 +192,19 @@ class ToolsInstall return mb_strtoupper($str, 'utf-8'); return strtoupper($str); } - + static function ucfirst($str) { return self::strtoupper(self::substr($str, 0, 1)).self::substr($str, 1); } - + static function substr($str, $start, $length = false, $encoding = 'utf-8') { if (function_exists('mb_substr')) return mb_substr($str, $start, ($length === false ? self::strlen($str) : $length), $encoding); return substr($str, $start, $length); } - + static function strlen($str) { if (function_exists('mb_strlen')) diff --git a/install-dev/xml/checkShopInfos.php b/install-dev/xml/checkShopInfos.php index f3a3faf66..5f8808c37 100644 --- a/install-dev/xml/checkShopInfos.php +++ b/install-dev/xml/checkShopInfos.php @@ -32,7 +32,7 @@ define('_PS_MAGIC_QUOTES_GPC_', get_magic_quotes_gpc()); require_once(INSTALL_PATH.'/classes/AddConfToFile.php'); require_once(INSTALL_PATH.'/../classes/Validate.php'); -require_once(INSTALL_PATH.'/../classes/Db.php'); +require_once(INSTALL_PATH.'/../classes/db/Db.php'); require_once(INSTALL_PATH.'/../classes/Tools.php'); require_once(INSTALL_PATH.'/../config/settings.inc.php'); @@ -89,7 +89,7 @@ if (!isset($_GET['infosCountry']) OR empty($_GET['infosCountry'])) $error['infosCountry'] = '0'; else $error['infosCountry'] = ''; - + if (!isset($_GET['infosTimezone']) OR empty($_GET['infosTimezone'])) $error['infosTimezone'] = '0'; else @@ -268,7 +268,7 @@ if (isFormValid()) { $sqlParams[] = 'DELETE c, cl FROM `'._DB_PREFIX_.'cms` AS c LEFT JOIN `'._DB_PREFIX_.'cms_lang` AS cl ON c.id_cms = cl.id_cms WHERE 1 AND c.`id_cms` IN (1, 5)'; } - + $dbInstance = Db::getInstance(); foreach($sqlParams as $query) if(!$dbInstance->Execute($query)) diff --git a/install-dev/xml/createDB.php b/install-dev/xml/createDB.php index 08b1b5aca..db6f2938c 100644 --- a/install-dev/xml/createDB.php +++ b/install-dev/xml/createDB.php @@ -38,7 +38,7 @@ if (file_exists(SETTINGS_FILE)) require_once(INSTALL_PATH.'/classes/AddConfToFile.php'); require_once(INSTALL_PATH.'/../classes/Validate.php'); -require_once(INSTALL_PATH.'/../classes/Db.php'); +require_once(INSTALL_PATH.'/../classes/db/Db.php'); require_once(INSTALL_PATH.'/../classes/Tools.php'); global $logger;