Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-08-10 14:20:43 +0400
committerRobin Appelman <icewind1991@gmail.com>2011-08-10 16:03:54 +0400
commitcdf91b6b3e0f6d9fc435497b9dcc051ff24d6c7e (patch)
tree9793b565309aa098d174a69f10b22d89cb007502 /lib
parent9059b559791b9f5333c24815c4bfd77cc6201c5e (diff)
work in new app management
Diffstat (limited to 'lib')
-rw-r--r--lib/app.php17
-rw-r--r--lib/base.php3
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;