summaryrefslogtreecommitdiffstats
path: root/apps/bookmarks
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-05-03 13:06:08 +0200
committerFrank Karlitschek <frank@owncloud.org>2012-05-03 13:06:08 +0200
commit97a8af7f2519e9ba01c2ff0c16a3102f716c0d13 (patch)
tree9f6a83c9da6a18ce0cd14f8513c6f647a8edc956 /apps/bookmarks
parentf85d076a4e1df2de8b7b75e379d52fd71807ae01 (diff)
downloadnextcloud-server-97a8af7f2519e9ba01c2ff0c16a3102f716c0d13.tar.gz
nextcloud-server-97a8af7f2519e9ba01c2ff0c16a3102f716c0d13.zip
ported oc_db
Diffstat (limited to 'apps/bookmarks')
-rwxr-xr-xapps/bookmarks/ajax/delBookmark.php6
-rwxr-xr-xapps/bookmarks/ajax/editBookmark.php6
-rwxr-xr-xapps/bookmarks/ajax/recordClick.php2
-rwxr-xr-x[-rw-r--r--]apps/bookmarks/appinfo/migrate.php6
-rwxr-xr-xapps/bookmarks/bookmarksHelper.php6
-rwxr-xr-xapps/bookmarks/lib/bookmarks.php4
6 files changed, 15 insertions, 15 deletions
diff --git a/apps/bookmarks/ajax/delBookmark.php b/apps/bookmarks/ajax/delBookmark.php
index f40192943e4..2634bed0b9c 100755
--- a/apps/bookmarks/ajax/delBookmark.php
+++ b/apps/bookmarks/ajax/delBookmark.php
@@ -35,7 +35,7 @@ $params=array(
OCP\USER::getUser()
);
-$query = OC_DB::prepare("
+$query = OCP\DB::prepare("
SELECT id FROM *PREFIX*bookmarks
WHERE url LIKE ?
AND user_id = ?
@@ -43,7 +43,7 @@ $query = OC_DB::prepare("
$id = $query->execute($params)->fetchOne();
-$query = OC_DB::prepare("
+$query = OCP\DB::prepare("
DELETE FROM *PREFIX*bookmarks
WHERE id = $id
");
@@ -51,7 +51,7 @@ $query = OC_DB::prepare("
$result = $query->execute();
-$query = OC_DB::prepare("
+$query = OCP\DB::prepare("
DELETE FROM *PREFIX*bookmarks_tags
WHERE bookmark_id = $id
");
diff --git a/apps/bookmarks/ajax/editBookmark.php b/apps/bookmarks/ajax/editBookmark.php
index 1b6d6d6ce44..db349af35c1 100755
--- a/apps/bookmarks/ajax/editBookmark.php
+++ b/apps/bookmarks/ajax/editBookmark.php
@@ -41,7 +41,7 @@ if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
$bookmark_id = (int)$_GET["id"];
-$query = OC_DB::prepare("
+$query = OCP\DB::prepare("
UPDATE *PREFIX*bookmarks
SET url = ?, title =?, lastmodified = $_ut
WHERE id = $bookmark_id
@@ -54,14 +54,14 @@ $params=array(
$query->execute($params);
# Remove old tags and insert new ones.
-$query = OC_DB::prepare("
+$query = OCP\DB::prepare("
DELETE FROM *PREFIX*bookmarks_tags
WHERE bookmark_id = $bookmark_id
");
$query->execute();
-$query = OC_DB::prepare("
+$query = OCP\DB::prepare("
INSERT INTO *PREFIX*bookmarks_tags
(bookmark_id, tag)
VALUES (?, ?)
diff --git a/apps/bookmarks/ajax/recordClick.php b/apps/bookmarks/ajax/recordClick.php
index 03d010637fc..2bd91f232a4 100755
--- a/apps/bookmarks/ajax/recordClick.php
+++ b/apps/bookmarks/ajax/recordClick.php
@@ -30,7 +30,7 @@ $RUNTIME_NOSETUPFS=true;
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('bookmarks');
-$query = OC_DB::prepare("
+$query = OCP\DB::prepare("
UPDATE *PREFIX*bookmarks
SET clickcount = clickcount + 1
WHERE user_id = ?
diff --git a/apps/bookmarks/appinfo/migrate.php b/apps/bookmarks/appinfo/migrate.php
index c1251e816ec..e7e572f52dc 100644..100755
--- a/apps/bookmarks/appinfo/migrate.php
+++ b/apps/bookmarks/appinfo/migrate.php
@@ -40,10 +40,10 @@ class OC_Migration_Provider_Bookmarks extends OC_Migration_Provider{
$idmap = array();
while( $row = $results->fetchRow() ){
// Import each bookmark, saving its id into the map
- $query = OC_DB::prepare( "INSERT INTO *PREFIX*bookmarks(url, title, user_id, public, added, lastmodified) VALUES (?, ?, ?, ?, ?, ?)" );
+ $query = OCP\DB::prepare( "INSERT INTO *PREFIX*bookmarks(url, title, user_id, public, added, lastmodified) VALUES (?, ?, ?, ?, ?, ?)" );
$query->execute( array( $row['url'], $row['title'], $this->uid, $row['public'], $row['added'], $row['lastmodified'] ) );
// Map the id
- $idmap[$row['id']] = OC_DB::insertid();
+ $idmap[$row['id']] = OCP\DB::insertid();
}
// Now tags
foreach($idmap as $oldid => $newid){
@@ -51,7 +51,7 @@ class OC_Migration_Provider_Bookmarks extends OC_Migration_Provider{
$results = $query->execute( array( $oldid ) );
while( $row = $results->fetchRow() ){
// Import the tags for this bookmark, using the new bookmark id
- $query = OC_DB::prepare( "INSERT INTO *PREFIX*bookmarks_tags(bookmark_id, tag) VALUES (?, ?)" );
+ $query = OCP\DB::prepare( "INSERT INTO *PREFIX*bookmarks_tags(bookmark_id, tag) VALUES (?, ?)" );
$query->execute( array( $newid, $row['tag'] ) );
}
}
diff --git a/apps/bookmarks/bookmarksHelper.php b/apps/bookmarks/bookmarksHelper.php
index e299f9ee19b..01b551111e0 100755
--- a/apps/bookmarks/bookmarksHelper.php
+++ b/apps/bookmarks/bookmarksHelper.php
@@ -82,7 +82,7 @@ function addBookmark($url, $title, $tags='') {
}
//FIXME: Detect when user adds a known URL
- $query = OC_DB::prepare("
+ $query = OCP\DB::prepare("
INSERT INTO *PREFIX*bookmarks
(url, title, user_id, public, added, lastmodified)
VALUES (?, ?, ?, 0, $_ut, $_ut)
@@ -105,10 +105,10 @@ function addBookmark($url, $title, $tags='') {
);
$query->execute($params);
- $b_id = OC_DB::insertid('*PREFIX*bookmarks');
+ $b_id = OCP\DB::insertid('*PREFIX*bookmarks');
if($b_id !== false) {
- $query = OC_DB::prepare("
+ $query = OCP\DB::prepare("
INSERT INTO *PREFIX*bookmarks_tags
(bookmark_id, tag)
VALUES (?, ?)
diff --git a/apps/bookmarks/lib/bookmarks.php b/apps/bookmarks/lib/bookmarks.php
index cbc50fdb81c..67b8e2f780e 100755
--- a/apps/bookmarks/lib/bookmarks.php
+++ b/apps/bookmarks/lib/bookmarks.php
@@ -70,7 +70,7 @@ class OC_Bookmarks_Bookmarks{
}
if($CONFIG_DBTYPE == 'pgsql' ){
- $query = OC_DB::prepare('
+ $query = OCP\DB::prepare('
SELECT id, url, title, '.($filterTagOnly?'':'url || title ||').' array_to_string(array_agg(tag), \' \') as tags
FROM *PREFIX*bookmarks
LEFT JOIN *PREFIX*bookmarks_tags ON *PREFIX*bookmarks.id = *PREFIX*bookmarks_tags.bookmark_id
@@ -87,7 +87,7 @@ class OC_Bookmarks_Bookmarks{
else
$concatFunction = 'Concat(Concat( url, title), ';
- $query = OC_DB::prepare('
+ $query = OCP\DB::prepare('
SELECT id, url, title, '
.($filterTagOnly?'':$concatFunction).
'CASE WHEN *PREFIX*bookmarks.id = *PREFIX*bookmarks_tags.bookmark_id