Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing compatibility issue caused by zendframework/zf2#1976

  • Loading branch information...
commit f9f87c5e07473b6ae5ffbccbca91ffb0a9deb445 1 parent 3b613db
@Ocramius Ocramius authored
View
21 bin/doctrine-module.php
@@ -18,7 +18,7 @@
*/
use Zend\ServiceManager\ServiceManager;
-use Zend\Mvc\Service\ServiceManagerConfig;
+use Zend\Mvc\Application;
ini_set('display_errors', true);
chdir(__DIR__);
@@ -43,23 +43,8 @@
throw new RuntimeException('Error: vendor/autoload.php could not be found. Did you run php composer.phar install?');
}
-// get application stack configuration
-$configuration = include 'config/application.config.php';
-
-// setup service manager
-$serviceManager = new ServiceManager(new ServiceManagerConfig(
- isset($configuration['service_manager']) ? $configuration['service_manager'] : array()
-));
-$serviceManager->setService('ApplicationConfig', $configuration);
-
-/* @var $moduleManager \Zend\ModuleManager\ModuleManagerInterface */
-$moduleManager = $serviceManager->get('ModuleManager');
-$moduleManager->loadModules();
-
-/* @var $application \Zend\Mvc\Application */
-$application = $serviceManager->get('Application');
-$application->bootstrap();
+$application = Application::init(include 'config/application.config.php');
/* @var $cli \Symfony\Component\Console\Application */
-$cli = $serviceManager->get('doctrine.cli');
+$cli = $application->getServiceManager()->get('doctrine.cli');
$cli->run();
View
1  tests/DoctrineModuleTest/ServiceManagerTestCase.php
@@ -62,6 +62,7 @@ public function getServiceManager(array $configuration = null)
$configuration = $configuration ?: static::getServiceManagerConfiguration();
$serviceManager = new ServiceManager(new ServiceManagerConfig($configuration));
$serviceManager->setService('ApplicationConfiguration', $configuration);
+ $serviceManager->setFactory('ServiceListener', 'Zend\Mvc\Service\ServiceListenerFactory');
/* @var $moduleManager \Zend\ModuleManager\ModuleManagerInterface */
$moduleManager = $serviceManager->get('ModuleManager');
$moduleManager->loadModules();
Please sign in to comment.
Something went wrong with that request. Please try again.