Merge pull request #24005 from owncloud/3rdparty-has-to-be-in-root

Kill movable 3rdparty
This commit is contained in:
Thomas Müller 2016-04-14 23:33:34 +02:00
commit f4f4f88347
3 changed files with 8 additions and 47 deletions

View File

@ -611,21 +611,6 @@ $CONFIG = array(
* Some of the ownCloud code may be stored in alternate locations. * Some of the ownCloud code may be stored in alternate locations.
*/ */
/**
* ownCloud uses some 3rd party PHP components to provide certain functionality.
* These components are shipped as part of the software package and reside in
* ``owncloud/3rdparty``. Use this option to configure a different location.
* For example, if your location is /var/www/owncloud/foo/3rdparty, then the
* correct configuration is '3rdpartyroot' => '/var/www/owncloud/foo/',
*/
'3rdpartyroot' => '',
/**
* If you have an alternate ``3rdpartyroot``, you must also configure the URL as
* seen by a Web browser.
*/
'3rdpartyurl' => '',
/** /**
* This section is for configuring the download links for ownCloud clients, as * This section is for configuring the download links for ownCloud clients, as
* seen in the first-run wizard and on Personal pages. * seen in the first-run wizard and on Personal pages.

View File

@ -77,20 +77,15 @@ class OC {
* the owncloud root path for http requests (e.g. owncloud/) * the owncloud root path for http requests (e.g. owncloud/)
*/ */
public static $WEBROOT = ''; public static $WEBROOT = '';
/**
* The installation path of the 3rdparty folder on the server (e.g. /srv/http/owncloud/3rdparty)
*/
public static $THIRDPARTYROOT = '';
/**
* the root path of the 3rdparty folder for http requests (e.g. owncloud/3rdparty)
*/
public static $THIRDPARTYWEBROOT = '';
/** /**
* The installation path array of the apps folder on the server (e.g. /srv/http/owncloud) 'path' and * The installation path array of the apps folder on the server (e.g. /srv/http/owncloud) 'path' and
* web path in 'url' * web path in 'url'
*/ */
public static $APPSROOTS = array(); public static $APPSROOTS = array();
/**
* @var string
*/
public static $configDir; public static $configDir;
/** /**
@ -183,25 +178,6 @@ class OC {
} }
} }
// search the 3rdparty folder
OC::$THIRDPARTYROOT = self::$config->getValue('3rdpartyroot', null);
OC::$THIRDPARTYWEBROOT = self::$config->getValue('3rdpartyurl', null);
if (empty(OC::$THIRDPARTYROOT) && empty(OC::$THIRDPARTYWEBROOT)) {
if (file_exists(OC::$SERVERROOT . '/3rdparty')) {
OC::$THIRDPARTYROOT = OC::$SERVERROOT;
OC::$THIRDPARTYWEBROOT = OC::$WEBROOT;
} elseif (file_exists(OC::$SERVERROOT . '/../3rdparty')) {
OC::$THIRDPARTYWEBROOT = rtrim(dirname(OC::$WEBROOT), '/');
OC::$THIRDPARTYROOT = rtrim(dirname(OC::$SERVERROOT), '/');
}
}
if (empty(OC::$THIRDPARTYROOT) || !file_exists(OC::$THIRDPARTYROOT)) {
throw new \RuntimeException('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.');
}
// search the apps folder // search the apps folder
$config_paths = self::$config->getValue('apps_paths', array()); $config_paths = self::$config->getValue('apps_paths', array());
if (!empty($config_paths)) { if (!empty($config_paths)) {
@ -240,7 +216,7 @@ class OC {
set_include_path( set_include_path(
OC::$SERVERROOT . '/lib/private' . PATH_SEPARATOR . OC::$SERVERROOT . '/lib/private' . PATH_SEPARATOR .
OC::$SERVERROOT . '/config' . PATH_SEPARATOR . OC::$SERVERROOT . '/config' . PATH_SEPARATOR .
OC::$THIRDPARTYROOT . '/3rdparty' . PATH_SEPARATOR . OC::$SERVERROOT . '/3rdparty' . PATH_SEPARATOR .
implode(PATH_SEPARATOR, $paths) . PATH_SEPARATOR . implode(PATH_SEPARATOR, $paths) . PATH_SEPARATOR .
get_include_path() . PATH_SEPARATOR . get_include_path() . PATH_SEPARATOR .
OC::$SERVERROOT OC::$SERVERROOT
@ -306,7 +282,7 @@ class OC {
// render error page // render error page
$template = new OC_Template('', 'update.user', 'guest'); $template = new OC_Template('', 'update.user', 'guest');
OC_Util::addscript('maintenance-check'); OC_Util::addScript('maintenance-check');
$template->printPage(); $template->printPage();
die(); die();
} }
@ -493,7 +469,7 @@ class OC {
try { try {
self::initPaths(); self::initPaths();
// setup 3rdparty autoloader // setup 3rdparty autoloader
$vendorAutoLoad = OC::$THIRDPARTYROOT . '/3rdparty/autoload.php'; $vendorAutoLoad = OC::$SERVERROOT. '/3rdparty/autoload.php';
if (!file_exists($vendorAutoLoad)) { if (!file_exists($vendorAutoLoad)) {
throw new \RuntimeException('Composer autoloader not found, unable to continue. Check the folder "3rdparty". Running "git submodule update --init" will initialize the git submodule that handles the subfolder "3rdparty".'); throw new \RuntimeException('Composer autoloader not found, unable to continue. Check the folder "3rdparty". Running "git submodule update --init" will initialize the git submodule that handles the subfolder "3rdparty".');
} }

View File

@ -182,7 +182,7 @@ class TemplateLayout extends \OC_Template {
\OC::$server->getLogger(), \OC::$server->getLogger(),
$theme, $theme,
array( \OC::$SERVERROOT => \OC::$WEBROOT ), array( \OC::$SERVERROOT => \OC::$WEBROOT ),
array( \OC::$THIRDPARTYROOT => \OC::$THIRDPARTYWEBROOT )); array( \OC::$SERVERROOT => \OC::$WEBROOT ));
$locator->find($styles); $locator->find($styles);
return $locator->getResources(); return $locator->getResources();
} }
@ -199,7 +199,7 @@ class TemplateLayout extends \OC_Template {
\OC::$server->getLogger(), \OC::$server->getLogger(),
$theme, $theme,
array( \OC::$SERVERROOT => \OC::$WEBROOT ), array( \OC::$SERVERROOT => \OC::$WEBROOT ),
array( \OC::$THIRDPARTYROOT => \OC::$THIRDPARTYWEBROOT )); array( \OC::$SERVERROOT => \OC::$WEBROOT ));
$locator->find($scripts); $locator->find($scripts);
return $locator->getResources(); return $locator->getResources();
} }