Let's say I'm working on a PHP application and I want to integrate some PHP packages like TWIG. Using Composer or some other automated management or code assisting technologies is irrelevant here. All included packages will have the MIT license, plus a couple of packages with the LGPL license.

Let's assume I'm gonna have my own folder structure for allocating third-party packages. For this example, it will be /libraries.

A regular installation of TWIG looks like this:


What I would like to do is to have the src folder contents allocated in /libraries/twig or even /libraries/twig/twig (if I want to mimic the package naming convention onto the folder structure, so I could integrate the TWIG extensions package into something like /libraries/twig/extensions and so on...).

But I don't know if I must retain ALL files and folders (like Composer does when you add twig/twig as a dependency) or just the bare minimum (maybe the bare minimum plus the LICENSE file). I'm not going to modify any of the source files, just use them.

Is this possible or does this conflicts with the licensing terms for the package?

  • 5
    Both MIT and LGPL allow you to modify the source code before you redistribute it. If I made that change I would say I "modified the directory layout" of TWIG to suit my project. I'm not sure whether the physical layout really counts as part of the copyrighted work, but even if it does, you are already allowed to change it. – Brandin Nov 13 '17 at 10:49
  • @Brandin you should post this as an answer! – Philippe Ombredanne Nov 13 '17 at 14:47

Both MIT and the (Lesser) General Public License explicitly allow modifying the software. So if you want to remove files, rename or rearrange them, you are allowed to do this. Treat your changes the same as any other modification.

I'm not going to modify any of the source files, just use them.

A modification means reproducing something other than an exact copy. This means renaming, removing, or changing the directory structure of the project is a modification, since the result is no longer an exact copy. From the General Public License:

To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy.


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.