|
Server IP : 10.128.40.6 / Your IP : 216.73.216.233 Web Server : Apache System : Linux webd006.cluster128.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : logmcpe ( 111175) PHP Version : 7.3.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0705) : /home/logmcpe/www/MCPRO/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
// require('fpdf.php');
//Stream handler to read from global variables
class VariableStream
{
var $varname;
var $position;
function stream_open($path, $mode, $options, &$opened_path)
{
$url = parse_url($path);
$this->varname = $url['host'];
if(!isset($GLOBALS[$this->varname]))
{
trigger_error('Global variable '.$this->varname.' does not exist', E_USER_WARNING);
return false;
}
$this->position = 0;
return true;
}
function stream_read($count)
{
$ret = substr($GLOBALS[$this->varname], $this->position, $count);
$this->position += strlen($ret);
return $ret;
}
function stream_eof()
{
return $this->position >= strlen($GLOBALS[$this->varname]);
}
function stream_tell()
{
return $this->position;
}
function stream_seek($offset, $whence)
{
if($whence==SEEK_SET)
{
$this->position = $offset;
return true;
}
return false;
}
function stream_stat()
{
return array();
}
}
class PDF_MemImage extends FPDF
{
function PDF_MemImage($orientation='P', $unit='mm', $format='A4')
{
$this->FPDF($orientation, $unit, $format);
//Register var stream protocol
stream_wrapper_register('var', 'VariableStream');
}
function MemImage($data, $x=null, $y=null, $w=0, $h=0, $link='')
{
//Display the image contained in $data
$v = 'img'.md5($data);
$GLOBALS[$v] = $data;
$a = getimagesize('var://'.$v);
if(!$a)
$this->Error('Invalid image data');
$type = substr(strstr($a['mime'],'/'),1);
$this->Image('var://'.$v, $x, $y, $w, $h, $type, $link);
unset($GLOBALS[$v]);
}
function GDImage($im, $x=null, $y=null, $w=0, $h=0, $link='')
{
//Display the GD image associated to $im
ob_start();
imagepng($im);
$data = ob_get_clean();
$this->MemImage($data, $x, $y, $w, $h, $link);
}
}
?>
