daniel-zahariev / music-codes

Music Codes PHP library provides handy tools for codes in the music industry
MIT License
3 stars 0 forks source link

How exactly do we include this in our php files? #3

Closed adaniel2 closed 1 year ago

adaniel2 commented 1 year ago

I have something like this atm:

require DIR . '/vendor/autoload.php'; use MusicCodes\Isrc;

But I am still unable to use the Isrc class. How should I be going about this?

daniel-zahariev commented 1 year ago

The full namespace is different:

<?php 
require __DIR__ . '/vendor/autoload.php';
use DanielZ\MusicCodes\Isrc;

$isrc = new Isrc('GB-A1B-11-00003');
echo $isrc;
adaniel2 commented 1 year ago

Hi, thanks.

I tried this just now and get the following errors:

Undefined namespace 'MusicCodes' Undefined class 'Isrc'

Should I be doing something in addition to the code provided?

EDIT

I was able to clear the errors after reopening the file correctly in my IDE. The .php code was in fact working even prior to clearing the errors, thanks.