Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Compiler & Loader extendability #62

Merged
merged 1 commit into from Jan 30, 2017

Conversation

@lookyman
Copy link
Contributor

commented Feb 27, 2015

No description provided.

@JanTvrdik

This comment has been minimized.

Copy link
Contributor

commented Feb 27, 2015

Can you describe the use case?

@lookyman

This comment has been minimized.

Copy link
Contributor Author

commented Feb 27, 2015

<?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

This comment has been minimized.

Copy link
Member

commented Mar 4, 2015

createLoader & createCompiler should be protected.

@lookyman

This comment has been minimized.

Copy link
Contributor Author

commented Mar 4, 2015

@dg right..

@dg dg force-pushed the nette:master branch 5 times, most recently from 912f91c to 94f96ad Jun 10, 2015

@dg dg force-pushed the nette:master branch 3 times, most recently from 2d6ac3c to 1d7d277 Jun 18, 2015

@dg dg force-pushed the nette:master branch from 333d42f to 9b0f815 Nov 13, 2015

@dg dg force-pushed the nette:master branch from ba7b241 to fb96e4f Feb 8, 2016

@dg dg force-pushed the nette:master branch 2 times, most recently from 231a29c to 7f12a9f Apr 21, 2016

@dg dg force-pushed the nette:master branch 9 times, most recently from 9fbd1d4 to a71f267 May 7, 2016

@dg dg force-pushed the nette:master branch 3 times, most recently from fb70434 to a096ee8 May 21, 2016

@dg dg force-pushed the nette:master branch from 34f8df4 to 6376a8e Jun 17, 2016

@dg dg force-pushed the nette:master branch from 5adb374 to aa40af0 Sep 21, 2016

@dg dg force-pushed the nette:master branch 11 times, most recently from 14452ae to db4f148 Jan 13, 2017

@dg dg force-pushed the nette:master branch 14 times, most recently from 5d38530 to c005bde Jan 24, 2017

@dg dg merged commit 2003c59 into nette:master Jan 30, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.3%) to 91.094%
Details

dg added a commit that referenced this pull request Jan 30, 2017

dg added a commit that referenced this pull request Jan 30, 2017

dg added a commit that referenced this pull request Feb 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.