0

DATE()、NOW()、FROM_UNIXTIME() などの qb で mysql 関数を使用する必要があります。このトピックHow to install Doctrine Extensions in a Symfony2 projectを読んでいます。やったよ:

composer require "beberlei/DoctrineExtensions":"dev-master"

すべてが正常になりました:

Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing beberlei/doctrineextensions (dev-master 5e4ec9c)
Cloning 5e4ec9c3ec3434151e1c73144b4ab87ae30aefbc
etc...

私がやったとき:

doctrine:
    orm:
      auto_generate_proxy_classes: %kernel.debug%
      entity_managers:
        default:
          auto_mapping: true
          dql:
            datetime_functions:
              MONTH: DoctrineExtensions\Query\Mysql\Month
              YEAR: DoctrineExtensions\Query\Mysql\Year

しかし!symfony は私のためにこの例外を返します:

FileLoaderLoadException: Cannot import resource "/home/domain/www/domain.com/app/config/config.yml" from "/home/domain/www/domain.com/app/config/config_dev.yml". (A YAML file cannot contain tabs as indentation at line 106 (near " dql:").)

私の英語で申し訳ありませんが、ロシアのインターネット セグメントでは、Symfony2 フレームワークの通常のスペシャリストはいません。あなたの助けを願っています、私の友達!

4

1 に答える 1

0

あなたのエラーから:

A YAML file cannot contain tabs as indentation at line 106 (near " dql:")

このファイルにはタブがあります:

doctrine:
    orm:
      auto_generate_proxy_classes: %kernel.debug%
      entity_managers:
        default:
          auto_mapping: true
          dql:
            datetime_functions:
              MONTH: DoctrineExtensions\Query\Mysql\Month
              YEAR: DoctrineExtensions\Query\Mysql\Year

代わりに、タブはスペースを作成します。

于 2014-11-14T07:22:44.160 に答える