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
Merged

Improved Compiler & Loader extendability #62

merged 1 commit into from Jan 30, 2017

Conversation

lookyman
Copy link
Contributor

@lookyman lookyman commented Feb 27, 2015

No description provided.

@JanTvrdik
Copy link
Contributor

@JanTvrdik JanTvrdik commented Feb 27, 2015

Can you describe the use case?

@lookyman
Copy link
Contributor Author

@lookyman lookyman 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
Copy link
Member

@dg dg commented Mar 4, 2015

createLoader & createCompiler should be protected.

@lookyman
Copy link
Contributor Author

@lookyman lookyman commented Mar 4, 2015

@dg right..

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

Successfully merging this pull request may close these issues.

None yet

6 participants