Skip to content

Instantly share code, notes, and snippets.

@thiagovsk
Created August 7, 2015 19:33
Show Gist options
  • Save thiagovsk/961814d00f1819190891 to your computer and use it in GitHub Desktop.
Save thiagovsk/961814d00f1819190891 to your computer and use it in GitHub Desktop.
owncloud.patch
Description: Owncloud multiple instances in same server.
Author: Thiago Ribeiro
Last-Update: 2015-07-02
Index: owncloud/core/setup/controller.php
===================================================================
--- owncloud.orig/core/setup/controller.php
+++ owncloud/core/setup/controller.php
@@ -40,7 +40,7 @@ class Controller {
* @param Setup $setupHelper
*/
function __construct(Setup $setupHelper) {
- $this->autoConfigFile = \OC::$SERVERROOT.'/config/autoconfig.php';
+ $this->autoConfigFile = autoconfig_path();
$this->setupHelper = $setupHelper;
}
@@ -123,4 +123,10 @@ class Controller {
return $post;
}
+ function autoconfig_path(){
+ if (isset($_SERVER["OWNCLOUD_CONFIG_DIR"])){
+ return $_SERVER["OWNCLOUD_CONFIG_DIR"] . '/autoconfig.php';
+ }
+ return \OC::$SERVERROOT . 'config/autoconfig.php';
+ }
}
Index: owncloud/lib/base.php
===================================================================
--- owncloud.orig/lib/base.php
+++ owncloud/lib/base.php
@@ -128,6 +128,8 @@ class OC {
self::$configDir = OC::$SERVERROOT . '/' . PHPUNIT_CONFIG_DIR . '/';
} elseif(defined('PHPUNIT_RUN') and PHPUNIT_RUN and is_dir(OC::$SERVERROOT . '/tests/config/')) {
self::$configDir = OC::$SERVERROOT . '/tests/config/';
+ } elseif(isset($_SERVER["OWNCLOUD_CONFIG_DIR"])) {
+ self::$configDir = $_SERVER["OWNCLOUD_CONFIG_DIR"];
} else {
self::$configDir = OC::$SERVERROOT . '/config/';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment