Permalink
Browse files

Does some files cleaning.

  • Loading branch information...
JB Lebrun
JB Lebrun committed Nov 5, 2018
1 parent b5fc230 commit 4bf6b00ac284e8999d12f2044419fc355dbd0341
@@ -420,4 +420,4 @@ final class Database_connection {
$this->close();
}
}
?>
?>
@@ -36,7 +36,7 @@ abstract class ModuleLibraryItem {
*/
public $value;
/**
* Load value from array.
* @param array $data
@@ -162,4 +162,4 @@ abstract class ModuleLibraryItem {
return explode($sep, $v);
}
}
?>
?>
@@ -18,7 +18,7 @@
*/
final class MySQLiDBConnection extends CDBConnection {
/* server related methods */
/**
* Connect to server.
* @param string $host
@@ -30,12 +30,12 @@ final class MySQLiDBConnection extends CDBConnection {
public function connect_server($host='localhost', $login='', $pwd='', $driver='') {
/* database server connection */
$this->connection = @(new MySQLi($host, $login, $pwd, ''));
/* check if connection is made successfully */
$this->active = ($this->connection->connect_errno === 0);
return $this->active;
}
/**
* Close server connection.
* @return boolean success
@@ -44,11 +44,11 @@ final class MySQLiDBConnection extends CDBConnection {
if ($this->is_connectionActive())
if ($this->connection->close())
$this->active = false;
else
else
return false;
return true;
}
/**
* Return database engine version.
* @return string
@@ -58,9 +58,9 @@ final class MySQLiDBConnection extends CDBConnection {
return $this->connection->server_info;
return '';
}
/* database related methods */
/**
* Select database.
* @param string $name the database name
@@ -73,7 +73,7 @@ final class MySQLiDBConnection extends CDBConnection {
$this->dbName = $name;
return $this->connection->select_db($name);
}
/**
* Create a database.
* @param string $name
@@ -92,7 +92,7 @@ final class MySQLiDBConnection extends CDBConnection {
public function database_exists($name) {
return $this->connection->select_db($name);
}
/**
* Dump database.
* @param mixed $file
@@ -170,9 +170,9 @@ final class MySQLiDBConnection extends CDBConnection {
public function get_databaseSize() {
/* init size */
$size = 0;
/* get infos from database */
if ($this->execute_query('show table status')) {
if ($this->execute_query('show table status')) {
/* set size with infos */
while ($data = $this->get_queryDataLine()) {
$size += $data["Data_length"] + $data["Index_length"];
@@ -181,7 +181,7 @@ final class MySQLiDBConnection extends CDBConnection {
}
return 0;
}
/**
* Return database information summary.
* @return array
@@ -339,13 +339,13 @@ final class MySQLiDBConnection extends CDBConnection {
}
$sql .= ' PRIMARY KEY(`'.implode('`,`', $primaryKeys).'`))';
$sql .= ' CHARACTER SET '.$charset.'';
/* return result of sql query execution */
return ($this->execute_query($sql) or $camyks->log_sqlerror($this, $sql, __FILE__, __LINE__));
}
/* query related methods */
/**
* Execute query.
* @param string $sql
@@ -376,7 +376,7 @@ final class MySQLiDBConnection extends CDBConnection {
return $this->queryRes[$resName]->fetch_assoc();
return false;
}
/**
* Return next query data line with numeric indexes.
* @param string $resName
@@ -405,18 +405,18 @@ final class MySQLiDBConnection extends CDBConnection {
public function get_queryAffectedRows($resName='defaultRes') {
return $this->connection->affected_rows;
}
/**
* Return latest query field count.
* @param string $resName
* @return integer
* @return integer
*/
public function get_queryFieldCount($resName='defaultRes') {
if (isset($this->queryRes[$resName]))
return $this->queryRes[$resName]->field_count;
return '';
}
/**
* Return latest query field type.
* @param integer $fIndex
@@ -430,7 +430,7 @@ final class MySQLiDBConnection extends CDBConnection {
}
return false;
}
/**
* Close ressource.
* @param string $resName
@@ -441,9 +441,9 @@ final class MySQLiDBConnection extends CDBConnection {
return $this->queryRes[$resName]->close();
return true;
}
/* data related methods */
/**
* Return escaped string.
* @param string $string
@@ -452,7 +452,7 @@ final class MySQLiDBConnection extends CDBConnection {
public function escape_string($string) {
return mysqli_real_escape_string($this->connection, $string);
}
/**
* Return mysql compatible type from given type.
* @param integer $type
@@ -462,23 +462,23 @@ final class MySQLiDBConnection extends CDBConnection {
switch ($type) {
/* int */
case 1 /* tinyint */: case 2 /* smallint */: case 3 /* int */: case 8 /* bigint */: case 9 /* mediumint */: case 16 /* bit */: return 'int';
/* float */
case 4 /* float */: case 5 /* double */: case 246 /* decimal*/: return 'real';
/* date & time */
case 7: return 'timestamp';
case 10: return 'date';
case 11: return 'time';
case 12: return 'datetime';
case 13: return 'year';
/* blobs */
case 252: return 'blob';
/* texts */
case 253 /* varchar */ : case 254 /* char */: return 'string';
}
return '';
}
}
}
@@ -89,30 +89,27 @@ function PerpetualCalendar(name) {
return;
}


/* add item to item list */
if (!this.items[my])
this.items[my] = new Array();
this.items[my] = new Array();

if (!this.items[my][day])
this.items[my][day] = new Array();
this.items[my][day] = new Array();

this.items[my][day][this.items[my][day].length] = item;


/* check if master object is loaded */
if (this.loaded == false)
return;

/* check if day is in displayed month */
if (date.getMonth() != this.get_param('date').getMonth()
|| date.getFullYear() != this.get_param('date').getFullYear())
if (date.getMonth() != this.get_param('date').getMonth() || date.getFullYear() != this.get_param('date').getFullYear())
return;

/* update cell */
cell = document.getElementById(this.name + 'Cell' + day);
if (this.items[my][day].length > 1 && this.get_param('multiItem')['enabled'] == 1)
this._set_cellProperties(cell, this.get_param('multiItem'), day);
this._set_cellProperties(cell, this.get_param('multiItem'), day);
else
this._set_cellProperties(cell, item, day);
};
@@ -125,12 +122,12 @@ function PerpetualCalendar(name) {
* @access public
*/
this.remove_items = function(date, day) {
my = date.getFullYear()+'-'+date.getMonth();
my = date.getFullYear()+'-'+date.getMonth();

if (day == undefined)
this.items[my] = new Array();
else
this.items[my][day] = new Array();
if (day == undefined)
this.items[my] = new Array();
else
this.items[my][day] = new Array();
}

/*
@@ -338,10 +335,10 @@ function PerpetualCalendar(name) {

/* check item list */
if (items != false ) {
if (items.length > 1 && this.get_param('multiItem')['enabled'] == 1)
this._set_cellProperties(c, this.get_param('multiItem'), day);
else
this._set_cellProperties(c, items[0], day);
if (items.length > 1 && this.get_param('multiItem')['enabled'] == 1)
this._set_cellProperties(c, this.get_param('multiItem'), day);
else
this._set_cellProperties(c, items[0], day);
} else {
this._set_cellProperties(c, this.get_param('defaultItem'), day);
}
Oops, something went wrong.

0 comments on commit 4bf6b00

Please sign in to comment.