private function _parse() { $this->torrentArray = Lms_BTransform::decode($this->source); $this->_isLoaded = $this->_isValidTorrentFile(); $this->_files = array(); if ($this->_isLoaded) { $this->_encoding = isset($this->torrentArray['encoding']) ? $this->torrentArray['encoding'] : 'UTF-8'; if (isset($this->torrentArray['info']['files'])) { $dirName = $this->torrentArray['info']['name']; foreach ($this->torrentArray['info']['files'] as $file) { $filePath = $dirName . $this->_dirSeparator . implode($this->_dirSeparator, $file['path']); $this->_files[] = array('path' => $filePath, 'size' => $file['length']); } } else { $filePath = $this->torrentArray['info']['name']; $fileSize = $this->torrentArray['info']['length']; $this->_files[] = array('path' => $filePath, 'size' => $fileSize); } } return $this->_isLoaded; }