2017-08-22 10 views
0

私はSymfonyをFlexでテストしています。私はうまく動作している非常に小さなアプリケーション(幸運な番号ジェネレータ)を持っています。 Flex経由でweb_profilerを追加したいと思います。それが正常に動作します composer require web_profiler --devdevサブディレクトリで宣言されたルートをロードするには? (開発環境で)

、キャッシュが正常にウォームアップされています

私は、このコマンドを起動します。しかし、ホームページをチェックすると、エラーが発生しました:"_wdt"ルートが存在しません。

新しいconfig/routes/dev/web_profiler.yamlファイルを確認しました。これはFlexによって作成されたものです。それは含まれています:

web_profiler_wdt: 
    resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml' 
    prefix: /_wdt 

web_profiler_profiler: 
    resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml' 
    prefix: /_profiler 

それは良いようです。このコードをコピーしてconfig/routes.yamlに追加します。エラーは消えます。 config/routes/devサブディレクトリのyamlファイルがロードされていないことを理解しました。

/config/routes/dev subdirectoryのファイルがロードされないのはなぜですか?どのステップは私のdevの設定ファイルをロードすることを忘れましたか?ここで

# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file 
# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production. 
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration 

###> symfony/framework-bundle ### 
APP_ENV=dev 
APP_DEBUG=1 
APP_SECRET=80b8077a9ccaaf2b5dd3427b512bae42 
###< symfony/framework-bundle ### 

config/routes.yamlファイル

index: 
    path:/
    defaults: { _controller: 'App\Controller\GeneratorController::numberAction' } 

# Depends on sensio/framework-extra-bundle, doctrine/annotations, and doctrine/cache 
# install with composer req sensio/framework-extra-bundle annot 
controllers: 
    resource: ../src/Controller/ 
    type: annotation 

これは、設定のサブディレクトリのスクリーンショットです:

は、ここに私の.envファイルです。私は基準を尊重していると思います。 This is the screenshot of the config subdirectories

答えて

0

キャッシュは正常にウォームアップされましたが、十分ではありません。作品には、私もキャッシュをクリアする必要があります。

"scripts": { 
    "auto-scripts": { 
     "assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd", 
     "security:check": "symfony-cmd", 
     "cache:clear --no-warmup": "symfony-cmd", 
     "cache:warmup": "symfony-cmd" 
    }, 
    "post-install-cmd": [ 
     "@auto-scripts" 
    ], 
    "post-update-cmd": [ 
     "@auto-scripts" 
    ] 
    }, 

追加された行はこの1つである:"cache:clear --no-warmup": "symfony-cmd"

この行は、アプリケーションをインストールする際に必要ではありませんが、私のcomposer.jsonで

、私は、コマンドポストの更新のためにラインを追加しました更新中に必要です。

関連する問題