dev-master
9999999-devMutes deprecation logs in production
MIT
The Requires
by Oliver Stark
logging yii2 craftcms
Mutes deprecation logs in production
When migrating a site from Craft 2 to Craft 3, you will notice things changed in the templates. Twig tags got renamed and variable access is slightly different - they old way is usually still supported, but is marked as "deprecated"., (*1)
This extension prevents Craft from logging deprecation errors if 'devMode' => false
in config/general.php
.
It speeds up your site by reducing overhead of tracing the code and logging to the database., (*2)
Notice: Do not simply mute deprecation errors, remove them as soon as possible., (*3)
The benefits of this package are very limited. It is rather an example of how to use a Yii extension with Craft instead of a Plugin., (*4)
With this extra
option in the composer.json
you hook into Yii's bootstrapping process:, (*5)
"extra": { "bootstrap": "ostark\\MuteDeprecations\\Bootstrap" }
In the Bootstrap class, you learn how to access the Craft::$app
instance, to use services and to swap out a Craft core component from the container., (*6)
Require the package:, (*7)
composer require ostark/craft-mute-deprecations
Mutes deprecation logs in production
MIT
logging yii2 craftcms