Uname: Linux webm012.cluster130.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 8.0.30 [ PHP INFO ] PHP os: Linux
Server Ip: 145.239.37.162
Your Ip: 216.73.216.190
User: dreampi (1009562) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : filegenerator.php
<?php
/**
 * Class to generate fiels and output them in attachment by http (https) protocol
 */
#[AllowDynamicProperties]
class filegeneratorGmp {
    static protected $_instances = array();
    protected $_filename = '';
    protected $_data = '';
    protected $_type = '';
    public function __construct($filename, $data, $type) {
        $this->_filename = $filename;
        $this->_data = $data;
        $this->_type = strtolower($type);
    }
    static public function getInstance($filename, $data, $type) {
        $name = md5($filename. $data. $type);
        if(!isset(self::$_instances[$name])) {
            self::$_instances[$name] = new filegeneratorGmp($filename, $data, $type);
        }
        return self::$_instances[$name];
    }
    static public function _($filename, $data, $type) {
        return self::getInstance($filename, $data, $type);
    }
    public function generate() {
        switch($this->_type) {
            case 'txt':
                $this->_getTxtHeader();
                break;
            case 'csv':
                $this->_getCsvHeader();
                break;
            default:
                $this->_getDefaultHeader();
                break;
        }
        echo $this->_data;
        exit();
    }
    protected function _getTxtHeader() {
        header('Content-Disposition: attachment; filename="'. $this->_filename. '.txt"');
        header('Content-type: text/plain');
    }
    protected function _getCsvHeader() {
        header('Content-Disposition: attachment; filename="'. $this->_filename. '.csv"');
        header('Content-type: application/csv');
    }
    protected function _getDefaultHeader() {
        header('Content-Disposition: attachment; filename="'. $this->_filename. '"');
        header('Content-type: '. $this->_type);
    }
}
© 2026 GrazzMean-Shell