summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBrice Maron <brice@bmaron.net>2012-06-07 20:36:55 +0000
committerBrice Maron <brice@bmaron.net>2012-06-07 20:36:55 +0000
commit9ec68c819bf409905e3e3ab17cb4b2dd925cbde7 (patch)
treefd115646b7a23b5d615949aea9cc8b84e8d9b83d /lib
parent9f1c46b6f6faebaebf555e0d26bcdef9e49daccc (diff)
downloadnextcloud-server-9ec68c819bf409905e3e3ab17cb4b2dd925cbde7.tar.gz
nextcloud-server-9ec68c819bf409905e3e3ab17cb4b2dd925cbde7.zip
Change parameter 'web' to 'url' and take array of array in config instead of : separated values
Diffstat (limited to 'lib')
-rwxr-xr-xlib/app.php2
-rw-r--r--lib/base.php21
-rw-r--r--lib/minimizer/css.php6
-rw-r--r--lib/minimizer/js.php4
-rw-r--r--lib/template.php8
5 files changed, 18 insertions, 23 deletions
diff --git a/lib/app.php b/lib/app.php
index 43d60f3a684..79a0a2e0534 100755
--- a/lib/app.php
+++ b/lib/app.php
@@ -342,7 +342,7 @@ class OC_App{
public static function getAppWebPath($appid) {
foreach(OC::$APPSROOTS as $dir) {
if(file_exists($dir['path'].'/'.$appid)) {
- return $dir['web'].'/'.$appid;
+ return $dir['url'].'/'.$appid;
}
}
return false;
diff --git a/lib/base.php b/lib/base.php
index 9f2925fa314..6e85f1a7346 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -55,7 +55,7 @@ class OC{
*/
public static $THIRDPARTYWEBROOT = '';
/**
- * The installation path array of the apps folder on the server (e.g. /srv/http/owncloud) 'real' and web path in 'web'
+ * The installation path array of the apps folder on the server (e.g. /srv/http/owncloud) 'path' and web path in 'url'
*/
public static $APPSROOTS = array();
/*
@@ -161,22 +161,17 @@ class OC{
echo("3rdparty directory not found! Please put the ownCloud 3rdparty folder in the ownCloud folder or the folder above. You can also configure the location in the config.php file.");
exit;
}
-
// search the apps folder
- if(OC_Config::getValue('appsroot', '')<>''){
- $real_a = explode(':',OC_Config::getValue('appsroot', ''));
- $web_a = explode(':',OC_Config::getValue('appsurl', ''));
- foreach($real_a as $k => $path) {
- if(!isset($web_a[$k])){
- echo("Apps root and appsurl not mathing. You need to have the same number of paths");
- exit;
- }
- OC::$APPSROOTS[] = array('path'=> $path, 'web' => $web_a[$k]);
+ $config_paths = OC_Config::getValue('apps_paths', array());
+ if(! empty($config_paths)){
+ foreach($config_paths as $paths) {
+ if( isset($paths['url']) && isset($paths['path']))
+ OC::$APPSROOTS[] = $paths;
}
}elseif(file_exists(OC::$SERVERROOT.'/apps')){
- OC::$APPSROOTS[] = array('path'=> OC::$SERVERROOT.'/apps', 'web' => OC::$WEBROOT.'/apps/');
+ OC::$APPSROOTS[] = array('path'=> OC::$SERVERROOT.'/apps', 'url' => OC::$WEBROOT.'/apps/');
}elseif(file_exists(OC::$SERVERROOT.'/../apps')){
- OC::$APPSROOTS[] = array('path'=> rtrim(dirname(OC::$SERVERROOT), '/').'/apps', 'web' => rtrim(dirname(OC::$WEBROOT), '/').'/apps/');
+ OC::$APPSROOTS[] = array('path'=> rtrim(dirname(OC::$SERVERROOT), '/').'/apps', 'url' => rtrim(dirname(OC::$WEBROOT), '/').'/apps/');
OC::$APPSROOT=rtrim(dirname(OC::$SERVERROOT), '/');
}
diff --git a/lib/minimizer/css.php b/lib/minimizer/css.php
index 5ba557c4cdc..c7e5d96e06b 100644
--- a/lib/minimizer/css.php
+++ b/lib/minimizer/css.php
@@ -28,8 +28,8 @@ class OC_Minimizer_CSS extends OC_Minimizer
$append = false;
foreach( OC::$APPSROOTS as $apps_dir)
{
- if($this->appendIfExist($apps_dir['path'], $apps_dir['web'], "$style$fext.css", true)) { $append =true; break; }
- elseif($this->appendIfExist($apps_dir['path'], $apps_dir['web'], "$style.css", true )) { $append =true; break; }
+ if($this->appendIfExist($apps_dir['path'], $apps_dir['url'], "$style$fext.css", true)) { $append =true; break; }
+ elseif($this->appendIfExist($apps_dir['path'], $apps_dir['url'], "$style.css", true )) { $append =true; break; }
}
if(! $append) {
echo('css file not found: style:'.$script.' formfactor:'.$fext.' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT);
@@ -65,7 +65,7 @@ class OC_Minimizer_CSS extends OC_Minimizer
$in_root = false;
foreach(OC::$APPSROOTS as $app_root) {
if(strpos($file, $app_root['path']) == 0) {
- $in_root = $app_root['web'];
+ $in_root = $app_root['url'];
break;
}
}
diff --git a/lib/minimizer/js.php b/lib/minimizer/js.php
index 4002b11538f..dd7d15de061 100644
--- a/lib/minimizer/js.php
+++ b/lib/minimizer/js.php
@@ -42,8 +42,8 @@ class OC_Minimizer_JS extends OC_Minimizer
$append = false;
foreach( OC::$APPSROOTS as $apps_dir)
{
- if($this->appendIfExist($apps_dir['path'], $apps_dir['web'], "$script$fext.js" , true)) { $append =true; break; }
- elseif($this->appendIfExist($apps_dir['path'], $apps_dir['web'], "$script.js", true )) { $append =true; break; }
+ if($this->appendIfExist($apps_dir['path'], $apps_dir['url'], "$script$fext.js" , true)) { $append =true; break; }
+ elseif($this->appendIfExist($apps_dir['path'], $apps_dir['url'], "$script.js", true )) { $append =true; break; }
}
if(! $append) {
echo('js file not found: script:'.$script.' formfactor:'.$fext.' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT);
diff --git a/lib/template.php b/lib/template.php
index 6fe07102034..b99d492a536 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -426,8 +426,8 @@ class OC_Template{
$append = false;
foreach( OC::$APPSROOTS as $apps_dir)
{
- if($page->appendIfExist('jsfiles', $apps_dir['path'], $apps_dir['web'], "$script$fext.js" , true)) { $append =true; break; }
- elseif($page->appendIfExist('jsfiles', $apps_dir['path'], $apps_dir['web'], "$script.js", true )) { $append =true; break; }
+ if($page->appendIfExist('jsfiles', $apps_dir['path'], $apps_dir['url'], "$script$fext.js" , true)) { $append =true; break; }
+ elseif($page->appendIfExist('jsfiles', $apps_dir['path'], $apps_dir['url'], "$script.js", true )) { $append =true; break; }
}
if(! $append) {
echo('js file not found: script:'.$script.' formfactor:'.$fext.' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT);
@@ -454,8 +454,8 @@ class OC_Template{
$append = false;
foreach( OC::$APPSROOTS as $apps_dir)
{
- if($page->appendIfExist('cssfiles', $apps_dir['path'], $apps_dir['web'], "$style$fext.css", true)) { $append =true; break; }
- elseif($page->appendIfExist('cssfiles', $apps_dir['path'], $apps_dir['web'], "$style.css", true )) { $append =true; break; }
+ if($page->appendIfExist('cssfiles', $apps_dir['path'], $apps_dir['url'], "$style$fext.css", true)) { $append =true; break; }
+ elseif($page->appendIfExist('cssfiles', $apps_dir['path'], $apps_dir['url'], "$style.css", true )) { $append =true; break; }
}
if(! $append) {
echo('css file not found: style:'.$script.' formfactor:'.$fext.' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT);