I have an app config file which declares globals using DEFINE:
define('BASE_DOMAIN', 'localhost/...');
define('BASE_URL', '//'.BASE_DOMAIN);
define('TMP_PATH', $_SERVER['DOCUMENT_ROOT'].'/app/tmp')
I’m also using a Media plugin which has three standard image sizes declared as follows:
$s = array('convert' => 'image/png', 'zoomCrop' => array(100, 100));
$m = array('convert' => 'image/png', 'fitCrop' => array(300, 300));
$l = array('convert' => 'image/png', 'fit' => array(600, 440));
I’m just wondering if their is some way I can declare those values as globals in the app config, e.g. replace ‘zoomCrop’ => array(100, 100)’ above with a variable defined in the app config.
I tried this (not working):
app config
$GLOBALS['RES_ZOOM_CROP'] = array(25, 25);
$GLOBALS['RES_FIT_CROP'] = array(300, 300);
$GLOBALS['RES_FIT'] = array(600, 440);
Plugin
$s = array('convert' => 'image/png', 'zoomCrop' => RES_ZOOM_CROP));
$m = array('convert' => 'image/png', 'fitCrop' => RES_FIT_CROP));
$l = array('convert' => 'image/png', 'fit' => RES_FIT));
Your example declares three global Variables and then uses three undefined Constants, it should work when you change the Plugin to this: