mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[feature/extension-manager] Make sure the extension manager works without cache
Includes a test for manager without a cache PHPBB3-10323
This commit is contained in:
parent
018a835997
commit
c785ef7aa7
2 changed files with 19 additions and 2 deletions
|
@ -48,7 +48,7 @@ class phpbb_extension_manager
|
||||||
$this->extension_table = $extension_table;
|
$this->extension_table = $extension_table;
|
||||||
$this->cache_name = $cache_name;
|
$this->cache_name = $cache_name;
|
||||||
|
|
||||||
$this->extensions = $this->cache->get($this->cache_name);
|
$this->extensions = ($this->cache) ? $this->cache->get($this->cache_name) : false;
|
||||||
|
|
||||||
if ($this->extensions === false)
|
if ($this->extensions === false)
|
||||||
{
|
{
|
||||||
|
@ -78,7 +78,11 @@ class phpbb_extension_manager
|
||||||
}
|
}
|
||||||
|
|
||||||
ksort($this->extensions);
|
ksort($this->extensions);
|
||||||
$this->cache->put($this->cache_name, $this->extensions);
|
|
||||||
|
if ($this->cache)
|
||||||
|
{
|
||||||
|
$this->cache->put($this->cache_name, $this->extensions);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -81,4 +81,17 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
|
||||||
|
|
||||||
$this->assertTrue(phpbb_ext_moo::$purged);
|
$this->assertTrue(phpbb_ext_moo::$purged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_enabled_no_cache()
|
||||||
|
{
|
||||||
|
$extension_manager = new phpbb_extension_manager(
|
||||||
|
$this->new_dbal(),
|
||||||
|
'phpbb_ext',
|
||||||
|
dirname(__FILE__) . '/',
|
||||||
|
'.php'
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->assertEquals(array('foo'), array_keys($extension_manager->all_enabled()));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue