Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/zendframework/zendframework#6552-remove-double-d…
Browse files Browse the repository at this point in the history
…ot-in-merged-config-cache-file-name' into develop

Close zendframework/zendframework#6552
  • Loading branch information
Ocramius committed Nov 22, 2014
155 parents 7c7afe3 + 1e3d7e8 + 774f1ec + fbd9c42 + 25f7da3 + 9fb11da + c2e87c3 + 62f83fa + cec8933 + d240b5c + 940c8ec + 3f85108 + 2e38381 + 027f505 + 5a2ba91 + 823b2d4 + 05c2a86 + fe05cd7 + 1009849 + e109317 + 4dff7e8 + ce0c75d + 6a82230 + 215e77c + 7e16a91 + 2493ed4 + 7ab2816 + 3d2db08 + 6fea908 + aad063e + 06319a5 + aee1ae3 + 412f870 + 9b0f1d4 + e8236b3 + 3e482af + 84d85f9 + 2edbf66 + 7b83fea + ae75c15 + 56429a2 + 3463608 + a990d75 + ed0260a + 40ce9ee + 540e95d + a1f3efa + b138336 + 0ac8011 + 498f096 + a002c09 + a72d069 + d696070 + 95b016c + f72f2a8 + 63f9aa4 + c62eb22 + 56ff1e4 + 17753e6 + 261ddba + 9c23ce8 + d2ea716 + 8a38d20 + 29c3c53 + 9681f39 + 7dc76e1 + 7e1a689 + f52efc3 + 5400ef9 + 2de31e5 + 5ef1929 + 5d57927 + fb86f9e + a0d3c0d + 754d50b + 9ae8ef7 + 80bb476 + 7a4072e + 1b4e215 + 9e453d7 + 1f0f6c3 + 512d4f8 + 702eefc + 1f67b00 + 7233001 + 4244857 + 163015b + fd694bc + a17a889 + 6aea729 + 1946426 + 0177483 + 27a94da + 8afdcae + 8e4ac91 + d060a98 + 725a039 + 4dc194c + 246b9e4 + 5207d60 + dbe0e62 + 429b268 + d48dc13 + afcf71c + 64397cc + 48ea5ac + b4afa2a + 11643c5 + cd431ca + 51b7c50 + 82247be + d2994aa + eaf4e29 + eeb69a6 + 3e3fff3 + c0a95c9 + 961798f + 57ae4ec + a4fa631 + 259684b + b38977d + 1a640d1 + e064a96 + 3913f14 + fe5e75d + 3085bbe + 8e7f807 + 09e57f8 + fd510c1 + 80c8682 + fc0c293 + 497c115 + 49df818 + d645847 + ee12220 + 9b92152 + 9059103 + a7a5529 + be06b37 + 590c66e + df27e78 + 1e31131 + adb430e + 1c9aa26 + 7abe866 + dfe045d + 1b4822b + ae1f9f3 + 986e6d4 + 6424a7a + 15f1b17 + 8a9ab31 + 3b54f16 + 3cf7727 + f332c1f commit d0a434a
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Listener/ListenerOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,11 @@ public function setConfigCacheKey($configCacheKey)
*/
public function getConfigCacheFile()
{
return $this->getCacheDir() . '/module-config-cache.' . $this->getConfigCacheKey().'.php';
if ($this->getConfigCacheKey()) {
return $this->getCacheDir() . '/module-config-cache.' . $this->getConfigCacheKey().'.php';
}

return $this->getCacheDir() . '/module-config-cache.php';
}

/**
Expand Down Expand Up @@ -330,7 +334,11 @@ public function setModuleMapCacheKey($moduleMapCacheKey)
*/
public function getModuleMapCacheFile()
{
return $this->getCacheDir() . '/module-classmap-cache.'.$this->getModuleMapCacheKey().'.php';
if ($this->getModuleMapCacheKey()) {
return $this->getCacheDir() . '/module-classmap-cache.' . $this->getModuleMapCacheKey() . '.php';
}

return $this->getCacheDir() . '/module-classmap-cache.php';
}

/**
Expand Down
36 changes: 36 additions & 0 deletions test/Listener/ListenerOptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,42 @@ public function testCanConfigureWithArrayInConstructor()
$this->assertSame(array('static', 'custom_paths'), $options->getConfigStaticPaths());
}

/**
* @group 6552
*/
public function testConfigCacheFileWithEmptyCacheKey()
{
$options = new ListenerOptions(array(
'cache_dir' => __DIR__,
'config_cache_enabled' => true,
'module_paths' => array('module','paths'),
'config_glob_paths' => array('glob','paths'),
'config_static_paths' => array('static','custom_paths'),
));

$this->assertEquals(__DIR__ . '/module-config-cache.php', $options->getConfigCacheFile());
$options->setConfigCacheKey('foo');
$this->assertEquals(__DIR__ . '/module-config-cache.foo.php', $options->getConfigCacheFile());
}

/**
* @group 6552
*/
public function testModuleMapCacheFileWithEmptyCacheKey()
{
$options = new ListenerOptions(array(
'cache_dir' => __DIR__,
'module_map_cache_enabled' => true,
'module_paths' => array('module','paths'),
'config_glob_paths' => array('glob','paths'),
'config_static_paths' => array('static','custom_paths'),
));

$this->assertEquals(__DIR__ . '/module-classmap-cache.php', $options->getModuleMapCacheFile());
$options->setModuleMapCacheKey('foo');
$this->assertEquals(__DIR__ . '/module-classmap-cache.foo.php', $options->getModuleMapCacheFile());
}

public function testCanAccessKeysAsProperties()
{
$options = new ListenerOptions(array(
Expand Down

0 comments on commit d0a434a

Please sign in to comment.