aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-07-20 18:56:18 +0200
committerRobin Appelman <icewind@owncloud.com>2012-07-20 18:56:18 +0200
commitc9be9ab251681d96cfb620ca26778ba0005023d3 (patch)
tree9546e40b893abf3970ba7554edcf7829d782314d /lib
parent7152b8b4ee2f0d4de640868b614992e8aaf00803 (diff)
downloadnextcloud-server-c9be9ab251681d96cfb620ca26778ba0005023d3.tar.gz
nextcloud-server-c9be9ab251681d96cfb620ca26778ba0005023d3.zip
remove unused variables
Diffstat (limited to 'lib')
-rw-r--r--lib/archive/zip.php1
-rw-r--r--lib/filecache/update.php1
-rw-r--r--lib/filestorage/common.php2
-rw-r--r--lib/group/database.php5
-rw-r--r--lib/group/dummy.php3
-rw-r--r--lib/group/example.php18
-rw-r--r--lib/public/app.php22
-rw-r--r--lib/search/provider.php10
-rw-r--r--lib/user/database.php8
-rw-r--r--lib/user/example.php12
10 files changed, 27 insertions, 55 deletions
diff --git a/lib/archive/zip.php b/lib/archive/zip.php
index ff405ce098b..b2d6674d639 100644
--- a/lib/archive/zip.php
+++ b/lib/archive/zip.php
@@ -11,7 +11,6 @@ class OC_Archive_ZIP extends OC_Archive{
* @var ZipArchive zip
*/
private $zip=null;
- private $success=false;
private $path;
function __construct($source){
diff --git a/lib/filecache/update.php b/lib/filecache/update.php
index dd77f491ca0..93b632acb4e 100644
--- a/lib/filecache/update.php
+++ b/lib/filecache/update.php
@@ -207,7 +207,6 @@ class OC_FileCache_Update{
$cached=OC_FileCache_Cached::get($oldPath,$root);
$oldSize=$cached['size'];
- $size=$view->filesize($newPath);
OC_FileCache::increaseSize(dirname($oldPath),-$oldSize,$root);
OC_FileCache::increaseSize(dirname($newPath),$oldSize,$root);
OC_FileCache::move($oldPath,$newPath);
diff --git a/lib/filestorage/common.php b/lib/filestorage/common.php
index ba78fca80e5..fd389d3e2d7 100644
--- a/lib/filestorage/common.php
+++ b/lib/filestorage/common.php
@@ -220,7 +220,7 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
}
$tmpFile=OC_Helper::tmpFile($extension);
$target=fopen($tmpFile,'w');
- $count=OC_Helper::streamCopy($source,$target);
+ OC_Helper::streamCopy($source,$target);
return $tmpFile;
}
// abstract public function touch($path, $mtime=null);
diff --git a/lib/group/database.php b/lib/group/database.php
index fb173665eb8..2770ec185c4 100644
--- a/lib/group/database.php
+++ b/lib/group/database.php
@@ -41,7 +41,6 @@
* Class for group management in a SQL Database (e.g. MySQL, SQLite)
*/
class OC_Group_Database extends OC_Group_Backend {
- private $userGroupCache=array();
/**
* @brief Try to create a new group
@@ -116,7 +115,7 @@ class OC_Group_Database extends OC_Group_Backend {
// No duplicate entries!
if( !$this->inGroup( $uid, $gid )){
$query = OC_DB::prepare( "INSERT INTO `*PREFIX*group_user` ( `uid`, `gid` ) VALUES( ?, ? )" );
- $result = $query->execute( array( $uid, $gid ));
+ $query->execute( array( $uid, $gid ));
return true;
}else{
return false;
@@ -133,7 +132,7 @@ class OC_Group_Database extends OC_Group_Backend {
*/
public function removeFromGroup( $uid, $gid ){
$query = OC_DB::prepare( "DELETE FROM *PREFIX*group_user WHERE uid = ? AND gid = ?" );
- $result = $query->execute( array( $uid, $gid ));
+ $query->execute( array( $uid, $gid ));
return true;
}
diff --git a/lib/group/dummy.php b/lib/group/dummy.php
index 0825b10708a..1243891023f 100644
--- a/lib/group/dummy.php
+++ b/lib/group/dummy.php
@@ -126,7 +126,8 @@ class OC_Group_Dummy extends OC_Group_Backend {
*/
public function getUserGroups($uid){
$groups=array();
- foreach($this->groups as $group=>$user){
+ $allGroups=array_keys($this->groups);
+ foreach($allGroups as $group){
if($this->inGroup($uid,$group)){
$groups[]=$group;
}
diff --git a/lib/group/example.php b/lib/group/example.php
index c18562db7a4..f9c62fb9789 100644
--- a/lib/group/example.php
+++ b/lib/group/example.php
@@ -34,7 +34,7 @@ abstract class OC_Group_Example {
* Trys to create a new group. If the group name already exists, false will
* be returned.
*/
- public static function createGroup($gid){}
+ abstract public static function createGroup($gid);
/**
* @brief delete a group
@@ -43,7 +43,7 @@ abstract class OC_Group_Example {
*
* Deletes a group and removes it from the group_user-table
*/
- public static function deleteGroup($gid){}
+ abstract public static function deleteGroup($gid);
/**
* @brief is user in group?
@@ -53,7 +53,7 @@ abstract class OC_Group_Example {
*
* Checks whether the user is member of a group or not.
*/
- public static function inGroup($uid, $gid){}
+ abstract public static function inGroup($uid, $gid);
/**
* @brief Add a user to a group
@@ -63,7 +63,7 @@ abstract class OC_Group_Example {
*
* Adds a user to a group.
*/
- public static function addToGroup($uid, $gid){}
+ abstract public static function addToGroup($uid, $gid);
/**
* @brief Removes a user from a group
@@ -73,7 +73,7 @@ abstract class OC_Group_Example {
*
* removes the user from a group.
*/
- public static function removeFromGroup($uid,$gid){}
+ abstract public static function removeFromGroup($uid,$gid);
/**
* @brief Get all groups a user belongs to
@@ -83,7 +83,7 @@ abstract class OC_Group_Example {
* This function fetches all groups a user belongs to. It does not check
* if the user exists at all.
*/
- public static function getUserGroups($uid){}
+ abstract public static function getUserGroups($uid);
/**
* @brief get a list of all groups
@@ -91,19 +91,19 @@ abstract class OC_Group_Example {
*
* Returns a list with all groups
*/
- public static function getGroups(){}
+ abstract public static function getGroups();
/**
* check if a group exists
* @param string $gid
* @return bool
*/
- public function groupExists($gid){}
+ public function groupExists($gid);
/**
* @brief get a list of all users in a group
* @returns array with user ids
*/
- public static function usersInGroup($gid){}
+ abstract public static function usersInGroup($gid);
}
diff --git a/lib/public/app.php b/lib/public/app.php
index 38c51af9cdb..28411933beb 100644
--- a/lib/public/app.php
+++ b/lib/public/app.php
@@ -34,28 +34,6 @@ namespace OCP;
* This class provides functions to manage apps in ownCloud
*/
class App {
-
- /**
- * @brief Makes owncloud aware of this app
- * @brief This call is deprecated and not necessary to use.
- * @param $data array with all information
- * @returns true/false
- *
- * This function registers the application. $data is an associative array.
- * The following keys are required:
- * - id: id of the application, has to be unique ('addressbook')
- * - name: Human readable name ('Addressbook')
- * - version: array with Version (major, minor, bugfix) ( array(1, 0, 2))
- *
- * The following keys are optional:
- * - order: integer, that influences the position of your application in
- * a list of applications. Lower values come first.
- *
- */
- public static function register( $data ){
- }
-
-
/**
* @brief adds an entry to the navigation
* @param $data array containing the data
diff --git a/lib/search/provider.php b/lib/search/provider.php
index 838ab696d04..b3ee79b4770 100644
--- a/lib/search/provider.php
+++ b/lib/search/provider.php
@@ -2,13 +2,17 @@
/**
* provides search functionalty
*/
-class OC_Search_Provider {
- public function __construct($options){}
+abstract class OC_Search_Provider {
+ private $options;
+
+ public function __construct($options){
+ $this->options=$options;
+ }
/**
* search for $query
* @param string $query
* @return array An array of OC_Search_Result's
*/
- public function search($query){}
+ abstract public function search($query);
}
diff --git a/lib/user/database.php b/lib/user/database.php
index a48b8357d64..cc27b3ddbfd 100644
--- a/lib/user/database.php
+++ b/lib/user/database.php
@@ -39,7 +39,6 @@ require_once 'phpass/PasswordHash.php';
* Class for user management in a SQL Database (e.g. MySQL, SQLite)
*/
class OC_User_Database extends OC_User_Backend {
- static private $userGroupCache=array();
/**
* @var PasswordHash
*/
@@ -87,7 +86,7 @@ class OC_User_Database extends OC_User_Backend {
public function deleteUser( $uid ){
// Delete user-group-relation
$query = OC_DB::prepare( "DELETE FROM `*PREFIX*users` WHERE uid = ?" );
- $result = $query->execute( array( $uid ));
+ $query->execute( array( $uid ));
return true;
}
@@ -104,11 +103,10 @@ class OC_User_Database extends OC_User_Backend {
$hasher=$this->getHasher();
$hash = $hasher->HashPassword($password.OC_Config::getValue('passwordsalt', ''));
$query = OC_DB::prepare( "UPDATE *PREFIX*users SET password = ? WHERE uid = ?" );
- $result = $query->execute( array( $hash, $uid ));
+ $query->execute( array( $hash, $uid ));
return true;
- }
- else{
+ }else{
return false;
}
}
diff --git a/lib/user/example.php b/lib/user/example.php
index 7f3fd1b8578..77246d8136c 100644
--- a/lib/user/example.php
+++ b/lib/user/example.php
@@ -35,9 +35,7 @@ abstract class OC_User_Example extends OC_User_Backend {
* Creates a new user. Basic checking of username is done in OC_User
* itself, not in its subclasses.
*/
- public function createUser($uid, $password){
- return OC_USER_BACKEND_NOT_IMPLEMENTED;
- }
+ abstract public function createUser($uid, $password);
/**
* @brief Set password
@@ -47,9 +45,7 @@ abstract class OC_User_Example extends OC_User_Backend {
*
* Change the password of a user
*/
- public function setPassword($uid, $password){
- return OC_USER_BACKEND_NOT_IMPLEMENTED;
- }
+ abstract public function setPassword($uid, $password);
/**
* @brief Check if the password is correct
@@ -60,7 +56,5 @@ abstract class OC_User_Example extends OC_User_Backend {
* Check if the password is correct without logging in the user
* returns the user id or false
*/
- public function checkPassword($uid, $password){
- return OC_USER_BACKEND_NOT_IMPLEMENTED;
- }
+ abstract public function checkPassword($uid, $password);
}