public function save($group, $destination = null)
	{
		if ($destination === null)
		{
			$destination = $group;
		}

		if ( ! $this->has($group))
		{
			throw new \RuntimeException('Unable to save non-existig config group: '.$group);
		}

		$destination = $this->ensureDefaultFormat($destination);
		$format = pathinfo($destination, PATHINFO_EXTENSION);
		$handler = $this->getHandler($format);
		$data = $this->get($group);
		$output = $handler->format($data);
		$path = $this->findDestination($destination);

		if ( ! $path)
		{
			throw new \RuntimeException(sprintf('Could not save group "%" as "%s".', $group, $destination));
		}

		return file_put_contents($path, $output);
	}
public function save($group, $destination = null)
	{
		if ($destination === null)
		{
			$destination = $group;
		}

		if ( ! $this->has($group))
		{
			throw new \RuntimeException('Unable to save non-existig config group: '.$group);
		}

		$destination = $this->ensureDefaultFormat($destination);
		$format = pathinfo($destination, PATHINFO_EXTENSION);
		$handler = $this->getHandler($format);
		$data = $this->get($group);
		$output = $handler->format($data);
		$path = $this->findDestination($destination);

		if ( ! $path)
		{
			throw new \RuntimeException(sprintf('Could not save group "%" as "%s".', $group, $destination));
		}

		return file_put_contents($path, $output);
	}
public function save ( $ group , $ destination = null ) { if ( $ destination === null ) { $ destination = $ group ; } if ( ! $ this -> has ( $ group ) ) { throw new \ RuntimeException ( 'Unable to save non-existig config group: ' . $ group ) ; } $ destination = $ this -> ensureDefaultFormat ( $ destination ) ; $ format = pathinfo ( $ destination , PATHINFO_EXTENSION ) ; $ handler = $ this -> getHandler ( $ format ) ; $ data = $ this -> get ( $ group ) ; $ output = $ handler -> format ( $ data ) ; $ path = $ this -> findDestination ( $ destination ) ; if ( ! $ path ) { throw new \ RuntimeException ( sprintf ( 'Could not save group "%" as "%s".' , $ group , $ destination ) ) ; } return file_put_contents ( $ path , $ output ) ; }
Stores a config file

@param string      $group
@param string|null $destination

@throws \RuntimeException
Stores a config file