simonsimcity/get-id3-bundle

Makes it easy to show the getId3 library in symfony's debugger timeline

Installs: 140

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

dev-master 2014-06-27 13:27 UTC

This package is not auto-updated.

Last update: 2024-11-05 06:46:08 UTC


README

This bundle creates a Symfony integration for the GetId3 library. All actions will be recorded and show up in the timeline in the Symfony2 profiler.

Currently only writing of tags is tracked. Feel free to extend it.

Installation

Require simonsimcity/get-id3-bundle into your composer.json file:

{
    "require": {
        "simonsimcity/get-id3-bundle": "dev-master"
    }
}

Register the bundle in your Kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Simonsimcity\GetId3Bundle\SimonsimcityGetId3Bundle(),
        // ...
    );
}

You can activate the stopwatch for every call against the GetId3 library by adding the following lines to your configuration:

simonsimcity_get_id3:
    profiler_enabled: true

My personal recommendation is to add these lines to your config_dev.yml file.

In addition, you have to use the factory, provided in this bundle instead of creating the instances by your own. Here's an example of how to use it:

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class SampleController extends Controller
{
    public function updateId3TagsAction($file)
    {
        $tagWriter = $this->get("SimonsimcityGetId3.Factory")->getTagsWriter();
        $tagWriter->filename = $file;
        $tagWriter->tagformats = array('id3v2.3');
        $tagWriter->tag_encoding = 'UTF-8';
        $tagWriter->remove_other_tags = true;
        
        // ...
        
        $tagWriter->WriteTags();
    }
}