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

Revamp Bootstrap #1495

Merged

Conversation

EvanDotPro
Copy link
Member

Goals / features of this PR:

  • Allow for a massively simplified index.php (one liner once autoloading is set up). [done]
  • Allow modules to override the default services, which previously could only be overridden from application.config.php [done]
  • Keep track of where all config values came from so we can tell which modules or config files overrode each other. [done]
  • Fix EventManagerAwareInterface so that it does not force injection of a new event manager if one already exists. [done in #1500]
  • Allow modules to be able to provide initializers to the ServiceManager. [done in #1695]

index.php after this PR:

<?php
/**
 * This makes our life easier when dealing with paths. Everything is relative
 * to the application root now.
 */
chdir(dirname(__DIR__));

// Setup autoloading
include 'init_autoloader.php';

// Run the application!
Zend\Mvc\Application::init(include 'config/application.config.php')->run()->send();

Please merge ZendSkeletonApplication PR #82 after this.

@@ -58,7 +58,37 @@ public function createService(ServiceLocatorInterface $serviceLocator)
$configuration = $serviceLocator->get('ApplicationConfiguration');
$listenerOptions = new ListenerOptions($configuration['module_listener_options']);
$defaultListeners = new DefaultListenerAggregate($listenerOptions);
$serviceListener = new ServiceListener($serviceLocator);

$serviceConfig = array(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is not where this should be defined -- it will be defined in a more appropriate location.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are you thinking of putting it instead? I'm not 100% against this, tbh, particularly since you can specify an alternate ModuleManager factory in the application config.

@prolic
Copy link
Contributor

prolic commented Jun 14, 2012

Fix EventManagerAwareInterface so that it does not force injection of a new event manager if one already exists. - can you provide this bugfix as separated PR, please? So this one can get merged into master already.

@EvanDotPro
Copy link
Member Author

@prolic done.. see PR 1500.

This will create some conflicts with this PR though, so I'll have to fix this up.

@prolic
Copy link
Contributor

prolic commented Jun 14, 2012

Thanks. For the rest, looks good to me! :-)

@@ -19,7 +19,7 @@
* @category Zend
* @package Zend_Module
*/
interface ModuleManagerInterface extends EventManagerAwareInterface, EventsCapableInterface
interface ModuleManagerInterface extends EventManagerAwareInterface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to remove "use Zend\EventManager\EventsCapableInterface;"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks.

@weierophinney
Copy link
Member

I personally am +1 to this, once rebased. ;-) I'm not sure how much discussion we need to make the change -- but it'd be great to get this in for beta5.

@prolic
Copy link
Contributor

prolic commented Jun 25, 2012

beta5 is coming... ;-)

@EvanDotPro
Copy link
Member Author

I think this is ready to be reviewed. I'm still not completely happy with where I stuck the default service configuration (in the ModuleManagerFactory as a property), but that's an implementation detail that does not affect the public API. Travisbot should be commenting wit the build status shortly.

@travisbot
Copy link

This pull request fails (merged a0059e1 into ff7d573).

@EvanDotPro
Copy link
Member Author

Fixing Zend\View tests now...

@travisbot
Copy link

This pull request fails (merged df6d935 into ff7d573).

This is useful for unit testing. Edited
Zend\View\Helper\Navigation\AbstractTest to use this.
@travisbot
Copy link

This pull request fails (merged c914158 into ff7d573).

@travisbot
Copy link

This pull request passes (merged 51912e1 into ff7d573).

- Removes the loadModules.pre event
- Adds a loadModules event
- Use constants for event names to match Zend\Mvc
- All work contained within listeners now

Listeners that need to do things after modules are loaded, but do some
work that modules should be able to assume is complete in
loadModules.post should attach to the loadModules event with a negative
priority.
@travisbot
Copy link

This pull request passes (merged 99cc61f into ff7d573).

@EvanDotPro
Copy link
Member Author

I love you, @travisbot.

@weierophinney weierophinney merged commit 99cc61f into zendframework:master Jul 5, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants