diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-06-04 23:02:05 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-06-04 23:02:05 +0200 |
commit | 4a5973662c78eb5769e7b06d7d559572f57e663f (patch) | |
tree | 774e2f775b3789f5f40bd2459ddec05df1b73c31 /lib/base.php | |
parent | 786325a4bb976d92de54c472c2c3bd8a73cbef22 (diff) | |
parent | 3fee3a4633e5d4d65f7eabf2d387e209efedbc70 (diff) | |
download | nextcloud-server-4a5973662c78eb5769e7b06d7d559572f57e663f.tar.gz nextcloud-server-4a5973662c78eb5769e7b06d7d559572f57e663f.zip |
Merge branch 'unstable'
Conflicts:
apps/files_external/tests/config.php
apps/files_versions/ajax/getVersions.php
apps/files_versions/appinfo/app.php
apps/files_versions/history.php
apps/files_versions/js/versions.js
apps/files_versions/templates/history.php
apps/files_versions/versions.php
lib/base.php
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/lib/base.php b/lib/base.php index e6fcb9ec4de..bdfd05e8f1d 100644 --- a/lib/base.php +++ b/lib/base.php @@ -31,17 +31,13 @@ class OC{ */ public static $CLASSPATH = array(); /** - * $_SERVER['DOCUMENTROOT'] but without symlinks - */ - public static $DOCUMENTROOT = ''; - /** * The installation path for owncloud on the server (e.g. /srv/http/owncloud) */ public static $SERVERROOT = ''; /** * the current request path relative to the owncloud root (e.g. files/index.php) */ - public static $SUBURI = ''; + private static $SUBURI = ''; /** * the owncloud root path for http requests (e.g. owncloud/) */ @@ -51,10 +47,6 @@ class OC{ */ public static $CONFIG_DATADIRECTORY = ''; /** - * the folder that stores the data for the root filesystem (e.g. /srv/http/owncloud/data) - */ - public static $CONFIG_DATADIRECTORY_ROOT = ''; - /** * The installation path of the 3rdparty folder on the server (e.g. /srv/http/owncloud/3rdparty) */ public static $THIRDPARTYROOT = ''; @@ -130,7 +122,7 @@ class OC{ public static function initPaths(){ // calculate the documentroot - OC::$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']); + $DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']); OC::$SERVERROOT=str_replace("\\",'/',substr(__FILE__,0,-13)); OC::$SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen(OC::$SERVERROOT)); $scriptName=$_SERVER["SCRIPT_NAME"]; @@ -146,7 +138,7 @@ class OC{ } OC::$WEBROOT=substr($scriptName,0,strlen($scriptName)-strlen(OC::$SUBURI)); // try a new way to detect the WEBROOT which is simpler and also works with the app directory outside the owncloud folder. let´s see if this works for everybody -// OC::$WEBROOT=substr(OC::$SERVERROOT,strlen(OC::$DOCUMENTROOT)); +// OC::$WEBROOT=substr(OC::$SERVERROOT,strlen($DOCUMENTROOT)); if(OC::$WEBROOT!='' and OC::$WEBROOT[0]!=='/'){ @@ -243,6 +235,9 @@ class OC{ OC_Config::setValue('version',implode('.',OC_Util::getVersion())); } + OC_AppConfig::setValue('core', 'remote_core.css', '/core/minimizer.php'); + OC_AppConfig::setValue('core', 'remote_core.js', '/core/minimizer.php'); + OC_App::updateApps(); } } @@ -291,18 +286,9 @@ class OC{ public static function loadfile(){ if(file_exists(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE)){ if(substr(OC::$REQUESTEDFILE, -3) == 'css'){ - $appswebroot = (string) OC::$APPSWEBROOT; - $webroot = (string) OC::$WEBROOT; - $filepath = OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE; - header('Content-Type: text/css'); - OC_Response::enableCaching(); - OC_Response::setLastModifiedHeader(filemtime($filepath)); - $cssfile = file_get_contents($filepath); - $cssfile = str_replace('%appswebroot%', $appswebroot, $cssfile); - $cssfile = str_replace('%webroot%', $webroot, $cssfile); - OC_Response::setETagHeader(md5($cssfile)); - header('Content-Length: '.strlen($cssfile)); - echo $cssfile; + $file = 'apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE; + $minimizer = new OC_Minimizer_CSS(); + $minimizer->output(array(array(OC::$APPSROOT, OC::$APPSWEBROOT, $file))); exit; }elseif(substr(OC::$REQUESTEDFILE, -3) == 'php'){ require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE); |