Sends the contents of $filePath to default output

@param string $filePath File path
@param int $startOffset Starting offset
@param bool|int $length Length to transmit, false means everything

@return bool true, or false if operation failed
507868
public function passthrough( $filePath, $startOffset = 0, $length = false )
    {
        return $this->getHandler( $filePath )->passthrough( $filePath, $startOffset, $length );
    }
600906
@Override
	public boolean delFile(String filePath) {
		try {
			channel.rm(filePath);
		} catch (SftpException e) {
			throw new JschRuntimeException(e);
		}
		return true;
	}
557210
protected function writeFile($filePath, $content)
    {
        $this->validateOutputDirectoryPermissions();

        $currentDirectory = dirname($filePath);
        if (!is_writable($currentDirectory)) {
            throw new \OxidEsales\UnifiedNameSpaceGenerator\Exceptions\PermissionException(
                'Could not create file ' . $filePath . ' ' .
                'The directory ' . $currentDirectory . ' is not writable for user "' . get_current_user() . '". ' .
                'Please fix the permissions on this directory and run this script again.',
                static::ERROR_CODE_FILE_CREATION_ERROR
            );
        }

        $fileHandle = fopen($filePath, 'wb');
        if (!$fileHandle) {
            throw new \OxidEsales\UnifiedNameSpaceGenerator\Exceptions\FileSystemCompatibilityException(
                'Could not open file file handle for ' . $filePath . ' ' .
                'There might be a problem with your file system. Try to solve this problem and run this script again.',
                static::ERROR_CODE_FILE_CREATION_ERROR
            );
        }

        $result = fwrite($fileHandle, $content);
        if (false === $result) {
            fclose($fileHandle);
            throw new \Exception(
                'Could not create file ' . $filePath,
                static::ERROR_CODE_FILE_CREATION_ERROR
            );
        }
        if (0 === $result) {
            fclose($fileHandle);
            throw new \Exception(
                'Created empty file ' . $filePath,
                static::ERROR_CODE_FILE_CREATION_ERROR
            );
        }
        fclose($fileHandle);
    }
995398
public function writeCompressedFile($compressedFilepath, $filepath)
	{
		$filePointer = fopen($compressedFilepath, 'w');
		fwrite($filePointer, gzencode(file_get_contents($filepath), 9));
		fclose($filePointer);
	}
81192
private function _processFile(
        $filePath)
    {
        $hasProblems = false;
        $hasVisibilityProblems = false;
        $fileName = basename($filePath);
        $inputLines = @file($filePath);
        $outputLines = [];

        if ($inputLines === false) {
            // We were unable to read the input file. Ignore if broken symlink.
            if (is_link($filePath)) {
                return false; // File is okay, since the symlink is invalid.
            } else {
                echo "- {$filePath}: UNABLE TO READ FILE!".PHP_EOL;

                return true; // File has problems...
            }
        }

        foreach ($inputLines as $line) {
            // Function arguments on separate lines.
            if (preg_match('/^(.*?(?:(?:final|static)\s+)*(?:public|private|protected)(?:\s+(?:final|static))*\s+function\s+.+?)\((.+)\)(.*)$/', $line, $matches)) {
                $hasProblems = true;

                $funcstart = $matches[1];
                $params = $matches[2];
                $trail = $matches[3];
                $params = explode(', ', $params);

                $outputLines[] = $funcstart.'('.PHP_EOL;
                for ($i = 0, $len = count($params); $i < $len; ++$i) {
                    $newline = '        '.$params[$i];
                    if ($i == ($len - 1)) {
                        $newline .= ')'.PHP_EOL;
                    } else {
                        $newline .= ','.PHP_EOL;
                    }
                    $outputLines[] = $newline;
                }
                // } else {
                //     $outputLines[] = $line;
            }

            // Appropriate public, private and protected member prefixes.
            if (preg_match('/^\s*(?:(?:final|static)\s+)*(public|private|protected)(?:\s+(?:final|static))*\s+(function|\$)\s*&?([^;\(\s]+)/', $line, $matches)) {
                $visibility = &$matches[1]; // public, private, protected
                $type = &$matches[2]; // $, function
                $name = &$matches[3]; // Member name

                if ($visibility == 'public') {
                    if ($name[0] == '_' && (
                        $name != '__construct'
                        && $name != '__destruct'
                        && $name != '__call'
                        && $name != '__get'
                        && $name != '__set'
                        && $name != '__isset'
                        && $name != '__unset'
                        && $name != '__invoke'
                        && $name != '__toString'
                    )) {
                        $hasProblems = true;
                        $hasVisibilityProblems = true;
                        echo "- {$filePath}: BAD PUBLIC NAME:".trim($matches[0]).PHP_EOL;
                    }
                } else { // private, protected
                    if ($name[0] != '_') {
                        $hasProblems = true;
                        $hasVisibilityProblems = true;
                        echo "- {$filePath}: BAD PRIVATE/PROTECTED NAME:".trim($matches[0]).PHP_EOL;
                    }
                }
            }
        }

        $newFile = implode('', $outputLines);
        if (!$hasProblems) {
            if (!$this->_onlyShowInvalidFiles) {
                echo "  {$filePath}: Already formatted correctly.\n";
            }
        } elseif (!$hasVisibilityProblems) {
            // Has problems, but no visibility problems. Output fixed file.
            echo "- {$filePath}: Has function parameter problems:\n";
            echo $newFile;
        } else {
            echo "- {$filePath}: Had member visibility problems.\n";
        }

        return $hasProblems;
    }
