// Normalize
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user