// Normalize

This commit is contained in:
rMalie
2012-01-24 17:30:33 +00:00
parent e63c477ec5
commit d2ae1b632a
22 changed files with 288 additions and 294 deletions
+6 -6
View File
@@ -14,7 +14,7 @@
abstract class ImportModuleCore extends Module
{
protected $_link = NULL;
protected $_link = null;
public $server;
@@ -30,17 +30,17 @@ abstract class ImportModuleCore extends Module
public function __destruct()
{
if($this->_link)
if ($this->_link)
@mysql_close($this->_link);
}
protected function initDatabaseConnection()
{
if ($this->_link != NULL)
if ($this->_link != null)
return $this->_link;
if ($this->_link = mysql_connect($this->server, $this->user, $this->passwd, true))
{
if(!mysql_select_db($this->database, $this->_link))
if (!mysql_select_db($this->database, $this->_link))
die(Tools::displayError('The database selection cannot be made.'));
if (!mysql_query('SET NAMES \'utf8\'', $this->_link))
die(Tools::displayError('PrestaShop Fatal error: no utf-8 support. Please check your server configuration.'));
@@ -71,7 +71,7 @@ abstract class ImportModuleCore extends Module
{
$this->initDatabaseConnection();
$result = $this->executeS($query);
if (!sizeof($result))
if (!count($result))
return 0;
else
return array_shift($result[0]);
@@ -81,7 +81,7 @@ abstract class ImportModuleCore extends Module
{
$modules = Module::getModulesOnDisk(true);
foreach ($modules as $key => $module)
if(get_parent_class($module) != 'ImportModule')
if (get_parent_class($module) != 'ImportModule')
unset($modules[$key]);
return $modules;
}