Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /proc/self/cwd/wp-content/plugins/elementor-pro/core/integrations/exceptions/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/cwd/wp-content/plugins/elementor-pro/core/integrations/exceptions/exception-base.php
<?php

namespace ElementorPro\Core\Integrations\Exceptions;

use ElementorPro\Plugin;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

abstract class Exception_Base extends \Exception {

	/**
	 * @var string
	 */
	protected $action;

	/**
	 * @var array
	 */
	protected $meta = [];

	/**
	 * Get a formatted message specific to the current exception type.
	 *
	 * @param string $message
	 *
	 * @return string
	 */
	abstract protected function format_message( $message );

	/**
	 * Exception_Base constructor.
	 *
	 * @param string $action - Action name that failed (ideally the class name, e.g. Email::class).
	 * @param string $message - Message to show.
	 * @param array  $meta   - Exception meta data. Used for logging.
	 *
	 */
	public function __construct( $action, $message = '', $meta = [] ) {
		$this->action = $action;
		$this->meta = $meta;

		$message = $this->format_message( $message );

		parent::__construct( $message );
	}

	/**
	 * Log the exception to Elementor's log.
	 *
	 * @return void
	 */
	public function log() {
		Plugin::elementor()->logger->get_logger()->error( $this->getMessage(), [ 'meta' => $this->meta ] );
	}

	/**
	 * Get the error format.
	 *
	 * @return string
	 */
	public function __toString() {
		return sprintf(
			'%s: %s',
			__CLASS__,
			$this->getMessage()
		);
	}
}

Spamworldpro Mini