Nette\Config\Loader metoda save – špatné uložení configu?
Upozornění: Tohle vlákno je hodně staré a informace nemusí být platné pro současné Nette.

- Elfoslav
 - Člen | 15
 
Tak som si skúšal načítať, prípadne zmeniť a uložiť config.neon ale Nette protestuje :(
Pôvodná časť config.neon:
services:
		database: @Nette\Database\Connection
		authenticator: Authenticator( @database::table(users) )
Načítanie config.neon a jeho uloženie:
use Nette\Config\Loader;
class HomepagePresenter extends BasePresenter
{
	public function renderDefault()
	{
		$loader = new Loader();
        	$config = $loader->load(APP_DIR . "/config/config.neon");
        	$loader->save($config, APP_DIR . "/config/config.neon");
	}
}
Problematická časť configu po uložení:
services:
		database: @Nette\Database\Connection
		authenticator:
			value: Authenticator
			attributes:
				-
					value: @database::table
					attributes:
						- users
Ale to už asi Nette nepozná a vyhodí výnimku:
Nette\DI\ServiceCreationException
Service 'authenticator': Unknown key 'value', 'attributes' in definition of service.
Čo s tým? Potrebujem zmeniť config programovo, nie ručne.
EDIT: Verzia Nette 2.0
Editoval Elfoslav (26. 5. 2012 23:50)