summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorRobin Millette <millette@controlyourself.ca>2009-05-31 17:12:04 -0400
committerRobin Millette <millette@controlyourself.ca>2009-05-31 17:12:04 -0400
commitebeb5f744cbfd5bfea0da1b350a3757865ec4b3b (patch)
treee94ceadeeba967759cb332211a5adb5d6dceab0b /classes
parent3e0c291810d23bb54c337c0fe95c1ba441459c4c (diff)
parent36fe5a85b2de9f71a5c963abd0074dd5b7ae1e61 (diff)
Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into upload
Conflicts: js/util.js lib/attachmentlist.php
Diffstat (limited to 'classes')
-rw-r--r--classes/Foreign_link.php2
-rw-r--r--classes/Memcached_DataObject.php18
2 files changed, 19 insertions, 1 deletions
diff --git a/classes/Foreign_link.php b/classes/Foreign_link.php
index 606560951..c0b356ece 100644
--- a/classes/Foreign_link.php
+++ b/classes/Foreign_link.php
@@ -11,7 +11,7 @@ class Foreign_link extends Memcached_DataObject
public $__table = 'foreign_link'; // table name
public $user_id; // int(4) primary_key not_null
- public $foreign_id; // int(4) primary_key not_null
+ public $foreign_id; // bigint(8) primary_key not_null unsigned
public $service; // int(4) primary_key not_null
public $credentials; // varchar(255)
public $noticesync; // tinyint(1) not_null default_1
diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php
index 5f71f716b..52ad4100f 100644
--- a/classes/Memcached_DataObject.php
+++ b/classes/Memcached_DataObject.php
@@ -227,4 +227,22 @@ class Memcached_DataObject extends DB_DataObject
$c->set($ckey, $cached, MEMCACHE_COMPRESSED, $expiry);
return new ArrayWrapper($cached);
}
+
+ // We overload so that 'SET NAMES "utf8"' is called for
+ // each connection
+
+ function _connect()
+ {
+ global $_DB_DATAOBJECT;
+ $exists = !empty($this->_database_dsn_md5) &&
+ isset($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]);
+ $result = parent::_connect();
+ if (!$exists) {
+ $DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
+ if (common_config('db', 'utf8')) {
+ $DB->query('SET NAMES "utf8"');
+ }
+ }
+ return $result;
+ }
}