Skip to content

Conversation

@lookyman
Copy link
Contributor

No description provided.

@JanTvrdik
Copy link
Contributor

Can you describe the use case?

@lookyman
Copy link
Contributor Author

<?php

use Tester\Assert;

require __DIR__ . '/../bootstrap.php';

class TestCompiler extends Nette\DI\Compiler
{
    public function createLoader()
    {
        return (new Nette\DI\Config\Loader)->addAdapter('yml', new YmlAdapter);
    }
}

$compiler = new TestCompiler;
$compiler->loadConfig(__DIR__ . '/config.yml');
$container = $compiler->compile();

// Tester::assert(...)

And yes, I do realize that currently I only have to override a method that is just three lines longer. Or load the config with my own loader and pass it to Compiler::compile(). Or do it any other possible way...

@dg
Copy link
Member

dg commented Mar 4, 2015

createLoader & createCompiler should be protected.

@lookyman
Copy link
Contributor Author

lookyman commented Mar 4, 2015

@dg right..

@dg dg force-pushed the master branch 5 times, most recently from 912f91c to 94f96ad Compare June 10, 2015 11:52
@dg dg force-pushed the master branch 3 times, most recently from 2d6ac3c to 1d7d277 Compare June 19, 2015 11:58
@dg dg force-pushed the master branch 2 times, most recently from 231a29c to 7f12a9f Compare April 21, 2016 13:03
@dg dg force-pushed the master branch 9 times, most recently from 9fbd1d4 to a71f267 Compare May 11, 2016 07:11
@dg dg force-pushed the master branch 3 times, most recently from fb70434 to a096ee8 Compare May 23, 2016 09:23
@dg dg force-pushed the master branch 11 times, most recently from 14452ae to db4f148 Compare January 15, 2017 14:09
@dg dg force-pushed the master branch 14 times, most recently from 5d38530 to c005bde Compare January 30, 2017 00:30
@dg dg merged commit 2003c59 into nette:master Jan 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants