From 32bdf42913518b3421986cb4d49d62ed1b04354e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 22 Aug 2020 19:50:15 +0200 Subject: composer update htmlpurifier --- vendor/ezyang/htmlpurifier/extras/FSTools/File.php | 141 --------------------- 1 file changed, 141 deletions(-) delete mode 100644 vendor/ezyang/htmlpurifier/extras/FSTools/File.php (limited to 'vendor/ezyang/htmlpurifier/extras/FSTools/File.php') diff --git a/vendor/ezyang/htmlpurifier/extras/FSTools/File.php b/vendor/ezyang/htmlpurifier/extras/FSTools/File.php deleted file mode 100644 index 6453a7a45..000000000 --- a/vendor/ezyang/htmlpurifier/extras/FSTools/File.php +++ /dev/null @@ -1,141 +0,0 @@ -name = $name; - $this->fs = $fs ? $fs : FSTools::singleton(); - } - - /** Returns the filename of the file. */ - public function getName() {return $this->name;} - - /** Returns directory of the file without trailing slash */ - public function getDirectory() {return $this->fs->dirname($this->name);} - - /** - * Retrieves the contents of a file - * @todo Throw an exception if file doesn't exist - */ - public function get() - { - return $this->fs->file_get_contents($this->name); - } - - /** Writes contents to a file, creates new file if necessary */ - public function write($contents) - { - return $this->fs->file_put_contents($this->name, $contents); - } - - /** Deletes the file */ - public function delete() - { - return $this->fs->unlink($this->name); - } - - /** Returns true if file exists and is a file. */ - public function exists() - { - return $this->fs->is_file($this->name); - } - - /** Returns last file modification time */ - public function getMTime() - { - return $this->fs->filemtime($this->name); - } - - /** - * Chmod a file - * @note We ignore errors because of some weird owner trickery due - * to SVN duality - */ - public function chmod($octal_code) - { - return @$this->fs->chmod($this->name, $octal_code); - } - - /** Opens file's handle */ - public function open($mode) - { - if ($this->handle) $this->close(); - $this->handle = $this->fs->fopen($this->name, $mode); - return true; - } - - /** Closes file's handle */ - public function close() - { - if (!$this->handle) return false; - $status = $this->fs->fclose($this->handle); - $this->handle = false; - return $status; - } - - /** Retrieves a line from an open file, with optional max length $length */ - public function getLine($length = null) - { - if (!$this->handle) $this->open('r'); - if ($length === null) return $this->fs->fgets($this->handle); - else return $this->fs->fgets($this->handle, $length); - } - - /** Retrieves a character from an open file */ - public function getChar() - { - if (!$this->handle) $this->open('r'); - return $this->fs->fgetc($this->handle); - } - - /** Retrieves an $length bytes of data from an open data */ - public function read($length) - { - if (!$this->handle) $this->open('r'); - return $this->fs->fread($this->handle, $length); - } - - /** Writes to an open file */ - public function put($string) - { - if (!$this->handle) $this->open('a'); - return $this->fs->fwrite($this->handle, $string); - } - - /** Returns TRUE if the end of the file has been reached */ - public function eof() - { - if (!$this->handle) return true; - return $this->fs->feof($this->handle); - } - - public function __destruct() - { - if ($this->handle) $this->close(); - } - -} - -// vim: et sw=4 sts=4 -- cgit v1.2.3