示例#1
0
 public function testGetBodyAttributeOrder()
 {
     $view = $this->object->getView();
     $conf = new \Aimeos\MW\Config\PHPArray();
     $conf->set('client/html/catalog/filter/attribute/types', array('color', 'width', 'length'));
     $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $conf);
     $view->addHelper('config', $helper);
     $output = $this->object->getBody();
     $regex = '/<fieldset class="attr-color">.*<fieldset class="attr-width">.*<fieldset class="attr-length">/smu';
     $this->assertNotContains('<fieldset class="attr-size">', $output);
     $this->assertRegexp($regex, $output);
 }
示例#2
0
 public function testArray()
 {
     $start = microtime(true);
     $paths = array(__DIR__ . DIRECTORY_SEPARATOR . 'one', __DIR__ . DIRECTORY_SEPARATOR . 'two');
     for ($i = 0; $i < 1000; $i++) {
         $conf = new \Aimeos\MW\Config\PHPArray($paths);
         $conf->get('test/db/host');
         $conf->get('test/db/username');
         $conf->get('test/db/password');
     }
     $stop = microtime(true);
     echo "\n    config array: " . ($stop - $start) * 1000 . " msec\n";
 }
示例#3
0
 /**
  * Returns the config object
  *
  * @param string $type Configuration type ("frontend" or "backend")
  * @return \Aimeos\MW\Config\Iface Config object
  */
 public function get($type = 'frontend')
 {
     $paths = $this->container->get('aimeos')->getConfigPaths();
     $config = new \Aimeos\MW\Config\PHPArray(array(), $paths);
     if (function_exists('apc_store') === true && $config->get('apc_enabled', false) == true) {
         $config = new \Aimeos\MW\Config\Decorator\APC($config, $config->get('apc_prefix', 'slim:'));
     }
     $config = new \Aimeos\MW\Config\Decorator\Memory($config, $this->settings);
     if (isset($this->settings[$type])) {
         $config = new \Aimeos\MW\Config\Decorator\Memory($config, $this->settings[$type]);
     }
     return $config;
 }