protected function runProviders(array $providers, array $properties = array())
    {
        $data = array();

        foreach ($providers as $config) {
            if (is_string($config)) {
                $config = array($config);
            }

            $className = array_shift($config);

            if (isset(self::$config->providers[$className])) {
                $config = \CMap::mergeArray(self::$config->providers[$className], $config);
            } else {
                $config['class'] = $className;
            }

            if (!class_exists($config['class'])) {
                throw new Exception("Provider '{$config['class']}' does not exist.");
            }

            $class = new \ReflectionClass($config['class']);
            foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
                $name = $property->getName();

                if (!isset($config[$name]) && isset($properties[$name])) {
                    $config[$name] = $properties[$name];
                }
            }

            $provider = \Yii::createComponent($config);

            $data = array_merge($data, $provider->provide());
        }

        return $data;
    }