403Webshell
Server IP : 104.21.14.103  /  Your IP : 3.144.86.105
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/giankuin/sieuthiweb.com.vn/dup-installer/lib/snaplib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/giankuin/sieuthiweb.com.vn/dup-installer/lib/snaplib/class.snaplib.logger.php
<?php
/**
 * Snap Logger utils
 *
 * Standard: PSR-2
 * @link http://www.php-fig.org/psr/psr-2
 *
 * @package SnapLib
 * @copyright (c) 2017, Snapcreek LLC
 * @license	https://opensource.org/licenses/GPL-3.0 GNU Public License
 *
 */
defined('ABSPATH') || defined('DUPXABSPATH') || exit;

if (!class_exists('DupProSnapLibLogger', false)) {

    class DupProSnapLibLogger
    {

        public static $logFilepath = null;
        static $logHandle          = null;

        public static function init($logFilepath)
        {
            self::$logFilepath = $logFilepath;
        }

        public static function clearLog()
        {
            if (file_exists(self::$logFilepath)) {
                if (self::$logHandle !== null) {
                    fflush(self::$logHandle);
                    fclose(self::$logHandle);
                    self::$logHandle = null;
                }
                @unlink(self::$logFilepath);
            }
        }

        public static function logObject($s, $o, $flush = false)
        {
            self::log($s, $flush);
            self::log(print_r($o, true), $flush);
        }

        public static function log($s, $flush = false, $callingFunctionOverride = null)
        {
            //   echo "{$s}<br/>";
            $lfp = self::$logFilepath;
            //  echo "logging $s to {$lfp}<br/>";
            if (self::$logFilepath === null) {
                throw new Exception('Logging not initialized');
            }

            if (isset($_SERVER['REQUEST_TIME_FLOAT'])) {
                $timepart = $_SERVER['REQUEST_TIME_FLOAT'];
            } else {
                $timepart = $_SERVER['REQUEST_TIME'];
            }

            $thread_id = sprintf("%08x", abs(crc32($_SERVER['REMOTE_ADDR'].$timepart.$_SERVER['REMOTE_PORT'])));

            $s = $thread_id.' '.date('h:i:s').":$s";

            if (self::$logHandle === null) {

                self::$logHandle = fopen(self::$logFilepath, 'a');
            }

            fwrite(self::$logHandle, "$s\n");

            if ($flush) {
                fflush(self::$logHandle);

                fclose(self::$logHandle);

                self::$logHandle = fopen(self::$logFilepath, 'a');
            }
        }
        private static $profileLogArray = null;
        private static $prevTS          = -1;

        public static function initProfiling()
        {
            self::$profileLogArray = array();
        }

        public static function writeToPLog($s)
        {
            throw new exception('not implemented');
            $currentTime = microtime(true);

            if (array_key_exists($s, self::$profileLogArray)) {
                $dSame = $currentTime - self::$profileLogArray[$s];
                $dSame = number_format($dSame, 7);
            } else {
                $dSame = 'N/A';
            }

            if (self::$prevTS != -1) {
                $dPrev = $currentTime - self::$prevTS;
                $dPrev = number_format($dPrev, 7);
            } else {
                $dPrev = 'N/A';
            }

            self::$profileLogArray[$s] = $currentTime;
            self::$prevTS              = $currentTime;

            self::log("  {$dPrev}  :  {$dSame}  :  {$currentTime}  :     {$s}");
        }
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit