Prebuilt-cache errors tell framework integrations to run `bin/aspect cache:warmup:aop`: make the rebuild hint configurable

オープン
#840 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
72/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php

調査の方向性

Start with the three factory methods in src/Aop/Exception/WeavingException.php named in the issue and trace how integrations can provide a rebuild command. Add a unit test confirming the messages contain the configured command. Done when all three messages use that command and composer test and composer analyse pass; integration follow-ups are listed separately.

索引モデルが issue の本文から書いたものです。

説明

Enhancement

Found while building goaop/shop-demo-laravel and goaop/shop-demo-symfony (framework 4.0.0). Related: goaop/goaop-symfony-bundle#50.

Problem

Three exceptions of src/Aop/Exception/WeavingException.php end with the same hint: rebuild it with bin/aspect cache:warmup:aop. They are:

  • prebuiltCacheVersionMismatch(), :85-92;
  • sourceMissingFromPrebuiltCache(), :102-110;
  • the missing-cached-file variant, :119.

In the integrations that command doesn't exist or doesn't apply:

  • Laravel (goaop-laravel-bridge): php artisan aop:warmup;
  • Symfony (GoAopBundle): bin/console cache:clear (or cache:warmup), which rebuilds the container and the AOP cache together.

A Laravel user sees, for example:

Class App\Aspects\CachingAspect (...) is missing from the prebuilt AOP cache in .../storage/framework/aop:
with Features::PREBUILT_CACHE a request never weaves, so the cache is incomplete, rebuild it with `bin/aspect cache:warmup:aop`

Proposal

One static, overridable hint, set by the integrations once when their kernel is created:

// e.g. on AspectKernel (or WeavingException)
public static string $cacheRebuildCommand = 'bin/aspect cache:warmup:aop';

The three factory methods use it. GoAopBundle sets bin/console cache:clear, the Laravel bridge sets php artisan aop:warmup (or both pass it as a kernel option instead of a static).

Acceptance

  • A unit test: the messages contain the configured command.
  • Follow-ups in the bundle (goaop/goaop-symfony-bundle#50) and the bridge to set it.
  • composer test, composer analyse.
主要言語
PHP
スター
1.7k
フォーク
166
平均マージ
1日 1時間
マージ済み PR(30日)
38

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

goaop/framework のほかの issue

goaop/framework の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。