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

Aperta
#840 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
php

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
PHP
Stelle
1.7k
Fork
166
Merge medio
1g 1h
PR unite (30g)
38

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di goaop/framework

Tutte le issue di goaop/framework

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.