Apache keeps crashing

The place for "I can't figure out how to..." questions.
Post Reply
Roembout
User
Posts: 1
Joined: Thu Apr 27, 2006 6:54 pm

Apache keeps crashing

Post by Roembout » Thu Apr 27, 2006 7:01 pm

I'm using PHP 5 with Apach but when I run the the function analyzedir() from the following code Apache crashes every time and I can't find out why.

Code: Select all

<?
class mp3analyzer
  {
    var $getID3;

    function mp3analyzer()
    {
      $this->getID3 = new getID3( );
      $this->getID3->encoding = 'UTF-8';

      $this->getID3->option_tag_id3v1 = false;
      $this->getID3->option_tag_id3v2 = true;
      $this->getID3->option_tag_lyrics3 = false;
      $this->getID3->option_tag_apetag = false;
      $this->getID3->option_tags_process = false;
      $this->getID3->option_tags_html = true;
    }

    function analyzedir($name_subdir)
    {
      $dh = opendir($name_subdir);
      while(gettype($file = $this->analyzedir($dh))!=boolean)
      {
        if ($file != '..')
        if ($file != '.')
        {
          $current_element = $name_subdir."/".$file; 
          if(is_dir($current_element))
          {
            $this->analyzedir($current_element);
          }
        }
	 
        if(is_file($current_element))
        {
          $this->analyze($current_element);
        }
      }
      closedir($dh);
    }
  }
?>
Anybody knows what I'm doing wrong?

Thx in advance.

Allan Hansen
getID3() v2 developer
Posts: 445
Joined: Sun May 04, 2003 2:22 pm
Location: Holmegaard, Denmark

Post by Allan Hansen » Mon May 01, 2006 1:02 pm

$this->analyze($current_element);

=>

$this->getID3->analyze($current_element);

Post Reply