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

TYPO3 bootstrapping for Symfony commands (i.e. TYPO3_CONF_VARS not available) #675

Closed
baschny opened this issue Feb 16, 2018 · 2 comments · Fixed by #676
Closed

TYPO3 bootstrapping for Symfony commands (i.e. TYPO3_CONF_VARS not available) #675

baschny opened this issue Feb 16, 2018 · 2 comments · Fixed by #676

Comments

@baschny
Copy link

baschny commented Feb 16, 2018

I used to call bin/typo3 cron_poeditor:termssummary (with typo3-cli) and it worked fine.

Now I am trying to use typo3-console v5 and calling bin/typo3cms cron_poeditor:termssummary as I used to.

I need to have access to the TYPO3 configuration (i.e. $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['cron_poeditor']); - which used to contain our TYPO3 configuration populated - also considering AdditionalConfiguration and stuff that handles the "Context" overrides in our environments.

$GLOBALS['TYPO3_CONF_VARS'] seems to be completely empty when running the code via typo3-console v5.

Any hints on how to achieve that with typo3-console only? Again: bug or something I should be doing differently in my code?

@baschny
Copy link
Author

baschny commented Feb 16, 2018

Ok, I found the problem: I was accessing TYPO3_CONF_VARS in the __construct of my Command, which is too early.

Moving that part to the initialize method, made it work:

-       public function __construct()
+       /** @see Command::initialize() */
+       public function initialize(InputInterface $input, OutputInterface $output)
        {
                $extConf =  unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['cron_poeditor']);

So you might want to close this issue.

I was in touch with @helhum via Slack, and he will think if it makes sense to change the bootstrapping of typo3-console to cope with that case too. So I keep it open for now. Helmut feel free to close if you think this is ok.

@helhum
Copy link
Member

helhum commented Feb 17, 2018

I'll fix this, because I claim TYPO3 Console is a drop in replacement for the typo3 cli binary, which isn't true any more, if you need to re-write your commands to satisfy TYPO3 Console

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 a pull request may close this issue.

2 participants