initialize($nzbname); } // ========================================================================= // public methods // ========================================================================= /** * initialize * * @param $nzbname */ function initialize($nzbname) { global $cfg; // vars $this->theFile = $cfg["transfer_file_path"].$nzbname; $this->files = array(); $this->size = 0; $this->filecount = 0; // load file $this->content = @file_get_contents($this->theFile); $tList = explode("\n", $this->content); if ((isset($tList)) && (is_array($tList))) { $fname = ""; $fsize = 0; foreach ($tList as $tLine) { // file-start if (strpos($tLine, "/i', '${1}', $tLine); $fsize = 0; } // segment if (strpos($tLine, "") !== false) { array_push($this->files, array( 'name' => $fname, 'size' => $fsize ) ); // size $this->size += $fsize; } } // count $this->filecount = count($this->files); } } /** * write Method * * @return boolean */ function write() { // write file if ($handle = @fopen($this->theFile, "w")) { $resultSuccess = (@fwrite($handle, $this->content) !== false); @fclose($handle); return $resultSuccess; } return false; } } ?>