Aimeos\Shop\Base\Config::get PHP Method

get() public method

Creates a new configuration object.
public get ( integer $type = 'frontend' ) : Aimeos\MW\Config\Iface
$type integer Configuration type ("frontend" or "backend")
return Aimeos\MW\Config\Iface Configuration object
    public function get($type = 'frontend')
    {
        $configPaths = $this->aimeos->get()->getConfigPaths();
        $config = new \Aimeos\MW\Config\PHPArray(array(), $configPaths);
        if (function_exists('apc_store') === true && $this->config->get('shop.apc_enabled', false) == true) {
            $config = new \Aimeos\MW\Config\Decorator\APC($config, $this->config->get('shop.apc_prefix', 'laravel:'));
        }
        $config = new \Aimeos\MW\Config\Decorator\Memory($config, $this->config->get('shop'));
        if (($conf = $this->config->get('shop.' . $type, array())) !== array()) {
            $config = new \Aimeos\MW\Config\Decorator\Memory($config, $conf);
        }
        return $config;
    }

Usage Example

Esempio n. 1
0
 /**
  * Returns the current context
  *
  * @param boolean $locale True to add locale object to context, false if not (deprecated, use \Aimeos\Shop\Base\Locale)
  * @param string $type Configuration type, i.e. "frontend" or "backend" (deprecated, use \Aimeos\Shop\Base\Config)
  * @return \Aimeos\MShop\Context\Item\Iface Context object
  */
 public function get($locale = true, $type = 'frontend')
 {
     $config = $this->config->get($type);
     if ($this->context === null) {
         $context = new \Aimeos\MShop\Context\Item\Standard();
         $context->setConfig($config);
         $this->addDataBaseManager($context);
         $this->addFilesystemManager($context);
         $this->addMessageQueueManager($context);
         $this->addLogger($context);
         $this->addCache($context);
         $this->addMailer($context);
         $this->addSession($context);
         $this->addUser($context);
         $this->addGroups($context);
         $this->context = $context;
     }
     $this->context->setConfig($config);
     if ($locale === true) {
         $localeItem = $this->locale->get($this->context);
         $this->context->setLocale($localeItem);
         $this->context->setI18n($this->i18n->get(array($localeItem->getLanguageId())));
     }
     return $this->context;
 }
All Usage Examples Of Aimeos\Shop\Base\Config::get