1

I am sorry if this has once been asked but I lack understanding on how this should work.

I am building a File Server to manage uploading and downloading of music files and have found getID3 library that I can use to get information about the files being uploaded.

  1. I have installed the library via composer. Below is my entry on composer.json in my root director

    "james-heinrich/getid3": "dev-master"
    

Vendor folder was successfully updated with the library.

  1. The library has not been added onto autoload_namespaces.php file in vendor/composer (see below):

    $vendorDir = dirname(dirname(__FILE__));
    $baseDir = dirname($vendorDir);
    
    return array(
      'Symfony\\Component\\Filesystem\\' => array($vendorDir . '/symfony/filesystem'),
      'Psr\\Log\\' => array($vendorDir . '/psr/log'),
      'GetId3_' => array($vendorDir . '/phansys/getid3'),
     );
    

Also under autoload_psr4.php file in vendor/composer the namespace for the library has not been registered either. I am not sure if this would be the case. Below is the content of the file:

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
  'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
  'FileServer\\' => array($baseDir . '/src'),
 );

Question(s)

  • How can I access the class libraries from getID3? Is there any special operation that I need to perform to make these classes available to me?

NB: The demos folder of the library does not use namespaces but rather "require" to include class files and that in my understanding forfeits the point of composer and namespaces. Resorting to Phansys Symdony library didnt help at all as I was not even sure if the library can be used on standalone projects.

Thanking you in advance.

scruffycoder86
  • 527
  • 1
  • 5
  • 24

1 Answers1

0

Command composer dump-autoload is the answer thanks to @Frank.

scruffycoder86
  • 527
  • 1
  • 5
  • 24