aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-04-16 10:13:52 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-04-16 10:13:52 +0200
commite42dbbf7f3c98f55d00339e9ce2589890a6e55ba (patch)
tree04103b4ead37a3837f6df9e632d4949588704f57 /lib
parent232654cb606af856d24c4b01353f18ac4a48e9bc (diff)
parent16e4a1dd1795714426a529f02391d41c41acae71 (diff)
downloadnextcloud-server-e42dbbf7f3c98f55d00339e9ce2589890a6e55ba.tar.gz
nextcloud-server-e42dbbf7f3c98f55d00339e9ce2589890a6e55ba.zip
merge
Diffstat (limited to 'lib')
-rw-r--r--lib/app.php15
-rw-r--r--lib/base.php8
-rw-r--r--lib/helper.php11
-rw-r--r--lib/template.php8
4 files changed, 32 insertions, 10 deletions
diff --git a/lib/app.php b/lib/app.php
index ddbad4ee2ec..f9101ba4052 100644
--- a/lib/app.php
+++ b/lib/app.php
@@ -49,12 +49,17 @@ class OC_APP{
return true;
}
- // Get all appinfo
- $dir = opendir( $SERVERROOT );
+ // Our very own core apps are hardcoded
+ foreach( array( "admin", "files", "log", "settings" ) as $app ){
+ oc_require( "$app/appinfo/app.php" );
+ }
+
+ // The rest comes here
+ $dir = opendir( "$SERVERROOT/apps" );
while( false !== ( $filename = readdir( $dir ))){
if( substr( $filename, 0, 1 ) != '.' ){
- if( file_exists( "$SERVERROOT/$filename/appinfo/app.php" )){
- require( "$filename/appinfo/app.php" );
+ if( file_exists( "$SERVERROOT/apps/$filename/appinfo/app.php" )){
+ require( "apps/$filename/appinfo/app.php" );
}
}
}
@@ -281,7 +286,7 @@ class OC_APP{
}
/**
- * @brief Installs an application
+ * @brief Update an application
* @param $data array with all information
* @returns integer
*
diff --git a/lib/base.php b/lib/base.php
index 033052a3c3b..4e87ea66e2a 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -156,7 +156,7 @@ class OC_UTIL {
if($CONFIG_ENABLEBACKUP){
// This creates the Directorys recursively
if(!is_dir( "$CONFIG_BACKUPDIRECTORY/$user/$root" )){
- mkdir( "$CONFIG_BACKUPDIRECTORY/$user/$root", 0x755, true );
+ mkdir( "$CONFIG_BACKUPDIRECTORY/$user/$root", 0755, true );
}
$backupStorage=OC_FILESYSTEM::createStorage('local',array('datadir'=>$CONFIG_BACKUPDIRECTORY));
$backup=new OC_FILEOBSERVER_BACKUP(array('storage'=>$backupStorage));
@@ -166,7 +166,7 @@ class OC_UTIL {
$CONFIG_DATADIRECTORY = "$CONFIG_DATADIRECTORY_ROOT/$user/$root";
if( !is_dir( $CONFIG_DATADIRECTORY )){
- mkdir( $CONFIG_DATADIRECTORY, 0x755, true );
+ mkdir( $CONFIG_DATADIRECTORY, 0755, true );
}
//set up the other storages according to the system settings
@@ -301,7 +301,7 @@ class OC_HOOK{
*
* TODO: write example
*/
- public function connect( $signalclass, $signalname, $slotclass, $slotname ){
+ static public function connect( $signalclass, $signalname, $slotclass, $slotname ){
// Cerate the data structure
if( !array_key_exists( $signalclass, self::$registered )){
self::$registered[$signalclass] = array();
@@ -330,7 +330,7 @@ class OC_HOOK{
*
* TODO: write example
*/
- public function emit( $signalclass, $signalname, $params = array()){
+ static public function emit( $signalclass, $signalname, $params = array()){
// Return false if there are no slots
if( !array_key_exists( $signalclass, self::$registered )){
return false;
diff --git a/lib/helper.php b/lib/helper.php
index a10697c3933..982da7b6cc3 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -35,6 +35,12 @@ class OC_HELPER {
*/
public static function linkTo( $app, $file ){
global $WEBROOT;
+ global $SERVERROOT;
+
+ // Check if the app is in the app folder
+ if( file_exists( "$SERVERROOT/apps/$app/$file" )){
+ return "$WEBROOT/apps/$app/$file";
+ }
return "$WEBROOT/$app/$file";
}
@@ -47,7 +53,12 @@ class OC_HELPER {
* Returns the path to the image.
*/
public static function imagePath( $app, $image ){
+ global $SERVERROOT;
global $WEBROOT;
+ // Check if the app is in the app folder
+ if( file_exists( "$SERVERROOT/apps/img/$app/$file" )){
+ return "$WEBROOT/apps/img/$app/$file";
+ }
return "$WEBROOT/$app/img/$image";
}
diff --git a/lib/template.php b/lib/template.php
index 12a32c1f052..c36b1e7a367 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -96,7 +96,13 @@ class OC_TEMPLATE{
// Get the right template folder
$template = "$SERVERROOT/templates/";
if( $app != "core" && $app != "" ){
- $template = "$SERVERROOT/$app/templates/";
+ // Check if the app is in the app folder
+ if( file_exists( "$SERVERROOT/apps/$app/templates/" )){
+ $template = "$SERVERROOT/apps/$app/templates/";
+ }
+ else{
+ $template = "$SERVERROOT/$app/templates/";
+ }
}
// Templates have the ending .php