summaryrefslogtreecommitdiff
path: root/app/Models
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-05 19:35:29 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-05 19:35:29 +0200
commitd8f4681382986524b91acb0500847e9f24badf20 (patch)
tree588741361a54d564bcce44e239157f38527fefe4 /app/Models
parentaa8529b2d617137cc7500742090e5bb2246b8928 (diff)
Replace Minz_Log::record by corresponding methods
Please not use Minz_Log::record anymore! See https://github.com/marienfressinaud/FreshRSS/issues/655
Diffstat (limited to 'app/Models')
-rw-r--r--app/Models/CategoryDAO.php6
-rw-r--r--app/Models/EntryDAO.php30
-rw-r--r--app/Models/EntryDAOSQLite.php14
-rw-r--r--app/Models/FeedDAO.php20
-rw-r--r--app/Models/FeedDAOSQLite.php2
-rw-r--r--app/Models/UserDAO.php4
6 files changed, 38 insertions, 38 deletions
diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php
index ce1babfdd..2e333d2f1 100644
--- a/app/Models/CategoryDAO.php
+++ b/app/Models/CategoryDAO.php
@@ -13,7 +13,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo {
return $this->bd->lastInsertId();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error addCategory: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error addCategory: ' . $info[2] );
return false;
}
}
@@ -44,7 +44,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error updateCategory: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error updateCategory: ' . $info[2]);
return false;
}
}
@@ -59,7 +59,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error deleteCategory: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error deleteCategory: ' . $info[2]);
return false;
}
}
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index 34717123c..5a136499a 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -40,11 +40,11 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
if ((int)($info[0] / 1000) !== 23) { //Filter out "SQLSTATE Class code 23: Constraint Violation" because of expected duplicate entries
- Minz_Log::record('SQL error addEntry: ' . $info[0] . ': ' . $info[1] . ' ' . $info[2]
- . ' while adding entry in feed ' . $valuesTmp['id_feed'] . ' with title: ' . $valuesTmp['title'], Minz_Log::ERROR);
+ Minz_Log::error('SQL error addEntry: ' . $info[0] . ': ' . $info[1] . ' ' . $info[2]
+ . ' while adding entry in feed ' . $valuesTmp['id_feed'] . ' with title: ' . $valuesTmp['title']);
} /*else {
- Minz_Log::record ('SQL error ' . $info[0] . ': ' . $info[1] . ' ' . $info[2]
- . ' while adding entry in feed ' . $valuesTmp['id_feed'] . ' with title: ' . $valuesTmp['title'], Minz_Log::DEBUG);
+ Minz_Log::debug('SQL error ' . $info[0] . ': ' . $info[1] . ' ' . $info[2]
+ . ' while adding entry in feed ' . $valuesTmp['id_feed'] . ' with title: ' . $valuesTmp['title']);
}*/
return false;
}
@@ -94,7 +94,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markFavorite: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markFavorite: ' . $info[2]);
return false;
}
}
@@ -124,7 +124,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
return true;
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error updateCacheUnreads: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error updateCacheUnreads: ' . $info[2]);
return false;
}
}
@@ -147,7 +147,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markRead: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markRead: ' . $info[2]);
return false;
}
$affected = $stm->rowCount();
@@ -166,7 +166,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markRead: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markRead: ' . $info[2]);
return false;
}
}
@@ -175,7 +175,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
public function markReadEntries($idMax = 0, $onlyFavorites = false, $priorityMin = 0) {
if ($idMax == 0) {
$idMax = time() . '000000';
- Minz_Log::record('Calling markReadEntries(0) is deprecated!', Minz_Log::DEBUG);
+ Minz_Log::debug('Calling markReadEntries(0) is deprecated!');
}
$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id '
@@ -190,7 +190,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markReadEntries: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markReadEntries: ' . $info[2]);
return false;
}
$affected = $stm->rowCount();
@@ -203,7 +203,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
public function markReadCat($id, $idMax = 0) {
if ($idMax == 0) {
$idMax = time() . '000000';
- Minz_Log::record('Calling markReadCat(0) is deprecated!', Minz_Log::DEBUG);
+ Minz_Log::debug('Calling markReadCat(0) is deprecated!');
}
$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id '
@@ -213,7 +213,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markReadCat: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markReadCat: ' . $info[2]);
return false;
}
$affected = $stm->rowCount();
@@ -226,7 +226,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
public function markReadFeed($id, $idMax = 0) {
if ($idMax == 0) {
$idMax = time() . '000000';
- Minz_Log::record('Calling markReadFeed(0) is deprecated!', Minz_Log::DEBUG);
+ Minz_Log::debug('Calling markReadFeed(0) is deprecated!');
}
$this->bd->beginTransaction();
@@ -237,7 +237,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markReadFeed: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markReadFeed: ' . $info[2]);
$this->bd->rollBack();
return false;
}
@@ -251,7 +251,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markReadFeed: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markReadFeed: ' . $info[2]);
$this->bd->rollBack();
return false;
}
diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php
index 9dc395c3c..66078aca9 100644
--- a/app/Models/EntryDAOSQLite.php
+++ b/app/Models/EntryDAOSQLite.php
@@ -26,7 +26,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
return true;
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error updateCacheUnreads: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error updateCacheUnreads: ' . $info[2]);
return false;
}
}
@@ -47,7 +47,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markRead 1: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markRead 1: ' . $info[2]);
$this->bd->rollBack();
return false;
}
@@ -59,7 +59,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markRead 2: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markRead 2: ' . $info[2]);
$this->bd->rollBack();
return false;
}
@@ -72,7 +72,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
public function markReadEntries($idMax = 0, $onlyFavorites = false, $priorityMin = 0) {
if ($idMax == 0) {
$idMax = time() . '000000';
- Minz_Log::record('Calling markReadEntries(0) is deprecated!', Minz_Log::DEBUG);
+ Minz_Log::debug('Calling markReadEntries(0) is deprecated!');
}
$sql = 'UPDATE `' . $this->prefix . 'entry` SET is_read=1 WHERE is_read=0 AND id <= ?';
@@ -85,7 +85,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markReadEntries: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markReadEntries: ' . $info[2]);
return false;
}
$affected = $stm->rowCount();
@@ -98,7 +98,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
public function markReadCat($id, $idMax = 0) {
if ($idMax == 0) {
$idMax = time() . '000000';
- Minz_Log::record('Calling markReadCat(0) is deprecated!', Minz_Log::DEBUG);
+ Minz_Log::debug('Calling markReadCat(0) is deprecated!');
}
$sql = 'UPDATE `' . $this->prefix . 'entry` '
@@ -109,7 +109,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markReadCat: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markReadCat: ' . $info[2]);
return false;
}
$affected = $stm->rowCount();
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php
index b89ae2045..852de6e36 100644
--- a/app/Models/FeedDAO.php
+++ b/app/Models/FeedDAO.php
@@ -19,7 +19,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $this->bd->lastInsertId();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error addFeed: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error addFeed: ' . $info[2]);
return false;
}
}
@@ -77,7 +77,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error updateFeed: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error updateFeed: ' . $info[2]);
return false;
}
}
@@ -107,7 +107,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error updateLastUpdate: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error updateLastUpdate: ' . $info[2]);
return false;
}
}
@@ -131,7 +131,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error changeCategory: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error changeCategory: ' . $info[2]);
return false;
}
}
@@ -146,7 +146,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error deleteFeed: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error deleteFeed: ' . $info[2]);
return false;
}
}
@@ -160,7 +160,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error deleteFeedByCategory: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error deleteFeedByCategory: ' . $info[2]);
return false;
}
}
@@ -289,7 +289,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error updateCachedValues: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error updateCachedValues: ' . $info[2]);
return false;
}
}
@@ -301,7 +301,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
$this->bd->beginTransaction();
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error truncate: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error truncate: ' . $info[2]);
$this->bd->rollBack();
return false;
}
@@ -313,7 +313,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error truncate: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error truncate: ' . $info[2]);
$this->bd->rollBack();
return false;
}
@@ -338,7 +338,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error cleanOldEntries: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error cleanOldEntries: ' . $info[2]);
return false;
}
}
diff --git a/app/Models/FeedDAOSQLite.php b/app/Models/FeedDAOSQLite.php
index 0d1872389..7599fda53 100644
--- a/app/Models/FeedDAOSQLite.php
+++ b/app/Models/FeedDAOSQLite.php
@@ -11,7 +11,7 @@ class FreshRSS_FeedDAOSQLite extends FreshRSS_FeedDAO {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error updateCachedValues: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error updateCachedValues: ' . $info[2]);
return false;
}
}
diff --git a/app/Models/UserDAO.php b/app/Models/UserDAO.php
index 0c96d7175..15215258c 100644
--- a/app/Models/UserDAO.php
+++ b/app/Models/UserDAO.php
@@ -28,7 +28,7 @@ class FreshRSS_UserDAO extends Minz_ModelPdo {
return true;
} else {
$info = empty($stm) ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error : ' . $info[2]);
return false;
}
}
@@ -48,7 +48,7 @@ class FreshRSS_UserDAO extends Minz_ModelPdo {
return true;
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error : ' . $info[2]);
return false;
}
}