Esempio n. 1
0
 /**
  * Extracts the configuration options from the input object and updates the configuration values in the config object.
  *
  * @param \Aimeos\MW\Config\Iface $conf Configuration object
  * @param array Associative list of database configurations
  * @throws \RuntimeException If the format of the options is invalid
  */
 protected function setOptions(\Aimeos\MW\Config\Iface $conf)
 {
     foreach ((array) $this->option('option') as $option) {
         list($name, $value) = explode(':', $option);
         $conf->set($name, $value);
     }
 }
 /**
  * Extracts the configuration options from the input object and updates the configuration values in the config object.
  *
  * @param \Aimeos\MW\Config\Iface $conf Configuration object
  * @param array $options List of option key/value pairs
  * @param array Associative list of database configurations
  */
 protected function setOptions(\Aimeos\MW\Config\Iface $conf, array $options)
 {
     foreach ($options as $option) {
         list($name, $value) = explode(':', $option);
         $conf->set(str_replace('\\', '/', $name), $value);
     }
 }
Esempio n. 3
0
 /**
  * Extracts the configuration options from the input object and updates the configuration values in the config object.
  *
  * @param \Aimeos\MW\Config\Iface $conf Configuration object
  * @param InputInterface $input Input object
  * @param array Associative list of database configurations
  * @throws \RuntimeException If the format of the options is invalid
  */
 protected function setOptions(\Aimeos\MW\Config\Iface $conf, InputInterface $input)
 {
     foreach ((array) $input->getOption('option') as $option) {
         list($name, $value) = explode(':', $option);
         $conf->set(str_replace('\\', '/', $name), $value);
     }
 }
Esempio n. 4
0
/**
 * Returns the fixed and cleaned up database configuration
 *
 * @param \Aimeos\MW\Config\Iface $conf Configuration object
 * @return array Updated database configuration
 */
function getDbConfig(\Aimeos\MW\Config\Iface $conf)
{
    $dbconfig = $conf->get('resource', array());
    foreach ($dbconfig as $rname => $dbconf) {
        if (strncmp($rname, 'db', 2) !== 0) {
            unset($dbconfig[$rname]);
        } else {
            $conf->set('resource/' . $rname . '/limit', 2);
        }
    }
    return $dbconfig;
}