2017 © Pedro Peláez
 

yii2-extension craft-mute-deprecations

Mutes deprecation logs in production

image

ostark/craft-mute-deprecations

Mutes deprecation logs in production

  • Friday, April 6, 2018
  • by ostark
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 14 % Grown

The README.md

Mute Craft deprecations 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)

Why?

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)

  • https://www.yiiframework.com/doc/guide/2.0/en/structure-extensions
  • https://docs.craftcms.com/v3/plugin-intro.html

Install

Require the package:, (*7)

composer require ostark/craft-mute-deprecations

The Versions

06/04 2018

dev-master

9999999-dev

Mutes deprecation logs in production

  Sources   Download

MIT

The Requires

 

logging yii2 craftcms