Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

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

Deprecation class


Reply


3 Posts   413 Views

Avatar
cwsoft

Community Member, 57 Posts

20 April 2013 at 11:01pm

Edited: 22/04/2013 3:12am

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

Avatar
cwsoft

Community Member, 57 Posts

21 April 2013 at 11:21pm

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

Avatar
chillburn.com.au

Community Member, 12 Posts

16 July 2014 at 1:17am

Edited: 16/07/2014 1:18am

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

GDBackend:
default_quality: 95