544674
private function shouldExecuteFile($execOption, $noExecOption, $filePath)
    {
        if ($execOption) {
            return true;
        }

        if ($noExecOption) {
            return false;
        }

        // By default, code that is edited is executed if there was no given input file path
        return $filePath === null;
    }
117895
private function outputImage(string $imagePath = ''): void
    {
        $fPointer = \fopen($imagePath, 'rb');
        $this->sendCachingHeaders($imagePath);
        \header('Content-Type: '.$this->getImageContentType());
        \header('Content-Length: '.\filesize($imagePath));
        \fpassthru($fPointer);
        \fclose($fPointer);
        die();
    }
27412
public static function openFile(/*string*/ $filePath, /*string*/ $mode) {
    return self::isFile($filePath) ? fopen($filePath, $mode, false) : false;
  }
1191952
public function sendfile($filepath, $offset, $length) {
		$this->sw_response->sendfile($filepath, $offset, $length);
		$this->is_end = true;
		$this->sw_response = null;
		$this->tpl_engine_obj = null;
	}
349826
public function sendFile(string $filename, int $offset = 0, int $length = 0)
    {
        $this->sendHeaders();
        $this->swooleResponse->sendfile($filename, $offset, $length);
        $this->isEnded = true;
        return $this;
    }
609023
public function _passThrough( $filePath, $startOffset = 0, $length = false, $fname = false )
    {
        if ( $fname )
            $fname .= "::_passThrough($filePath)";
        else
            $fname = "_passThrough($filePath)";

        $metaData = $this->_fetchMetadata( $filePath, $fname );
        // @todo Throw an exception
        if ( !$metaData )
            return false;

        // @todo Catch an exception
        $this->dfsbackend->passthrough( $filePath, $startOffset, $length );

        return true;
    }
419601
public function writeFile($filePath, array $translations)
    {
        $content = "<?php \n\nreturn [";

        $content .= $this->stringLineMaker($translations);

        $content .= "\n];";

        file_put_contents($filePath, $content);
    }
1086256
public function writeUncompressedFile($uncompressedFilepath, $filepath)
	{
		$filePointer = fopen($uncompressedFilepath, 'w');
		fwrite($filePointer, gzdecode(file_get_contents($filepath, 9)));
		fclose($filePointer);
	}
487380
public function saveToFile($filePath,$format = 'csvforexcel')
    {
        $this->format(Format::get($format));
        $this->run();

        $this->data->saveToFile($filePath);

        return true;
    }
82703
public static function section($path, $start = 0, $end = 0, $undent = false)
	{
		$format = self::getExtension($path);
		$text   = file_get_contents($path);
		if ($start !== 0 || $end !== 0)
		{
			$text = self::lines($text, $start, $end);
			if ($undent)
			{
				$text = self::undent($text);
			}
		}
		return self::output($text, $format);
	}
486504
private function saveRemoteFile($fileUrl, $filePath)
    {
        if (! $file = @file_get_contents($fileUrl)) {
            self::$errors[] = [
                'message' => 'Error to download file: ' . $fileUrl
            ];

            return false;
        }

        if (! @file_put_contents($filePath, $file)) {
            self::$errors[] = [
                'message' => 'Failed to save file to: ' . $filePath
            ];

            return false;
        }

        return true;
    }
394257
public void setFilePath(String filePath)
    {
        //create a new file
        File fileInstance=null;
        if(filePath!=null)
        {
            fileInstance=new File(filePath);
        }
        
        //set file
        this.setFile(fileInstance);
    }