Method is used to create an alias, from specified parameters.
@param string $name Name of the alias to be created
@param string $config Configuration array of created alias
344437
public function createAlias($name, $config){
        $handle = fopen(vibius_BASEPATH.$this->aliasCache.$name.'.php','w+');
        if(!$handle){
            throw new Exception('Unable to create alias, fopen not successful');
        }
        $template = $this->getAliasTemplate();
        $template = str_replace('{$className}', $name, $template);
        $template = str_replace('{$providerName}', $config['provider'], $template);
        
        fwrite($handle, $template);
        fclose($handle);
        $this->aliases[$name] = true;
        return true;
    }
74724
public function install($config, $name) {
		$config['class'] = self::INSTALL_DIR . $name;
		return ScenarioHelper::run($config);
	}
255269
public static function connect($config = [], $name = 'default')
    {
        if (is_string($config) || (isset($config['dsn']) && !empty($config['dsn']))) {
            $config = self::parseDsn($config);
        }
        $options = array_merge(self::$defaultConfig, $config);
        if (empty($options['type'])) {
            throw new \InvalidArgumentException('Undefined db type');
        }
        $class                 = false !== strpos($options['type'], '\\') ? $options['type'] : '\\tpr\\db\\connector\\' . ucwords(strtolower($options['type'])) . "Connector";
        self::$instance[$name] = new $class($options);
        return self::$instance[$name];
    }
1140707
protected function buildTask($name, $config)
    {
        $container = $this->container;
        $command   = new Command($name);
        $command->setApplication($container->get('application'));
        $command->setDescription($config['description']);
        $command->setCode(function (InputInterface $input, OutputInterface $output) use ($name, $config, $container) {
            $formatter = $container->get('application')->getHelperSet()->get('formatter');
            $output->writeln(
                $formatter->formatBlock(array(sprintf('Running Task "%s"', $name)), 'info')
            );
            $successful = 0;
            foreach ($config['requires'] as $task) {
                $output->writeln(
                    $formatter->formatBlock(array(sprintf('Running Required Task "%s"', $task)), 'info')
                );
                $service = $container->get(sprintf('task.'.$task));
                $code = $service->run($input, $output);
                if (0 !== $code) {
                    $successful = -1;
                }
            }

            foreach ($config['commands'] as $cmd => $cmdConfig) {
                $output->writeln(
                    $formatter->formatBlock(array(sprintf('Running Command "%s"', $cmd)), 'info')
                );
                $serviceId = sprintf('command.%s', $cmdConfig['command']);
                if (!$container->has($serviceId)) {
                    $output->writeln(
                        $formatter->formatSection(
                            '<error>ERROR</error>',
                            sprintf('Command "%s" does not exist', $cmdConfig['command'])
                        )
                    );
                    $successful = -1;
                    continue;
                }

                $serviceConfig = array('command' => $cmdConfig['command']);
                $service       = $container->get($serviceId);
                $service->setApplication($container->get('application'));

                foreach ($cmdConfig['arguments'] as $arg => $value) {
                    $serviceConfig[$arg] = $value;
                }

                foreach ($cmdConfig['options'] as $opt => $value) {
                    $serviceConfig['--'.$opt] = $value;
                }

                $code = $service->run(new ArrayInput($serviceConfig), $output);

                if (0 !== $code) {
                    $successful = -1;
                    $output->writeln(
                        $formatter->formatBlock(array(sprintf('Command "%s" failure', $cmd)), 'error')
                    );
                } else {
                    $output->writeln(
                        $formatter->formatBlock(array(sprintf('Command "%s" success', $cmd)), 'info')
                    );
                }
            }

            return $successful;
        });

        return $command;
    }
848571
private static function instance($con_name, $config = [])
    {
        if (!isset(self::$instance[$con_name])) {
            self::$instance[$con_name] = Db::connect($config, $con_name);
        }
        return self::$instance[$con_name];
    }
562804
public function connect(array $config, string $name = 'main'): Connection
    {
        if (isset($this->connections[$name])) {
            throw new InvalidArgumentException("Connection [$name] is already configured.");
        }

        $this->connections[$name] = new Connection($config);

        return $this->connections[$name];
    }
