]> source.dussan.org Git - nextcloud-server.git/commitdiff
make OC_HOOKS actually work
authorRobin Appelman <icewind1991@gmail.com>
Fri, 22 Apr 2011 15:50:04 +0000 (17:50 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Sat, 23 Apr 2011 00:30:12 +0000 (02:30 +0200)
lib/base.php
lib/filesystem.php

index 1ab9b23bccb3e5f91382be05f27d5a01f03c920b..3f1bb6f31498a6e50cd6a239e9c34be11d0e55f2 100644 (file)
@@ -91,9 +91,9 @@ require_once('plugin.php');
 
 $error=(count(OC_UTIL::checkServer())>0);
 
-if(!$error){
-       OC_PLUGIN::loadPlugins( "" );
-}
+// if(!$error){ //disable untill plugin system is proper converted to the new code base
+//     OC_PLUGIN::loadPlugins( "" );
+// }
 
 OC_USER::setBackend( OC_CONFIG::getValue( "userbackend", "database" ));
 OC_GROUP::setBackend( OC_CONFIG::getValue( "groupbackend", "database" ));
@@ -191,7 +191,7 @@ class OC_UTIL {
         * @return array
         */
        public static function getVersion(){
-               return array(1,2,0);
+               return array(1,60,0);
        }
 
        /**
@@ -406,7 +406,7 @@ class OC_HOOK{
                }
 
                // Call all slots
-               foreach( $registered[$signalclass][$signalname] as $i ){
+               foreach( self::$registered[$signalclass][$signalname] as $i ){
                        call_user_func( array( $i["class"], $i["name"] ), $params );
                }
 
index ca4d1a2c4741fc583a9c1d246d07f89099715649..03fbecdc4c04a578f0bbbd83d5b7653a7ad056a1 100644 (file)
@@ -194,6 +194,18 @@ class OC_FILESYSTEM{
                }
                return $foundMountPoint;
        }
+       /**
+       * return the path to a local version of the file
+       * we need this because we can't know if a file is stored local or not from outside the filestorage and for some purposes a local file is needed
+       * @param string path
+       * @return string
+       */
+       static public function getLocalFile($path){
+               $parent=substr($path,0,strrpos($path,'/'));
+               if(self::canRead($parent) and $storage=self::getStorage($path)){
+                       return $storage->getLocalFile(self::getInternalPath($path));
+               }
+       }
        
        static public function mkdir($path){
                $parent=substr($path,0,strrpos($path,'/'));