Bug #69658

Custom composer packages won't load

Added by Stefano Kowalke over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2015-09-11
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.5
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

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

#1

Updated by Gerrit Code Review over 5 years ago

  • 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

#2

Updated by Gerrit Code Review over 5 years ago

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

#3

Updated by Mathias Brodala over 5 years ago

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)

#4

Updated by Stefano Kowalke over 5 years ago

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
#5

Updated by Mathias Brodala over 5 years ago

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.

#6

Updated by Stefano Kowalke over 5 years ago

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.

#7

Updated by Stefano Kowalke over 5 years ago

This will work if typo3_src will locate in the webroot and not somewhere outside.

#8

Updated by Andreas Fernandez over 5 years ago

  • Status changed from Under Review to Closed

Closed as requested by Stefano.

Also available in: Atom PDF