Skip to content

2.0.24: Add gp247_is_production() as the single source of truth for env checks

Choose a tag to compare

@gp247net gp247net released this 18 Aug 10:19
· 17 commits to master since this release
Replace the hardcoded `config('app.env') === 'production'` scattered across
the core with one shared helper, so every production-only safety behaviour
is driven by the SAME condition (CoreServiceProvider debug-off, the admin
env badge, and any future front/shop/plugin check).

WHY exact "production": the helper wraps Laravel's own canonical check
(App::environment() === 'production'), which is what the framework's artisan
destructive-command guard uses. Keeping the same definition guarantees the
GP247 safety nets never diverge from Laravel's — an alias like "prod"/"live"
is deliberately NOT production, because Laravel would not guard it either.

The CoreServiceProvider debug-off net is moved after the helper glob load
(which exits on failure) and guarded with function_exists, falling back to
Laravel's own check: this path also runs during composer/package:discover,
so the security net must never depend on helper load order.

@aidlc-unit admin-shell
@aidlc-story US-AUI-env-identity
@aidlc-adr ADR-002

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>