You are here

function PHPVideoToolkit::__destruct in Video 7.2

Same name and namespace in other branches
  1. 7 libraries/phpvideotoolkit/phpvideotoolkit.php5.php \PHPVideoToolkit::__destruct()

Destructs ffmpeg and removes any temp files/dirs

1 call to PHPVideoToolkit::__destruct()
PHPVideoToolkit::reset in libraries/phpvideotoolkit/phpvideotoolkit.php5.php
Resets the class

File

libraries/phpvideotoolkit/phpvideotoolkit.php5.php, line 3609
Libary to access FFmpeg

Class

PHPVideoToolkit

Code

function __destruct() {

  //			loop through the temp files to remove first as they have to be removed before the dir can be removed
  if (!empty($this->_unlink_files)) {
    foreach ($this->_unlink_files as $key => $file) {
      if (is_file($file)) {
        @unlink($file);
      }
    }
    $this->_unlink_files = array();
  }

  //			loop through the dirs to remove
  if (!empty($this->_unlink_dirs)) {
    foreach ($this->_unlink_dirs as $key => $dir) {
      if (is_dir($dir)) {
        @rmdir($dir);
      }
    }
    $this->_unlink_dirs = array();
  }
}