Loading third party PHP SDK library from a custom module drupal 7 I am writing a custom drupal module (my first one in my life), and I am trying to load an external library (https://github.com/jwilsson/spotify-web-api-php), and until now I used these methods:


Loaded file array in info file

files[] = spotify-web-api-php/vendor/autoload.php,spotify-web-api-php/src/Request.php,spotify-web-api-php/src/Session.php,spotify-web-api-php/src/SpotifyWebAPI.php,spotify-web-api-php/src/SpotifyWebAPIException.php
I made this function based on another answers here (Copied the library in libraries folder)

function blve_spotify_registry_files_alter (&amp;$files, $modules)
{
  if (!class_exists('SpotifyWebAPI\Session')) {
    $library_path = function_exists('libraries_get_path') ?
      libraries_get_path('spotify-web-api-php') : 'sites/all/libraries/spotify-web-api-php';

$files[$library_path . '/vendor/autoload.php'] = array(
  'module' =&gt; 'blve_spotify',
  'weight' =&gt; 0,
);


}
}
I used require_once but will only work on one function


None of these methods worked, when I made a function to call all the loaded files any of the methods or files I need are loaded, please help me to made it work with the required php files. Thanks in advance
Use libraries module to load 3rd party dependencies (easier way), or composer manager to load composer package (better way).

Here you can find some details and examples how to start with libraries module.