diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-08-10 12:20:43 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-08-10 14:03:54 +0200 |
commit | cdf91b6b3e0f6d9fc435497b9dcc051ff24d6c7e (patch) | |
tree | 9793b565309aa098d174a69f10b22d89cb007502 /lib | |
parent | 9059b559791b9f5333c24815c4bfd77cc6201c5e (diff) | |
download | nextcloud-server-cdf91b6b3e0f6d9fc435497b9dcc051ff24d6c7e.tar.gz nextcloud-server-cdf91b6b3e0f6d9fc435497b9dcc051ff24d6c7e.zip |
work in new app management
Diffstat (limited to 'lib')
-rw-r--r-- | lib/app.php | 17 | ||||
-rw-r--r-- | lib/base.php | 3 |
2 files changed, 17 insertions, 3 deletions
diff --git a/lib/app.php b/lib/app.php index 411c08cbe5b..9c7b7e75dcd 100644 --- a/lib/app.php +++ b/lib/app.php @@ -136,7 +136,6 @@ class OC_App{ * This function returns all data it got via register(). */ public static function get(){ - // TODO: write function return OC_App::$apps; } @@ -242,7 +241,7 @@ class OC_App{ if(is_file($appid)){ $file=$appid; }else{ - $file='apps/'.$appid.'/appinfo/info.xml'; + $file=OC::$SERVERROOT.'/apps/'.$appid.'/appinfo/info.xml'; if(!is_file($file)){ return array(); } @@ -332,4 +331,18 @@ class OC_App{ public static function registerPersonal($app,$page){ self::$personalForms[]='apps/'.$app.'/'.$page.'.php'; } + + /** + * get a list of all apps in the apps folder + */ + public static function getAllApps(){ + $apps=array(); + $dh=opendir(OC::$SERVERROOT.'/apps'); + while($file=readdir($dh)){ + if(is_file(OC::$SERVERROOT.'/apps/'.$file.'/appinfo/app.php')){ + $apps[]=$file; + } + } + return $apps; + } } diff --git a/lib/base.php b/lib/base.php index f59e375e763..93b8e0b584d 100644 --- a/lib/base.php +++ b/lib/base.php @@ -90,7 +90,8 @@ if(substr($scriptName,-1)=='/'){ } $WEBROOT=substr($scriptName,0,strlen($scriptName)-strlen($SUBURI)); - +OC::$SERVERROOT=$SERVERROOT; +OC::$WEBROOT=$WEBROOT; if($WEBROOT!='' and $WEBROOT[0]!=='/'){ $WEBROOT='/'.$WEBROOT; |