Jump to:

23550 Posts in 19336 Topics by 2890 members

General Questions

SilverStripe Forums » General Questions » Deprecation class

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 369 Views
  • cwsoft
    Avatar
    Community Member
    57 Posts

    Deprecation class Link to this post

    Hello guys,

    just played around with the deprecation class introduced with SS 3.0, but got confused a bit.

    Currently testing on a clean "SS 3.1-beta3". Inside my module "_config.php" I set "GD::set_default_quality(95)" to increase the thumbnail image quality. The GD class was renamed to GDBackend in SS 3.1 and will throw a deprecation notice from SS 3.2 onwards (activated via code at bottom of "framework/filesystem/GD.php").

    When I try to force a deprecation notice (with SS 3.1-beta3) by setting the notification version in "mysite/_config.php" to Deprecation::notification_version('3.2') or 3.3, no notice is thrown at all. Dito for changing notification version in "framework/_config.php". My environment is set to DEV mode, flush=all was excecuted after I changed settings.

    Q1: Is it possible to trigger a notification for the GD class this way?
    Q2: What is the purpose of the file "framework/silverstripe_version", its not used for the deprecation stuff - right?

    Cheers cwsoft

  • cwsoft
    Avatar
    Community Member
    57 Posts

    Re: Deprecation class Link to this post

    Hi,

    think I figured it out myself.

    Seems invoking GD::set_default_quality(95) from a module _config.php does not trigger a notification at all. However using the same statement inside a module function triggers the deprecation notice as I was expecting.

    Q1: Does anybody know how to set default image quality via a config.yml file?
    Q2: Does anybody know how to distinguish between SS versions in config.yml files (e.g. GD::method for SS 3.0-3.1, GDBackend::method for SS >= 3.1)

    Cheers cwsoft

  • chillburn.com.au
    Avatar
    Community Member
    12 Posts

    Re: Deprecation class Link to this post

    To set the image quality via _config/config.yml you can use the following.

    GDBackend:
    default_quality: 95

    369 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.