Reputation: 1
I'm using TYPO3 6.2.26, I added to my extension an external library (sinergi/browser-detector) using composer. We have two servers one for development and another for production. The problem appear in the production context, but in development work it excellent.
I have the next structure on both servers (git subversion):
myext/Resources/Private/composer.json
myext/Resources/Private/Libraries/autoload.php (generate by composer)
myext/Resources/Private/Libraries/sinergi/...
myext/Resources/Private/Libraries/composer/... (generate by composer)
myext/ext_autoload.php
I load the composer loader in the ext_autoload.php:
require __DIR__ . '/Resources/Private/Libraries/autoload.php';
My composer.json look like this:
{
"name": "vendor/vendor",
"description": "My description",
"type": "library",
"require-dev": {
"sinergi/browser-detector": "^6.1"
},
"config": {
"vendor-dir": "Libraries"
},
"authors": [
{
"name": "xxx",
"email": "xxx"
}
]
}
With this configurations it works without problems in the development environment. In production occurs a strange situation, when I delete the cache it works only one time, at the second time the web server returns a 500 Error:
PHP Fatal Error: class Sinergi\\BrowserDetector\\...not found...
I tried some solution which I founded in Internet like:
Adding to my composer.json:
"autoload": "prs-4": { "Sinergi\BrowserDetector\" : "Libraries/sinergi/browser-detector/src/" }
Dumping the autoload
composer dump-autoload
Disabling opcache
Deleting composer.lock and new install
But, the problem is still there only in production. I remove too the content of the typo3temp directory, and then it works one time, but at the second 500 Error. Do anybody know what can I make?
Upvotes: 0
Views: 679
Reputation: 7939
I don't know how your files end up on production but you should use
"require": {
"sinergi/browser-detector": "^6.1"
},
instead of require-dev
, otherwise, it is just for dev.
Upvotes: 1