047-404-3740 info@ayane.co.jp
ページを選択

【フレームワークを読む】Laravelのマイグレーションファイルは何をしているのか? :その11:Console\Application:: doRunCommand()

Symfony\Component\Console\Application::find() メソッドからコマンド名が返ってきました。 TRY でコールしていましたので、例外が出た場合のロジックも書いてあります。 「定義されていません」「もしかしてこれのこと?」のような感じのメッセージをセットしています。 ざっと斜めよみしたら次に行きましょう。 $this->runningCommand に実行コマンドを代入しています。状態管理でしょうか。 次に doRunCommand() がコールされています。 $exitCode =...

【フレームワークを読む】Laravelのマイグレーションファイルは何をしているのか? :その10:Console\Application::find()

Console\Application::doRun() の処理の流れで find() メソッドがコールされているところまで読みました。では、find() を見てみましょう。 Symfony\Component\Console\Application::find() | 関連メソッド /** * Finds a command by name or alias. * * Contrary to get, this command tries to find the best * match if you give it an...

【フレームワークを読む】Laravelのマイグレーションファイルは何をしているのか? :その9:Console\Application::run()

いよいよ run() の実行です。 実際にコールされるのは Illuminate\Console\Application::run() です。 さっそく見てみましょう。 Illuminate\Console\Application::run() /** * {@inheritdoc} */ public function run(InputInterface $input = null, OutputInterface $output = null) { $commandName = $this->getCommandName(...