Page 1 of 1

Composer support

Posted: Mon Feb 04, 2013 1:06 pm
by naitsirch
Hi.
Maybe you already have heard about "Composer" (see http://getcomposer.org/). It is a dependency manager for PHP projects. It is a great tool and provides an easy way to include libraries into your project and update them if necessary. Symfony2 uses it for example to install other libraries like Doctrine or Twig which are needed by Symfony. This is the Symfony's composer.json file for example: https://github.com/symfony/symfony/blob ... poser.json

So if you would integrate such a composer.json file and create a project for getID3 on https://packagist.org/ everyone could integrate getID3 much easier ;)

What do you think about that?

Best regards
Christian

Re: Composer support

Posted: Sun Jul 07, 2013 8:04 pm
by soulhunter
We'll do it soon.

Re: Composer support

Posted: Tue Jul 09, 2013 4:47 pm
by soulhunter
Added support for composer for version 1.10 (https://github.com/JamesHeinrich/getID3/commit/803a8b670b58751d912c9c34244308af2c9d6603)

Re: Composer support

Posted: Tue Jul 16, 2013 8:38 am
by sfakir
We will need this in core pretty much!

Composer + PSR-0!


There is also an aproach but only an old version : https://github.com/phansys/GetId3

Re: Composer support

Posted: Tue Jul 16, 2013 9:22 am
by sfakir
Hi everyone,

since I had the same issue, the following steps solved it for me, even getID3 is not PSR-0 compatible:

Composer.json:

1. Add custom repository:

Code: Select all

"repositories":
    [
        {
            "type": "package",
            "package": {
                "name": "JamesHeinrich/getID3",
                "version": "dev-master",
                "source": {
                    "url": "https://github.com/JamesHeinrich/getID3.git",
                    "type": "git",
                    "reference": "master"
                }
            }
        }
    ],

2. Require package

Code: Select all

"require": {
        "JamesHeinrich/getID3": "dev-master",

 },
3. Add a classmap, since getID3 filenames does not refer to the containing class

Code: Select all

    "autoload": {
        "psr-0": {
            "yourCode": "src/"
        },
        "classmap": ["vendor/JamesHeinrich/getID3/getid3/"]
    },
Use getID3 in your Code

Code: Select all

$getID3 = new \getID3();
            $tagwriter = new \getid3_write_id3v2();
Troubleshooting:

Check following mistakes:

[*] The \ is necassary
[*] getID3 has to be the first class which is loaded, because of the defined global constants in the code.