One Hat Cyber Team
Your IP :
216.73.216.182
Server IP :
203.175.9.166
Server :
Linux tanggamus.iixcp.rumahweb.net 5.14.0-427.28.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 2 03:44:10 EDT 2024 x86_64
Server Software :
LiteSpeed
PHP Version :
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
cite5577
/
www
/
lib
/
pkp
/
classes
/
search
/
Edit File:
SearchFileParser.inc.php
<?php /** * @defgroup search Search * Implements search tools, such as file parsers, workflow integration, * indexing, querying, etc. */ /** * @file classes/search/SearchFileParser.inc.php * * Copyright (c) 2014-2021 Simon Fraser University * Copyright (c) 2000-2021 John Willinsky * Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. * * @class SearchFileParser * @ingroup search * * @brief Abstract class to extract search text from a given file. */ class SearchFileParser { /** @var string the complete path to the file */ var $filePath; /** @var int file handle */ var $fp; /** * Constructor. * @param $filePath string */ function __construct($filePath) { $this->filePath = $filePath; } /** * Return the path to the file. * @return string */ function getFilePath() { return $this->filePath; } /** * Change the file path. * @param $filePath string */ function setFilePath($filePath) { $this->filePath = $filePath; } /** * Open the file. * @return boolean */ function open() { $this->fp = @fopen($this->filePath, 'rb'); return $this->fp ? true : false; } /** * Close the file. */ function close() { fclose($this->fp); } /** * Read and return the next block/line of text. * @return string (false on EOF) */ function read() { if (!$this->fp || feof($this->fp)) { return false; } return $this->doRead(); } /** * Read from the file pointer. * @return string */ function doRead() { return fgets($this->fp); } // // Static methods // /** * Create a text parser for a file. * @param SubmissionFile $submissionFile * @return SearchFileParser */ static function fromFile($submissionFile) { $fullPath = rtrim(Config::getVar('files', 'files_dir'), '/') . '/' . $submissionFile->getData('path'); return SearchFileParser::fromFileType($submissionFile->getData('mimetype'), $fullPath); } /** * Create a text parser for a file. * @param $type string * @param $path string */ static function fromFileType($type, $path) { switch ($type) { case 'text/plain': $returner = new SearchFileParser($path); break; case 'text/html': case 'text/xml': case 'application/xhtml': case 'application/xml': $returner = new SearchHTMLParser($path); break; default: $returner = new SearchHelperParser($type, $path); } return $returner; } }
Simpan