Both Libraries API and Variables API provide support for referencing third-party code in the sites/all/libraries/ directory. Could the developer of either project comment on the different strategies used, and on the possibility of a unified approach?

Comments

pillarsdotnet’s picture

sun’s picture

Status: Active » Closed (won't fix)

Sorry, it looks like you did not read or understand the project pages. These projects have zero in common (except for having API in the name), so there's nothing that could be clarified.

pillarsdotnet’s picture

Status: Closed (won't fix) » Active

From libraries.module, lines 9-22

/**
 * Helper function to build paths to libraries.
 *
 * @param $name
 *   The machine name of a library to return the path for.
 * @param $base_path
 *   Whether to prefix the resulting path with base_path().
 *
 * @return
 *   The path to the specified library.
 *
 * @ingroup libraries
 */
function libraries_get_path($name, $base_path = FALSE) {

From vars.module, lines 162-170

  /**                                                                                              
   * Returns the list of the directories where library files are looked in.                        
   *                                                                                               
   * @param $library                                                                               
   *   The library to look for. This parameter will be used as directory name.                     
   * @return                                                                                       
   *   An array of directories where the library can be found.                                     
   */
  public function getLibraryPath($library, $unused = array()) {

An issue where I suggested using the Libraries API module to move third-party code from the module directory to the libraries directory, and the module author opted to use the Variables API module to accomplish the same function:

#1007454: Rudimentary libraries support

pillarsdotnet’s picture

From the Libraries API project page:

This module introduces a common repository for libraries in sites/all/libraries resp. sites/<domain>/libraries for contributed modules.

From the Variables API project page:

allows finding the directory where a library has been installed (branch 2.x for Drupal 6 and 7)

Both the code and the description appear to be different implementations of the same goal.

sun’s picture

Status: Active » Closed (duplicate)

well, no idea what this means, but Libraries API is the unique project/module for handling libraries.

Thus, discussion can move into #1017644: Compare/contrast with Libraries API