Composer support

What features would you like to see in future versions of getID3() ?
Post Reply
naitsirch
User
Posts: 7
Joined: Wed Aug 19, 2009 6:43 am
Are you a spambot?: no
Location: Paderborn/Germany

Composer support

Post by naitsirch » Mon Feb 04, 2013 1:06 pm

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

soulhunter
getID3() v1 developer
Posts: 40
Joined: Mon Jan 11, 2010 5:37 pm
Are you a spambot?: no
Location: Kaliningrad, Russia
Contact:

Re: Composer support

Post by soulhunter » Sun Jul 07, 2013 8:04 pm

We'll do it soon.

soulhunter
getID3() v1 developer
Posts: 40
Joined: Mon Jan 11, 2010 5:37 pm
Are you a spambot?: no
Location: Kaliningrad, Russia
Contact:

Re: Composer support

Post by soulhunter » Tue Jul 09, 2013 4:47 pm

Added support for composer for version 1.10 (https://github.com/JamesHeinrich/getID3/commit/803a8b670b58751d912c9c34244308af2c9d6603)

sfakir
User
Posts: 2
Joined: Tue Jul 16, 2013 8:35 am
Are you a spambot?: no

Re: Composer support

Post by sfakir » Tue Jul 16, 2013 8:38 am

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

sfakir
User
Posts: 2
Joined: Tue Jul 16, 2013 8:35 am
Are you a spambot?: no

Re: Composer support

Post by sfakir » Tue Jul 16, 2013 9:22 am

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.

Post Reply