Permalink
Browse files

Remove more unneeded mgd1 compat

  • Loading branch information...
flack committed Oct 6, 2017
1 parent 0220336 commit 48ebffc6d67936e34d3d7f01363d67c3068c1246
Showing with 8 additions and 23 deletions.
  1. +1 −3 lib/midcom/config/main.php
  2. +7 −20 lib/midcom/connection.php
@@ -280,7 +280,7 @@ class midcom_config implements arrayaccess
// Authentication configuration
'auth_type' => 'Legacy',
'auth_backend' => 'simple',
'auth_backend_simple_cookie_id' => '',
'auth_backend_simple_cookie_id' => 1,
'auth_login_session_timeout' => 3600,
'auth_login_session_update_interval' => 300,
'auth_frontend' => 'form',
@@ -493,8 +493,6 @@ public function __construct()
private function _complete_defaults()
{
$this->_default_config['auth_backend_simple_cookie_id'] = midcom_connection::get('config', 'auth_cookie_id');
if (class_exists('Memcache')) {
$this->_default_config['cache_module_content_backend'] = ['driver' => 'memcached'];
$this->_default_config['cache_module_memcache_backend'] = 'memcached';
View
@@ -21,14 +21,7 @@ class midcom_connection
*
* @var array
*/
private static $_data = [
'config' => [
'auth_cookie_id' => 1,
],
'schema' => [
],
];
private static $_data = [];
/**
* DB connection setup routine
@@ -201,10 +194,9 @@ public static function is_admin()
* Getter for various environment-related variables.
*
* @param string $key The key to look up
* @param string $subkey The subkey, if any
* @return mixed The found value or null
*/
public static function get($key, $subkey = null)
public static function get($key)
{
switch ($key) {
case 'uri':
@@ -219,16 +211,11 @@ public static function get($key, $subkey = null)
}
}
public static function _get($key, $subkey = null)
public static function _get($key)
{
if ( null === $subkey
&& isset(self::$_data[$key])) {
if (isset(self::$_data[$key])) {
return self::$_data[$key];
}
if ( null !== $subkey
&& isset(self::$_data[$key][$subkey])) {
return self::$_data[$key][$subkey];
}
return null;
}
@@ -312,10 +299,10 @@ private static function _parse_url($uri, $self, $prefix)
public static function get_unique_host_name()
{
if (null === self::_get('config', 'unique_host_name')) {
self::$_data['config']['unique_host_name'] = str_replace(':', '_', $_SERVER['SERVER_NAME']) . '_' . str_replace('/', '_', self::get_url('prefix'));
if (null === self::_get('unique_host_name')) {
self::$_data['unique_host_name'] = str_replace(':', '_', $_SERVER['SERVER_NAME']) . '_' . str_replace('/', '_', self::get_url('prefix'));
}
return self::$_data['config']['unique_host_name'];
return self::$_data['unique_host_name'];
}
}

0 comments on commit 48ebffc

Please sign in to comment.