适应性-如何从ZF2命令行使用Doctrine ORM模块 [英] Apigility - How to use Doctrine ORM Module from ZF2 command line

查看:97
本文介绍了适应性-如何从ZF2命令行使用Doctrine ORM模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Apigility 的新手.我正在尝试配置doctrine-orm-module.当我尝试运行以下命令并出现此错误

Hi i'm new with Apigility. Im trying to configure doctrine-orm-module. When i tried to run the command below and getting this error

$ cd /var/www/apigility/zf-apigility-skeleton/vendor/doctrine/doctrine-module/bin
$ php doctrine-module.php

错误是:

PHP Fatal error:  Uncaught exception 'Zend\ServiceManager\Exception\ServiceNotFoundException' with message 'Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for doctrine.cli' in /var/www/apigility/zf-apigility-skeleton/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:529
Stack trace:
#0 /var/www/apigility/zf-apigility-skeleton/vendor/doctrine/doctrine-module/bin/doctrine-module.php(51): Zend\ServiceManager\ServiceManager->get('doctrine.cli')
#1 {main} thrown in /var/www/apigility/zf-apigility-skeleton/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 529

Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\ServiceNotFoundException' with message 'Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for doctrine.cli' in /var/www/apigility/zf-apigility-skeleton/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:529
Stack trace:
#0 /var/www/apigility/zf-apigility-skeleton/vendor/doctrine/doctrine-module/bin/doctrine-module.php(51): Zend\ServiceManager\ServiceManager->get('doctrine.cli')
#1 {main} thrown in /var/www/apigility/zf-apigility-skeleton/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 529

我遵循了 DoctrineORMModule的readme.md

推荐答案

您不需要直接在bin文件夹中运行doctrine-module cli.如果配置正确,DoctrineModule已将相关的控制台路由绑定到该应用程序.

You don't need to run doctrine-module cli directly inside the bin folder. DoctrineModule already binds related console routes to the application if it's configured correctly.

尝试一下:

$ cd /var/www/apigility/zf-apigility-skeleton
$ php public/index.php orm:info

希望有帮助.

这篇关于适应性-如何从ZF2命令行使用Doctrine ORM模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