Cosmetics : remove spaces at the end of lines and correct lines with more than 80 chars
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1643 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
24
dblayer.php
24
dblayer.php
@@ -24,7 +24,7 @@ To use it, extends in your code this class, and define the attributes :
|
||||
the dbLayer abstraction don't supports primary key on multiples columns
|
||||
- protected $unique = array ("column", array ("column1", "column2");)
|
||||
|
||||
Optionnaly, you can add the
|
||||
Optionnaly, you can add the
|
||||
- protected $debug = TRUE : enable the debug on screen (NOT FOR PROD !!)
|
||||
*/
|
||||
|
||||
@@ -444,7 +444,7 @@ class dblayer extends PDO
|
||||
return $res;
|
||||
}
|
||||
|
||||
/** Update the key tuple with the provided datas
|
||||
/** Update the key tuple with the provided datas
|
||||
Return the number of rows modified
|
||||
@param string|integer $updatekey The key applied on primary key to be
|
||||
updated
|
||||
@@ -557,7 +557,7 @@ class dblayer extends PDO
|
||||
}
|
||||
else
|
||||
{
|
||||
// One column in unique
|
||||
// One column in unique
|
||||
if (!array_key_exists ($columns, $datasOK)) continue;
|
||||
$select = array ();
|
||||
if ($columns === $this->primary)
|
||||
@@ -690,7 +690,7 @@ class dblayer extends PDO
|
||||
}
|
||||
|
||||
/** Create the table defined by the differents fields.
|
||||
Define the SQL syntax based on SQL engines
|
||||
Define the SQL syntax based on SQL engines
|
||||
$table = "dns zones";
|
||||
$fields = array (
|
||||
"id"=>array ("integer", "not null", "autoincrement"),
|
||||
@@ -755,7 +755,7 @@ class dblayer extends PDO
|
||||
if ($this->primary === $field)
|
||||
$sql .= " PRIMARY KEY";
|
||||
// Others parameters for field
|
||||
// Sort to put the autoincrement field in front of params, if it is
|
||||
// Sort to put the autoincrement field in front of params, if it is
|
||||
// present
|
||||
sort ($params);
|
||||
foreach ($params as $p)
|
||||
@@ -842,7 +842,7 @@ class dblayer extends PDO
|
||||
if ($this->primary === $field)
|
||||
$sql .= " PRIMARY KEY";
|
||||
// Others parameters for field
|
||||
// Sort to put the autoincrement field in front of params, if it is
|
||||
// Sort to put the autoincrement field in front of params, if it is
|
||||
// present
|
||||
sort ($params);
|
||||
foreach ($params as $p)
|
||||
@@ -876,7 +876,6 @@ class dblayer extends PDO
|
||||
$i = 0;
|
||||
foreach ($this->foreign as $field=>$k)
|
||||
{
|
||||
|
||||
$sql .= ",\n FOREIGN KEY(`$field`) REFERENCES `".$k[0]."`(`".
|
||||
$k[1]."`)";
|
||||
if (isset ($k[2]))
|
||||
@@ -936,7 +935,7 @@ class dblayer extends PDO
|
||||
if ($this->primary === $field)
|
||||
$sql .= " PRIMARY KEY";
|
||||
// Others parameters for field
|
||||
// Sort to put the autoincrement field in front of params, if it is
|
||||
// Sort to put the autoincrement field in front of params, if it is
|
||||
// present
|
||||
sort ($params);
|
||||
foreach ($params as $p)
|
||||
@@ -988,7 +987,7 @@ class dblayer extends PDO
|
||||
echo "$sql\n";
|
||||
return $this->db->exec($sql);
|
||||
}
|
||||
|
||||
|
||||
/** This function permit to send a SQL request to the database to do a SELECT
|
||||
Return the an array with the datas */
|
||||
public function directRead ($sql)
|
||||
@@ -1007,7 +1006,7 @@ error_reporting (E_ALL);
|
||||
require_once ("domframework/dbLayer.php");
|
||||
class zone extends dbLayer
|
||||
{
|
||||
// The database must be initialized with
|
||||
// The database must be initialized with
|
||||
// CREATE TABLE `dns_zones` (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
// zone VARCHAR(255) NOT NULL,
|
||||
// viewname VARCHAR(255),
|
||||
@@ -1015,7 +1014,7 @@ class zone extends dbLayer
|
||||
// comment VARCHAR(1024),
|
||||
// opendate DATETIME NOT NULL,
|
||||
// closedate DATETIME,
|
||||
// UNIQUE (zone,viewname));
|
||||
// UNIQUE (zone,viewname));
|
||||
protected $table = "dns_zones";
|
||||
protected $fields = array (
|
||||
"id"=>array ("integer", "not null", "autoincrement"),
|
||||
@@ -1032,7 +1031,8 @@ class zone extends dbLayer
|
||||
|
||||
ini_set ("date.timezone", "Europe/Paris");
|
||||
$zone = new zone ("sqlite:datas/database.db");
|
||||
$last = $zone->create (array ("zone"=>"testZone", "opendate"=>date("Y-m-d H:i:s")));
|
||||
$last = $zone->create (array ("zone"=>"testZone",
|
||||
"opendate"=>date("Y-m-d H:i:s")));
|
||||
//print_r ($zone->read ());
|
||||
$zone->update (2040, array ("zone"=>"testZone2"));
|
||||
print_r ($zone->delete ($last));
|
||||
|
||||
Reference in New Issue
Block a user