Permalink
Browse files

use sharedir for rcs when available

  • Loading branch information...
flack committed Apr 1, 2012
1 parent 386f4e5 commit 2d4054c9e5a18b5a73eadbc1fe6a791714d0618a
Showing with 9 additions and 8 deletions.
  1. +9 −8 lib/midcom/config/midcom_config.php
@@ -577,20 +577,21 @@ private function _complete_defaults()
$this->_default_config['midcom_site_title'] = $_SERVER['SERVER_NAME'];
$this->_default_config['toolbars_simple_css_path'] = MIDCOM_STATIC_URL . "/midcom.services.toolbars/simple.css";
+ $sharedir = "/var/lib/midgard";
// TODO: Would be good to include DB name into the path
- $prefix = midcom_connection::get('config', 'prefix');
- if ($prefix == '/usr')
+ if (extension_loaded('midgard2'))
{
- $this->_default_config['midcom_services_rcs_root'] = '/var/lib/midgard/rcs';
- }
- else if ($prefix == '/usr/local')
- {
- $this->_default_config['midcom_services_rcs_root'] = '/var/local/lib/midgard/rcs';
+ $sharedir = midgard_connection::get_instance()->config->sharedir;
}
else
{
- $this->_default_config['midcom_services_rcs_root'] = "{$prefix}/var/lib/midgard/rcs";
+ $prefix = midcom_connection::get('config', 'prefix');
+ if ($prefix == '/usr/local')
+ {
+ $sharedir = '/var/local/lib/midgard';
+ }
}
+ $this->_default_config['midcom_services_rcs_root'] = $sharedir . '/rcs';
}
public function offsetSet($offset, $value)

0 comments on commit 2d4054c

Please sign in to comment.