0

Starting with a default installation of SilverStripe (using composer), I have the folders framework, cms, mysite, etc.

Using composer I then added some additional code, such as userforms with the command:

composer require silverstripe/userforms

This created the folder userforms in the root of my site.

However, to manage my code more easily, it would be nicer if all modules added by composer were in a subfolder together. This answer indicates how a default vendor-dir directory can be specified using the composer.json file.

There is already a vendor folder in existence (if I understand correctly, this is used by composer). Is it ok to use the vendor folder as the default vendor-dir setting, or would it be better to create a new folder instead?

Also, what do I need to do to move existing folders (such as userforms) into the appropriate sub-folder?

Community
  • 1
  • 1
Highly Irregular
  • 38,000
  • 12
  • 52
  • 70

1 Answers1

1

This behaviour is specified by type. The packages with "type": "library" will be placed into vendor folder.

This is how the framework was designed, it expects the files to be located where they are now. It uses legacy code and is unable to make use of Composer autoloading.

Estus Flask
  • 206,104
  • 70
  • 425
  • 565