How to install specific files from a package using composer.json

I am writing 1 page script to perform a relatively simple task. So I decided to use Flourish Unframework , which provides a bunch of cool classes that can be used separately.

I want to use only certain classes, say fDatabase, however the composer allows you to download the whole package!

I know that I can simply delete unnecessary files. BUT is there a way that a composer can just let me require certain files?

This is not what I am looking for because it is just autoload and notice the installation of 1 file from the whole package.

please, help.

a possible duplicate of this , but also did not answer it!

0
source share
1 answer

The composer allows the installation of the entire package. Just installing the files necessary to run only one function that you need is almost impossible at all, because the required file / class may have code that needs another class.

How to define this class? Classes can be created using variables, the class name can be combined by several lines. Composer will need to detect and possibly execute code that creates class names.

If you are really worried about downloading too much code, you can search for a more suitable package with fewer files, install this package yourself and remove what you don’t need, or just simply use it the way it is.

0
source

Source: https://habr.com/ru/post/1264394/


All Articles