aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-06-08 21:08:38 +0200
committerBart Visscher <bartv@thisnet.nl>2012-06-19 23:15:33 +0200
commitbb649dd0d5accbdf1d993cdfbf0e10fd2e4f9f0b (patch)
tree1be3ee5f730cb36b86313a48e6d1427348a11734
parent598a090db41f9c76d347aec0ed996192e8255a36 (diff)
downloadnextcloud-server-bb649dd0d5accbdf1d993cdfbf0e10fd2e4f9f0b.tar.gz
nextcloud-server-bb649dd0d5accbdf1d993cdfbf0e10fd2e4f9f0b.zip
Smarter code for OC_FileProxy
Conflicts: lib/fileproxy.php
-rw-r--r--lib/fileproxy.php22
1 files changed, 6 insertions, 16 deletions
diff --git a/lib/fileproxy.php b/lib/fileproxy.php
index 70db9cca23c..9cda94c1c2b 100644
--- a/lib/fileproxy.php
+++ b/lib/fileproxy.php
@@ -42,16 +42,7 @@ class OC_FileProxy{
public static $enabled=true;
/**
- * check if this proxy implments a specific proxy operation
- * @param string #proxy name of the proxy operation
- * @return bool
- */
- public function provides($operation){
- return method_exists($this,$operation);
- }
-
- /**
- * fallback function when a proxy operation is not implement
+ * fallback function when a proxy operation is not implemented
* @param string $function the name of the proxy operation
* @param mixed
*
@@ -73,11 +64,10 @@ class OC_FileProxy{
self::$proxies[]=$proxy;
}
- public static function getProxies($operation,$post){
- $operation=(($post)?'post':'pre').$operation;
+ public static function getProxies($operation){
$proxies=array();
foreach(self::$proxies as $proxy){
- if($proxy->provides($operation)){
+ if(method_exists($proxy,$operation)){
$proxies[]=$proxy;
}
}
@@ -88,8 +78,8 @@ class OC_FileProxy{
if(!self::$enabled){
return true;
}
- $proxies=self::getProxies($operation,false);
$operation='pre'.$operation;
+ $proxies=self::getProxies($operation);
foreach($proxies as $proxy){
if(!is_null($filepath2)){
if($proxy->$operation($filepath,$filepath2)===false){
@@ -108,8 +98,8 @@ class OC_FileProxy{
if(!self::$enabled){
return $result;
}
- $proxies=self::getProxies($operation,true);
$operation='post'.$operation;
+ $proxies=self::getProxies($operation);
foreach($proxies as $proxy){
$result=$proxy->$operation($path,$result);
}
@@ -119,4 +109,4 @@ class OC_FileProxy{
public static function clearProxies(){
self::$proxies=array();
}
-} \ No newline at end of file
+}