summaryrefslogtreecommitdiff
path: root/app/models/Feed.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-30 13:15:54 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-30 13:15:54 +0100
commite98b7ab13ec414d1c5c3c3d1d6a7c9995ebf4fea (patch)
tree3617c9fc2eb4e05b52a3ab8114369802ce288dfa /app/models/Feed.php
parentae09cbec4237c903b8c83c0dc5cc8051195c030a (diff)
SQL : compression côté base de données (attention, perte de compatibilité)
Ça y est, j'ai tout cassé... Contribue à https://github.com/marienfressinaud/FreshRSS/issues/204 Compatible MySQL 5.0. Commentaires souhaités avant l'implémentation de la recherche côté base de données. Pour l'instant, je n'ai pas fait de script de mise à jour, car la manière précédente `base64_encode(gzdeflate(serialize($content)))` est difficile à traiter côté MySQL et nécessite une boucle en PHP. Avec la nouvelle approche de ce patch, nous pourrons plus facilement changer d'avis sans perte de compatibilité.
Diffstat (limited to 'app/models/Feed.php')
-rw-r--r--app/models/Feed.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/models/Feed.php b/app/models/Feed.php
index 2260f6fdf..954d1d45c 100644
--- a/app/models/Feed.php
+++ b/app/models/Feed.php
@@ -408,6 +408,16 @@ class FeedDAO extends Model_pdo {
}
public function deleteFeed ($id) {
+ /*//For MYISAM (MySQL 5.5-) without FOREIGN KEY
+ $sql = 'DELETE FROM `' . $this->prefix . 'entry` WHERE id_feed=?';
+ $stm = $this->bd->prepare ($sql);
+ $values = array ($id);
+ if (!($stm && $stm->execute ($values))) {
+ $info = $stm->errorInfo();
+ Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+ return false;
+ }*/
+
$sql = 'DELETE FROM `' . $this->prefix . 'feed` WHERE id=?';
$stm = $this->bd->prepare ($sql);
@@ -422,6 +432,18 @@ class FeedDAO extends Model_pdo {
}
}
public function deleteFeedByCategory ($id) {
+ /*//For MYISAM (MySQL 5.5-) without FOREIGN KEY
+ $sql = 'DELETE FROM `' . $this->prefix . 'entry` e '
+ . 'INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
+ . 'WHERE f.category=?';
+ $stm = $this->bd->prepare ($sql);
+ $values = array ($id);
+ if (!($stm && $stm->execute ($values))) {
+ $info = $stm->errorInfo();
+ Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+ return false;
+ }*/
+
$sql = 'DELETE FROM `' . $this->prefix . 'feed` WHERE category=?';
$stm = $this->bd->prepare ($sql);