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"; }
/** * 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; }