Exemple #1
0
 /**
  *
  * @param Oops_Config $config
  *        	new configuration
  * @param boolean $replace
  *        	replace current config or merge with new one (default)
  * @return void
  */
 public function configure($config, $replace = false)
 {
     if (is_object($this->_config)) {
         $this->_config->mergeConfig($config);
     } else {
         $this->_config = $config;
     }
 }
Exemple #2
0
 /**
  * 
  * @param string $previewType
  * @return Oops_Config
  */
 public static function getInstance($previewType)
 {
     self::_init();
     if (!self::$_config->{$previewType}->isValidConfig()) {
         throw new Oops_Image_Preview_Exception("Invalid preview type {$previewType}");
     }
     // @todo Consider cache these configs in static var
     $config = new Oops_Config(array('crop' => false, 'fill' => false, 'enlarge' => false));
     $config->mergeConfig(self::$_config->{$previewType});
     return $config;
 }