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 (&$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' => 'blve_spotify', 'weight' => 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