Skip to content

Commit

Permalink
Symphony 2.3 compatibility update.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alistair Kearney committed Sep 16, 2012
1 parent e575bc5 commit 51d3782
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions extension.driver.php
Expand Up @@ -5,12 +5,12 @@
public function about(){
return array(
'name' => 'Advanced Symphony Database Connector (ASDC)',
'version' => '1.4',
'release-date' => '2010-07-22',
'version' => '1.5',
'release-date' => '2012-09-16',
'author' => array(
'name' => 'Alistair Kearney',
'website' => 'http://pointybeard.com',
'email' => 'alistair@pointybeard.com')
'website' => 'http://alistairkearney.com',
'email' => 'hi@alistairkearney.com')
);
}

Expand Down
3 changes: 3 additions & 0 deletions extension.meta.xml
Expand Up @@ -14,6 +14,9 @@
</author>
</authors>
<releases>
<release version="1.5" date="2012-09-16" min="2.3" max="2.3.x">
- Updated to work with Symphony 2.3.x. Dropped support for lower versions. Please use v 1.4.
</release>
<release version="1.4" date="2010-07-22" min="2.0.6" max="2.2.x">
- Few tweaks to prevent the Log filling up with warnings
</release>
Expand Down
8 changes: 4 additions & 4 deletions lib/class.asdc.php
Expand Up @@ -30,7 +30,7 @@ static public function instance($enableProfiling=false){

static private function __init($enableProfiling=false){

$details = (object)Symphony::$Configuration->get('database');
$details = (object)Symphony::Configuration()->get('database');

$driver = 'ASDCMySQL';
if($enableProfiling) $driver .= 'Profiler';
Expand Down Expand Up @@ -274,7 +274,7 @@ public function insert(array $fields, $table){
foreach($this->cleanFields($fields) as $key => $val)
$rows[] = " `$key` = $val";

$this->query("INSERT INTO $table SET " . implode(', ', $rows));
$this->query("INSERT INTO `{$table}` SET " . implode(', ', $rows));

return mysql_insert_id($this->_connection);
}
Expand All @@ -283,11 +283,11 @@ public function update(array $fields, $table, $where=NULL){
foreach($this->cleanFields($fields) as $key => $val)
$rows[] = " `$key` = $val";

return $this->query("UPDATE $table SET " . implode(', ', $rows) . ($where != NULL ? " WHERE $where" : NULL));
return $this->query("UPDATE `{$table}` SET " . implode(', ', $rows) . ($where != NULL ? " WHERE {$where}" : NULL));
}

public function delete($table, $where){
return $this->query("DELETE FROM `$table` WHERE $where");
return $this->query("DELETE FROM `{$table}` WHERE {$where}");
}

public function truncate($table){
Expand Down

0 comments on commit 51d3782

Please sign in to comment.