sites/<site>/libraries: Standard place for thirdparty module requirements
naught101 - June 19, 2009 - 13:07
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | base system |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | duplicate |
| Issue tags: | Libraries |
Jump to:
Description
There are a number of modules that require thirdparty tools or resources. These tools are usually stored in a sub-directory of the module directory. These tools should all be stored in a standard directory:
sites/all/libraries/*, or
sites/<site>/libraries/*
Some examples:
- Jquery, used by many modules.
- WYSIWYG editors, used by WYSIWYG API: already heading in this direction: #320562: Libraries API
- fonts, used by image_captcha: see #496204: Configurable font storage location (eg. /usr/share/fonts)
- There are probably a bunch of other things as well: other third-party tools, sounds, texture images, etc.
Reasoning:
- Multiple modules might use the same resources, better to have a standardised, centralised place to look for those tools/resources.
- Resources aren't disturbed when modules are updated.
- It's neater and easier.

#1
Marking as duplicate of http://drupal.org/project/libraries.
We have to properly sort this out in contrib first and Libraries API will be the common denominator for all those modules.
However, thanks for taking the time to report this issue.
#2
I don't think this should be closed just yet. Having all those modules depend on the Libraries module is going to be slightly annoying, why not push for inclusion into core? It's like 50 lines of code from what I can see...
So I'm marking this as 'postponed' while contrib shakes it off, but I think this should be targeted before the freeze. I have opened an issue with the Libraries module to see what's missing before core inclusion: #536126: target core inclusion for D7.
#3
It's 50 lines of code, because I didn't have the time to focus on development yet.
Properly supporting *external* libraries is a major challenge. There are multiple ways to achieve it, and Libraries API wants to provide an API to support all ways. If you read #315100: Allow to add JS/CSS libraries (sets of files, settings, and dependent libraries) more closely, then you can learn that support for external libraries was purposively left out from that patch.
Reverting status. Neither Libraries API nor Drupal core are ready for this yet.
And with "ready" I mean concepts, architecture, technology, and paradigm.