summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-08-10 00:58:13 +0200
committerBart Visscher <bartv@thisnet.nl>2012-08-10 11:43:04 +0200
commitda07245f59cd3a1636392f63ef89e91b40d792eb (patch)
tree869a3ee75e396ffa3af3d8f53b859ab85b8c5b82 /lib
parente3c732040b7eeb45efcd563d1c9abddf617ecd32 (diff)
downloadnextcloud-server-da07245f59cd3a1636392f63ef89e91b40d792eb.tar.gz
nextcloud-server-da07245f59cd3a1636392f63ef89e91b40d792eb.zip
Move OC::loadfile and OC::loadapp next to OC::handleRequest
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php70
1 files changed, 35 insertions, 35 deletions
diff --git a/lib/base.php b/lib/base.php
index 025046c31db..69de28db4a0 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -257,41 +257,6 @@ class OC{
session_start();
}
- protected static function loadapp() {
- if(file_exists(OC_App::getAppPath(OC::$REQUESTEDAPP) . '/index.php')) {
- require_once(OC_App::getAppPath(OC::$REQUESTEDAPP) . '/index.php');
- }
- else {
- trigger_error('The requested App was not found.', E_USER_ERROR);//load default app instead?
- }
- }
-
- protected static function loadfile() {
- $app = OC::$REQUESTEDAPP;
- $file = OC::$REQUESTEDFILE;
- $app_path = OC_App::getAppPath($app);
- if(file_exists($app_path . '/' . $file)) {
- $file_ext = substr($file, -3);
- if ($file_ext == 'css') {
- $app_web_path = OC_App::getAppWebPath($app);
- $filepath = $app_web_path . '/' . $file;
- $minimizer = new OC_Minimizer_CSS();
- $info = array($app_path, $app_web_path, $file);
- $minimizer->output(array($info), $filepath);
- exit;
- } elseif($file_ext == 'php') {
- $file = $app_path . '/' . $file;
- unset($app, $app_path, $app_web_path, $file_ext);
- require_once($file);
- }
- }
- else {
- die();
- header('HTTP/1.0 404 Not Found');
- exit;
- }
- }
-
public static function init(){
// register autoloader
spl_autoload_register(array('OC','autoload'));
@@ -456,6 +421,41 @@ class OC{
return false;
}
+ protected static function loadapp() {
+ if(file_exists(OC_App::getAppPath(OC::$REQUESTEDAPP) . '/index.php')) {
+ require_once(OC_App::getAppPath(OC::$REQUESTEDAPP) . '/index.php');
+ }
+ else {
+ trigger_error('The requested App was not found.', E_USER_ERROR);//load default app instead?
+ }
+ }
+
+ protected static function loadfile() {
+ $app = OC::$REQUESTEDAPP;
+ $file = OC::$REQUESTEDFILE;
+ $app_path = OC_App::getAppPath($app);
+ if (file_exists($app_path . '/' . $file)) {
+ $file_ext = substr($file, -3);
+ if ($file_ext == 'css') {
+ $app_web_path = OC_App::getAppWebPath($app);
+ $filepath = $app_web_path . '/' . $file;
+ $minimizer = new OC_Minimizer_CSS();
+ $info = array($app_path, $app_web_path, $file);
+ $minimizer->output(array($info), $filepath);
+ exit;
+ } elseif($file_ext == 'php') {
+ $file = $app_path . '/' . $file;
+ unset($app, $app_path, $app_web_path, $file_ext);
+ require_once($file);
+ }
+ }
+ else {
+ die();
+ header('HTTP/1.0 404 Not Found');
+ exit;
+ }
+ }
+
public static function tryRememberLogin() {
if(!isset($_COOKIE["oc_remember_login"])
|| !isset($_COOKIE["oc_token"])