FIX: Allow configuring Image backend via yaml.

This commit is contained in:
Jeremy Shipman 2014-07-28 10:28:52 +12:00
parent 48dd233050
commit ac95a875ed

View File

@ -73,11 +73,11 @@ class Image extends File {
private static $force_resample = false; private static $force_resample = false;
public static function set_backend($backend) { public static function set_backend($backend) {
self::$backend = $backend; self::config()->backend = $backend;
} }
public static function get_backend() { public static function get_backend() {
return self::$backend; return self::config()->backend;
} }
/** /**
@ -464,7 +464,7 @@ class Image extends File {
$cacheFile = call_user_func_array(array($this, "cacheFilename"), $args); $cacheFile = call_user_func_array(array($this, "cacheFilename"), $args);
$backend = Injector::inst()->createWithArgs(self::$backend, array( $backend = Injector::inst()->createWithArgs(self::config()->backend, array(
Director::baseFolder()."/" . $this->Filename Director::baseFolder()."/" . $this->Filename
)); ));