HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/qas.sports-crowd.com/vendor/openpay/sdk/Openpay/Data/OpenpayApiConsole.php
<?php

namespace Openpay\Data;

class OpenpayApiConsole {

    const CONSOLE_NONE = 0;
    const CONSOLE_TRACE = 2;
    const CONSOLE_DEBUG = 4;
    const CONSOLE_INFO = 8;
    const CONSOLE_WARNING = 16;
    const CONSOLE_ERROR = 32;
    const CONSOLE_CRITICAL = 64;
    const CONSOLE_ALL = 126;

    private static $instance;
    private $level;
    private $toScreen;

    private function __construct() {
        $this->level = self::CONSOLE_NONE;
        $this->toScreen = false;
    }

    private function record($prefix, $text) {
        $output = $prefix . ': ' . print_r($text, true);
        if ($this->toScreen == true) {
            print_r('<pre>' . $output . '</pre>' . "\n");
        } else {
            syslog(LOG_INFO, $output);
        }
    }

    private function checkFlag($flag, $value) {
        return (($flag & $value) == $flag);
    }

    private static function getInstance() {
        if (self::$instance == null) {
            self::$instance = new self();
        }
        return self::$instance;
    }

    private static function _log($type, $flag, $text) {
        $logger = self::getInstance();
        if ($logger->checkFlag($flag, $logger->level))
            $logger->record('[' . strtoupper($type) . ']', $text);
    }

    // -----------------------------------------------
    public static function setLevel($level) {
        $instance = self::getInstance();
        $instance->level = $level;
    }

    public static function printToScreen($flag) {
        $instance = self::getInstance();
        $instance->toScreen = ($flag ? true : false);
    }

    public static function trace($text) {
        self::_log('trace', self::CONSOLE_TRACE, $text);
    }

    public static function debug($text) {
        self::_log('debug', self::CONSOLE_DEBUG, $text);
    }

    public static function info($text) {
        self::_log('info', self::CONSOLE_INFO, $text);
    }

    public static function warn($text) {
        self::_log('warning', self::CONSOLE_WARNING, $text);
    }

    public static function error($text) {
        self::_log('error', self::CONSOLE_ERROR, $text);
    }

    public static function critical($text) {
        self::_log('critical', self::CONSOLE_CRITICAL, $text);
    }

}

?>