You are here

function getid3_instance in getID3() 8

Same name and namespace in other branches
  1. 5 getid3.module \getid3_instance()
  2. 6 getid3.module \getid3_instance()
  3. 7.2 getid3.module \getid3_instance()
  4. 7 getid3.module \getid3_instance()

Create and initialize an instance of getID3 class.

1 call to getid3_instance()
getid3_analyze in ./getid3.module
Analyze file and return its media information.

File

./getid3.module, line 49

Code

function getid3_instance() {
  $id3 = NULL;
  $id3_lib_available = getid3_load();
  if ($id3_lib_available == FALSE) {
    drupal_set_message(t("The getid3() module cannot find the getID3 library used to read and write ID3 tags. The site administrator will need to verify that it is installed and then update the <a href='!admin-settings-audio-getid3'>settings</a>.", array(
      '!admin-settings-audio-getid3' => Url::fromRoute('getid3.config'),
    )), 'error', FALSE);
    return $id3;
  }
  $id3 = new getID3();

  // MD5 is a big performance hit. Disable it by default.
  $id3->option_md5_data = FALSE;
  $id3->option_md5_data_source = FALSE;
  $id3->encoding = 'UTF-8';
  return $id3;
}