Permalink
Browse files

Fix sqlite calls

  • Loading branch information...
1 parent 6a7240d commit 8aa6a0ee120be7bf7d132fa560ddf5bb86230315 @cdujeu cdujeu committed Oct 7, 2016
Showing with 3 additions and 4 deletions.
  1. +2 −3 core/src/plugins/mq.sql/SqlMessageExchanger.php
  2. +1 −1 core/src/plugins/mq.sql/create.sqlite
@@ -88,10 +88,9 @@ public function loadChannel($channelName, $create = false)
}catch(\DibiException $db){
dibi::connect($this->sqlDriver);
}
- $res = dibi::query('SELECT [content] FROM [ajxp_mq_queues] WHERE [channel_name] = %s', $channelName);
- if($res->count()){
+ $single = dibi::query('SELECT [content] FROM [ajxp_mq_queues] WHERE [channel_name] = %s', $channelName)->fetchSingle();
+ if(!empty($single)){
if(!isset(self::$channels)) self::$channels = array();
- $single = $res->fetchSingle();
$data = unserialize(gzinflate($single));
if (is_array($data)) {
if(!is_array($data["MESSAGES"])) $data["MESSAGES"] = array();
@@ -1,4 +1,4 @@
CREATE TABLE IF NOT EXISTS ajxp_mq_queues (
channel_name TEXT NOT NULL PRIMARY KEY,
- content BLOB NOT NULL,
+ content BLOB NOT NULL
);

0 comments on commit 8aa6a0e

Please sign in to comment.