Пример #1
0
 /**
  * Set a global config
  *
  * @param \Zend\Config\Config $config
  */
 public static function setConfig(\Zend\Config\Config $config)
 {
     self::$_config = $config;
     if (null !== ($broker = $config->get('adapter_broker'))) {
         self::setAdapterBroker($broker);
     }
     if (null !== ($broker = $config->get('scrolling_style_broker'))) {
         self::setScrollingStyleBroker($broker);
     }
     $scrollingStyle = $config->get('scrolling_style');
     if ($scrollingStyle != null) {
         self::setDefaultScrollingStyle($scrollingStyle);
     }
 }
Пример #2
0
 /**
  * Set a global config
  *
  * @param array|Traversable $config
  */
 public static function setConfig($config)
 {
     if ($config instanceof Traversable) {
         $config = IteratorToArray::convert($config);
     }
     if (!is_array($config)) {
         throw new Exception\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable');
     }
     self::$_config = $config;
     if (isset($config['adapter_broker']) && null !== ($broker = $config['adapter_broker'])) {
         self::setAdapterBroker($broker);
     }
     if (isset($config['scrolling_style_broker']) && null !== ($broker = $config['scrolling_style_broker'])) {
         self::setScrollingStyleBroker($broker);
     }
     $scrollingStyle = isset($config['scrolling_style']) ? $config['scrolling_style'] : null;
     if ($scrollingStyle != null) {
         self::setDefaultScrollingStyle($scrollingStyle);
     }
 }
Пример #3
0
 /**
  * Set a global config
  *
  * @param \Zend\Config\Config $config
  */
 public static function setConfig(\Zend\Config\Config $config)
 {
     self::$_config = $config;
     $adapterPaths = $config->get('adapterpaths');
     if ($adapterPaths != null) {
         self::addAdapterPrefixPaths($adapterPaths->adapterpath->toArray());
     }
     $prefixPaths = $config->get('prefixpaths');
     if ($prefixPaths != null) {
         self::addScrollingStylePrefixPaths($prefixPaths->prefixpath->toArray());
     }
     $scrollingStyle = $config->get('scrollingstyle');
     if ($scrollingStyle != null) {
         self::setDefaultScrollingStyle($scrollingStyle);
     }
 }
Пример #4
0
 /**
  * Set a global config
  *
  * @param array|\Traversable $config
  * @throws Exception\InvalidArgumentException
  */
 public static function setOptions($config)
 {
     if ($config instanceof Traversable) {
         $config = ArrayUtils::iteratorToArray($config);
     }
     if (!is_array($config)) {
         throw new Exception\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable');
     }
     self::$_config = $config;
     if (isset($config['adapter_plugins']) && null !== ($adapters = $config['adapter_plugins'])) {
         self::setAdapterPluginManager($adapters);
     }
     if (isset($config['scrolling_style_plugins']) && null !== ($adapters = $config['scrolling_style_plugins'])) {
         self::setScrollingStylePluginManager($adapters);
     }
     $scrollingStyle = isset($config['scrolling_style']) ? $config['scrolling_style'] : null;
     if ($scrollingStyle != null) {
         self::setDefaultScrollingStyle($scrollingStyle);
     }
 }