LoginSignup
0
0

More than 5 years have passed since last update.

Symfony2の便利なコンソールコマンド一覧(順次更新予定)

Last updated at Posted at 2015-10-07

前置き

別記事でSymfony2関連の記事を書いていたのですが、
書くべきことがあり過ぎて内容が肥大化しいつまで経っても公開できないので、
一部は内容を分割して投下したいと思います^^;

実行環境

  • Symfony2.7.5

バージョン違いで廃止されたり移行していたりするコマンドがありますので
その点を念頭に置いてご覧ください。

Symfony2の便利なコンソールコマンド一覧

Symfony2では様々な機能の開発や設定等確認の際に役立つ
便利なコマンド機能を実装しています。以下に一覧をまとめます。
コマンドの実行はSymfony2のルートディレクトリで行います(あたりまえかw)。

設定確認系

router:debugコマンド
→アプリケーション内に設定されたすべてのルートを一覧で出力

ルートの追加とカスタマイズをする時に、このコマンド実行結果によってルートを視覚化し、
それに関する詳細な情報を取得・参照しておくと便利です。

コマンド実行結果
$ php app/console router:debug
The use of "router:debug" command is deprecated since version 2.7 and will be removed in 3.0. Use the "debug:router" instead.
[router] Current routes
 Name                             Method   Scheme Host Path                              
 _wdt                             ANY      ANY    ANY  /_wdt/{token}                     
 _profiler_home                   ANY      ANY    ANY  /_profiler/                       
 _profiler_search                 ANY      ANY    ANY  /_profiler/search                 
 _profiler_search_bar             ANY      ANY    ANY  /_profiler/search_bar             
 _profiler_purge                  ANY      ANY    ANY  /_profiler/purge                  
 _profiler_info                   ANY      ANY    ANY  /_profiler/info/{about}           
 _profiler_phpinfo                ANY      ANY    ANY  /_profiler/phpinfo                
 _profiler_search_results         ANY      ANY    ANY  /_profiler/{token}/search/results 
 _profiler                        ANY      ANY    ANY  /_profiler/{token}                
 _profiler_router                 ANY      ANY    ANY  /_profiler/{token}/router         
 _profiler_exception              ANY      ANY    ANY  /_profiler/{token}/exception      
 _profiler_exception_css          ANY      ANY    ANY  /_profiler/{token}/exception.css  
 _configurator_home               ANY      ANY    ANY  /_configurator/                   
 _configurator_step               ANY      ANY    ANY  /_configurator/step/{index}       
 _configurator_final              ANY      ANY    ANY  /_configurator/final              
 _twig_error_test                 ANY      ANY    ANY  /_error/{code}.{_format}          
 AppBundle_homepage               GET      ANY    ANY  /                                 
 AppBundle_sidebar                GET      ANY    ANY  /                                 
 AppBundle_about                  GET      ANY    ANY  /about                            
 AppBundle_contact                GET|POST ANY    ANY  /contact                          
 AppBundle_blog_show              GET      ANY    ANY  /{id}/{slug}                      
 AppBundle_comment_create POST     ANY    ANY  /comment/{blog_id}                

 homepage                         ANY      ANY    ANY  /  

...なんかつっこまれちゃってます(笑)。
このコマンドは今回の実行環境であるver_2.7では廃止され
「debug:router」というコマンドに代わっているようです。

利用されるバージョンによって適宜コマンドを使い分けましょう。

まとめ

今回は時間の関係上、取り急ぎこれだけです(笑)。
順次更新してまいりますのでお許しくださいm(_ _)m

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0