[2.1] Module class map cache #2086

Merged
merged 6 commits into from Sep 14, 2012

Projects

None yet

5 participants

@coss
Contributor
coss commented Aug 2, 2012

Adds the ablity to cache the module class map.

'module_map_cache_enabled' => true,
'module_map_cache_key'     => 'some key',

The ModuleAutoloader now longer throws a build-in exception but Exception\InvalidArgumentException.

coss added some commits Aug 2, 2012
@coss coss Added module class map cache ability.
- ModuleAutoloader uses now Exception\InvalidArgumentException instead of the built-in InvalidArgumentException
c7c5591
@coss coss Renamed callback method and fixed API docblock 530017a
@travisbot

This pull request passes (merged 530017a into f30ec3f).

@travisbot

This pull request passes (merged 983101d into f30ec3f).

@weierophinney
Member

Assigned to 2.1. Also, you'll need to rebase, as the top-level test directory was finally renamed to "ZendTest".

@coss
Contributor
coss commented Aug 6, 2012

Should I PR the ModuleAutoloader exception fix separately so it can be fixed before 2.1?

@Maks3w
Member
Maks3w commented Aug 6, 2012

Hi,

We have renamed the folder for tests from Zend to ZendTest.

Can you rebase your PR to catch this change?

Thanks in advance.

@prolic prolic commented on the diff Sep 4, 2012
...d/ModuleManager/Listener/DefaultListenerAggregate.php
// High priority, we assume module autoloading (for FooNamespace\Module classes) should be available before anything else
- $this->listeners[] = $events->attach(ModuleEvent::EVENT_LOAD_MODULES, array($moduleAutoloader, 'register'), 9000);
+ $this->listeners[] = $events->attach(new ModuleLoaderListener($options));
@prolic
prolic Sep 4, 2012 Contributor

You forgot the first parameter!

@coss
coss Sep 5, 2012 Contributor

Oh, thanks. Not only that but more importantly the priority.

@coss
coss Sep 5, 2012 Contributor

Oh, no, ModuleLoaderListener implements ListenerAggregateInterface. The listener takes care of attaching it to the right event.

@prolic
prolic Sep 5, 2012 Contributor

Yes, sorry, my fault! Good job! ;-)

@coss coss added a commit to coss/zf2-documentation that referenced this pull request Sep 9, 2012
@coss coss Added module class map cache option sample (zendframework/zendframewo… a453d72
@coss
Contributor
coss commented Sep 13, 2012

The build passes. It is a random travis error; see error and real test

@weierophinney weierophinney commented on the diff Sep 14, 2012
library/Zend/ModuleManager/Listener/ConfigListener.php
@@ -386,18 +390,4 @@ protected function getCachedConfig()
{
return include $this->getOptions()->getConfigCacheFile();
}
-
- /**
- * @return ConfigListener
- */
- protected function updateCache()
@weierophinney
weierophinney Sep 14, 2012 Member

Why is this method removed?

@weierophinney
weierophinney Sep 14, 2012 Member

Never mind -- I see it was moved to the listener.

@weierophinney weierophinney commented on the diff Sep 14, 2012
library/Zend/ModuleManager/Listener/ConfigListener.php
@@ -171,8 +171,12 @@ public function onLoadModulesPost(ModuleEvent $e)
}
// If enabled, update the config cache
- if ($this->getOptions()->getConfigCacheEnabled()) {
- $this->updateCache();
@weierophinney
weierophinney Sep 14, 2012 Member

Why is this functionality removed?

@weierophinney
weierophinney Sep 14, 2012 Member

Never mind -- I see it was moved to the listener.

@coss
coss Sep 14, 2012 Contributor

Yeah, the if statement was kinda redundant, so I removed it.

@weierophinney weierophinney added a commit that referenced this pull request Sep 14, 2012
@weierophinney weierophinney Merge branch 'feature/module-class-map-cache' of https://github.com/c…
…oss/zf2 into feature/module-class-map

PR #2086
2cdf2fc
@weierophinney weierophinney merged commit 0314584 into zendframework:master Sep 14, 2012

1 check passed

default The Travis build passed
Details
@weierophinney
Member

Merged -- please write up some docs on the feature, now, please! :)

@Maks3w Maks3w referenced this pull request in zendframework/zf2-documentation Sep 19, 2012
Closed

[2.1] Module class map cache option samples #240

@weierophinney weierophinney added a commit to zendframework/zend-loader that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'feature/module-class-map-cache' of https://github.com/c…
…oss/zf2 into feature/module-class-map

PR zendframework/zendframework#2086
b4fd812
@weierophinney weierophinney added a commit to zendframework/zend-modulemanager that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'feature/module-class-map-cache' of https://github.com/c…
…oss/zf2 into feature/module-class-map

PR zendframework/zendframework#2086
dcfa8ab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment