gpt4 book ai didi

doctrine-orm - Doctrine 2 控制台工具显示 : You are missing a "cli-config.php" or "config/cli-config.php"

转载 作者:行者123 更新时间:2023-12-04 03:24:40 29 4
gpt4 key购买 nike

我运行了 Doctrine 控制台工具:

$ php vendor/doctrine/orm/bin/doctrine orm:schema-tool:create --dump-sql

我得到了这个而不是预期的功能:
You are missing a "cli-config.php" or "config/cli-config.php" file in your
project, which is required to get the Doctrine Console working. You can use the
following sample as a template:

<?php
use Doctrine\ORM\Tools\Console\ConsoleRunner;

// replace with file to your own project bootstrap
require_once 'bootstrap.php';

// replace with mechanism to retrieve EntityManager in your app
$entityManager = GetEntityManager();

return ConsoleRunner::createHelperSet($entityManager);

问题:
  • 我在 ZF2 上,没有名为 bootstrap.php 的文件
  • 我是 ZF2 的新手,所以我不知道我的 entityManager 是什么以及我应该为 GetEntityManager 设置什么

  • 我该如何进行这项工作?

    最佳答案

    简单的方法

    使用 Doctrine 模块:
    vendor/bin/doctrine-module orm:schema-tool:create --dump-sql
    注意:这个答案可能特定于这些框架:

  • Zend 框架
  • Zend 富有表现力的
  • 层板
  • 梅齐奥
  • 关于doctrine-orm - Doctrine 2 控制台工具显示 : You are missing a "cli-config.php" or "config/cli-config.php",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20147331/

    29 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com