Make extension compatible for TYPO3 v8

2019-08-02 19:03发布

问题:

I have a problem in TYPO3 v8.5.0 dev with own extensions. After creating a proper composer.json my classes are not found. Installation was done by copy into the typo3conf/ext folder as usual and activating in extension manager. Unfortunally the ext is not in TER, so this is the only way. After activating, i'm stuck with error:

Oops, an error occurred!

Class 'XXX\ExtKey...' not found

What do I miss so my classes are found again?

回答1:

If your extension is not installed with composer you have to add the autoload settings into the composer.json of the project.

"autoload": {
    "psr-4": {
      "Test\\Yourext\\": "web/typo3conf/ext/yourext/Classes"
    }
  }

Then you have to do a composer update or composer dump-autoload