574322
protected function createSplitConfig($name) {
    $id = strtolower($name);
    $split_config_file = $this->configSyncDir . "/config_split.config_split.{$id}.yml";
    if (file_exists($split_config_file)) {
      $this->say("The config_split file for $name already exists. Skipping.");
    }
    else {
      $uuid = $this->uuidGenerator->generate();
      $config = $this->twig->render('config_split.config_split.env.yml.twig', [
        'uuid' => $uuid,
        'name' => $name,
        'id' => $id,
      ]);
      $this->createSplitDir($name);
      $this->writeSplitConfig($split_config_file, $config);
    }
  }
937582
protected function makeConnection($name, array $config)
    {
        $timeout = isset($config['timeout']) ? $config['timeout'] : 10;

        $this->setOutput($connection = new Connection(

            $name, $config['host'], $config['username'], $this->getAuth($config), null, $timeout

        ));

        return $connection;
    }
409326
protected function registerAssetsManagerInstance($name, array $config)
	{
		$this->app->singleton("stolz.assets.group.$name", function ($app) use ($config) {

			if( ! isset($config['public_dir']))
				$config['public_dir'] = public_path();

			return new Assets($config);
		});
	}
850953
protected function makeFilterScope($name, $config)
    {
        $label = $config['label'] ?? null;
        $scopeType = $config['type'] ?? null;

        $scope = new FilterScope($name, $label);
        $scope->displayAs($scopeType, $config);

        /*
         * Set scope value
         */
        $scope->value = $this->getScopeValue($scope, @$config['default']);

        return $scope;
    }
405605
public static function create( $name = null, $conf = null ) 
	{
		if ( is_null( $name ) ) 
		{
			$name = static::$_default;
		}

		if ( !is_null( $conf ) && is_array( $conf ) )
		{
			return static::$_instances[$name] = new static( $name, $conf );
		}

		if ( !isset( static::$_instances[$name] ) )
		{
			static::$_instances[$name] = new static( $name );
		}

		return static::$_instances[$name];
	}
631868
protected static function modifyConfig($name, array $config, $override = false)
    {
        self::validateAgentName($name);
        if (!isset(self::$agentsConfig[$name])) {
            self::$agentsConfig[$name] = [];
        }
        $target = &self::$agentsConfig[$name];
        if ($override) {
            $target = $config;
        } else {
            $target = array_merge($target, $config);
        }
        if (self::hasAgent($name)) {
            self::getAgent($name)->config($target);
        }
    }
151435
protected function createConfigFile(string $name): void
    {
        $file = base_path($this->moduleName().'/'.$name.'/Config/config.php');
        if (! $this->files->exists($file)) {
            $this->files->put($file, $this->files->get(__DIR__.'/stubs/config.stub'));
        }
    }
1155993
public static function forge($name = 'default', array $config = array())
	{
		if ($exists = static::instance($name))
		{
			\Error::notice('Asset with this name exists already, cannot be overwritten.');
			return $exists;
		}

		static::$_instances[$name] = new \Asset_Instance(array_merge(static::$default_config, \Config::get('asset'), $config));

		if ($name == 'default')
		{
			static::$_instance = static::$_instances[$name];
		}

		return static::$_instances[$name];
	}
786097
public function createMapping(Configuration $config)
    {
        $this->createBaseStructure($config);
        $this->createExchanges($config);
        $this->createQueues($config);
        $this->setPermissions($config);
    }
1153907
public function getCommand($name, Config $config)
    {
        if (!$config->hasItem('commands', $name)) {
            if (!$config->hasItem('commands', '_'.$name)) {
                $config->checkItem('commands', $name);
            }
            $name = '_'.$name;
        }

        return $config->getItem('commands', $name);
    }
489477
private function validateDefinitionConfig($name, array &$config)
    {
        if (true === $config['virtual'] && 0 === count($config['property_paths'])) {
            throw new \InvalidArgumentException(sprintf('"property_paths" must be set for "virtual" characteristic "%s".', $name));
        }
        if ($config['type'] === 'datetime') {
            if ($config['format'] === '%s') {
                $config['format'] = 'd/m/Y';
            }
        } elseif (false === strpos($config['format'], '%s')) {
            throw new \InvalidArgumentException(sprintf('"format" must contain "%%s" for characteristic "%s".', $name));
        }
    }