symfony-console arguments handling + WordPress Timber bridge#60
symfony-console arguments handling + WordPress Timber bridge#60drzraf wants to merge 4 commits intoumpirsky:masterfrom
Conversation
There was a problem hiding this comment.
Thanks for this, look promising. 👍
Please update https://github.com/umpirsky/Twig-Gettext-Extractor/#setup since old setup does not work any more.
Twig/Gettext/Extractor.php
Outdated
| { | ||
| $this->environment = $environment; | ||
| $this->reset(); | ||
| $this->input = $input; |
There was a problem hiding this comment.
$this->input is not defined in Extractor.
twig-gettext-extractor
Outdated
| * This file is part of the Twig Gettext utility. | ||
| * | ||
| * (c) Саша Стаменковић <umpirsky@gmail.com> | ||
| * (c) 2018 Raphaël Droz <raphael.droz+floss@gmail.com> |
There was a problem hiding this comment.
Please add this as author, not a copyright holder.
composer.json
Outdated
| "symfony/form": "~3.0|~4.0", | ||
| "symfony/asset": "~2.8|~3.0|~4.0" | ||
| "symfony/asset": "~2.8|~3.0|~4.0", | ||
| "symfony/console": "^4.1" |
There was a problem hiding this comment.
Please also support 4.0 with ~4.0. No reason not to.
twig-gettext-extractor
Outdated
| } | ||
| } | ||
| $file_loader = new Twig_Loader_Array($files); | ||
| $loaders->addLoader($file_loader); |
There was a problem hiding this comment.
$loaders->addLoader(new Twig_Loader_Array($files));
Twig/Gettext/Extractor.php
Outdated
| protected $parameters; | ||
|
|
||
| /** | ||
| * @var `Symfony\Component\Console\Input\ArgvInput |
There was a problem hiding this comment.
Remove ```. Use InputInterface instead.
Twig/Gettext/Extractor.php
Outdated
| { | ||
| $this->environment = $environment; | ||
| $this->reset(); | ||
| $this->input = $input; |
There was a problem hiding this comment.
Hang on, $this->input is never used, why do we have it here?
There was a problem hiding this comment.
I initially intended to use some input arguments (like debug) inside the Extractor.
Finally it was not the case, but that may useful later.
I've no problem with dropping it btw
* This commit uses symfony-console for manage arguments specific to Twig-Gettext-Extractor which used to be broken. * The $input is also passed to the extractor for possible futur use (eg: handling --debug) * Better Twig loaded. Twig Environment use a ChainLoader which is initialized according to file/paths passed to the command line. * It's possible to add a template directory the Twig-way and compile for one (or multiple templates). * The list of Twig templates to compile can now be passed through stdin, using --files stdin * Twig_SimpleFilter is fixed. true is not an accepted value anymore. Empty value callback avoid the cryptic Twig error: `Function 1() does not exist` * A --require flag is added to add custom PHP code before compilation. * Using the above, a brigde with WordPress+Timber is added. It loads Timber Twig extensions and add a couple of WordPress specific parameters to xgettext. * integrate umpirsky#53 (debugging)
|
Please update with latest master, travis fails now. |
|
@drzraf What is the status of the PR? Looks like we only need to update |
|
I updated the command in README.md, but not the text that appears inside the screenshot (new screenshot is needed). Could you? |
|
Sure, let's fix tests first. |
Function 1() does not exist