在低于预期输出目录的目录中推进构建模型

propel building models in directories below expected output dir

我在 root 的 propel.yml 中有以下设置:

propel:
  paths:
    # The directory where Propel expects to find your `schema.xml` file.
    schemaDir: ./gateway/Propel/propelschema

    # The directory where Propel should output generated object model classes.
    phpDir: ./gateway/Propel/Model

    # The directory where Propel should output the compiled runtime configuration.
    phpConfDir: ./gateway/Propel

    # The directory where Propel should output the generated migrations.
    migrationDir: ./gateway/Propel/Migrations

    # The directory where Propel should output the generated DDL (or data insert statements, etc.)
    sqlDir: ./gateway

  database:
    connections:
      ...

我在 gateway/Propel/propelschema/schema.xml 中有以下内容:

<database name="default" defaultIdMethod="native" namespace="Propel\Model" defaultPhpNamingMethod="underscore">

我的条目 composer.json:

"autoload": {
  "psr-4": {
    "App\": "app/",
    "Gateway\": "gateway/",
    "Propel\Model\": "gateway/Propel/Model"
  },
  "classmap": [
    "database/"
  ]
}

当我 运行 ./propel model:build 我希望模型在 ./gateway/Propel/Model 中构建,但是它们在 ./gateway/Propel/Model/Propel/Model 中构建但具有正确的命名空间在文件中...

不确定这里发生了什么,所以任何一个都很好。

如果需要,可以提供更多详细信息。

在您的 schema.xml 中,使用 \Propel\Model 而不是 Propel\Model。这是一个具有多个 PR 的已知错误。