Bug #69658
closed
Custom composer packages won't load
Added by Stefano Kowalke almost 9 years ago.
Updated almost 9 years ago.
Description
According to the wiki article TYPO3 will load custom Composer packages from Packages/Libraries/ when the constant TYPO3_COMPOSER_AUTOLOAD is set.
This doesn't work because the code which determines the path to Packages/Libraries/ returns the real path to the core instead of the path to the webroot.
Actual result:
/Users/$user/Sites/TYPO3/6-2/typo3/sysext/core/Classes/Core/../../../../../../Packages/Libraries/autoload.php
Expected result:
Packages/Libraries/autoload.php
- Status changed from New to Under Review
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43184
Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43184
Your setup will work if /Users/$user/Sites/TYPO3/Packages/Libraries/
is your vendor-dir
. Have you tried that? For 6.2 no other layout is supported.
(Resolving the path you mentioned gives /Users/$user/Sites/TYPO3/Packages/Libraries/autoload.php
)
My folder structure looks like
.
├── Packages
├── composer.json
├── composer.lock
├── fileadmin
├── index.php -> typo3_src/index.php
├── typo3 -> typo3_src/typo3
├── typo3_src -> /Users/sok/Sites/TYPO3/6-2
├── typo3cms
├── typo3conf
├── typo3temp
└── uploads
What's the full path to this root directory here? Again, your vendor-dir
must be /Users/$user/Sites/TYPO3/Packages/Libraries/autoload.php
in this setup for TYPO3 to find it.
The core is located at
/Users/$user/Sites/TYPO3/6-2
the doc root at
/Users/$user/Sites/$project/dev/htdocs
My vendor
dir in comoser.json is
"vendor-dir": "Packages/Libraries"
. I copied the code from
https://wiki.typo3.org/Composer.
$ composer install
installs the packages to
/Users/$user/Sites/$project/dev/htdocs/Packages/Libraries
The composer packages are part of my installation and not of the core as you suggest.
This will work if typo3_src will locate in the webroot and not somewhere outside.
- Status changed from Under Review to Closed
Closed as requested by Stefano.
Also available in: Atom
PDF