PATH:
home
/
letacommog
/
lenazen
/
wp-content
/
plugins
/
fusion-builder
/
inc
/
lib
/
inc
<?php /** * The main Patcher class. * * @package Fusion-Library * @subpackage Fusion-Patcher */ // Do not allow directly accessing this file. if ( ! defined( 'ABSPATH' ) ) { exit( 'Direct script access denied.' ); } /** * The main Patcher class for Fusion Library. * * @since 1.0.0 */ class Fusion_Patcher { /** * The arguments used in the constructor. * * @access private * @since 1.0.0 * @var array */ private $args = array(); /** * An array of all bundled products. * This is used because bundled products should show their patches * as part of the parent item's patcher. * * @static * @access private * @since 1.0.0 * @var array */ private static $bundled = array(); /** * All the instances of this object (array of objects). * * @static * @access private * @since 1.0.0 * @var mixed */ private static $instances = array(); /** * An instance of the Fusion_Patcher_Apply_Patch class. * * @access private * @since 1.0.0 * @var object Fusion_Patcher_Apply_Patch */ private $apply_patch; /** * An instance of the Fusion_Patcher_Admin_Screen class. * * @access private * @since 1.0.0 * @var object Fusion_Patcher_Admin_Screen */ private $admin_screen; /** * An instance of the Fusion_Patcher_Checker class. * * @access private * @since 1.0.0 * @var object Fusion_Patcher_Checker */ private $patcher_checker; /** * The class constructor. * * @access public * @since 1.0.0 * @param array $args The arguments we want to pass-on to the patcher. */ public function __construct( $args = array() ) { $this->args = $args; if ( ! isset( self::$instances[ $args['context'] ] ) ) { self::$instances[ $args['context'] ] = $this; } // Only instantiate the sub-classes if we're on the admin page. $slug = $args['context'] . '-fusion-patcher'; $referer = fusion_get_referer(); $referer = $referer ? $referer : ''; $is_patcher_page = (bool) ( is_admin() && ( ( isset( $_GET['page'] ) && $slug === $_GET['page'] ) || ( false !== strpos( $referer, $slug ) ) ) ); // Add bundled products. $this->add_bundled( $args ); if ( $is_patcher_page ) { // Enqueue styles & scripts. add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) ); } $this->args['is_patcher_page'] = $is_patcher_page; // Patches handler. $this->apply_patch = new Fusion_Patcher_Apply_Patch( $this ); // Admin-page handler. $this->admin_screen = new Fusion_Patcher_Admin_Screen( $this ); // Checks for patches periodically. $this->patcher_checker = new Fusion_Patcher_Checker( $this ); } /** * Get all instances of this object, or a specific instance. * * @access public * @since 1.0.0 * @param string|false $context If set to false, get all instances. * @return mixed */ public function get_instance( $context = false ) { if ( false === $context ) { return (array) self::$instances; } if ( ! isset( self::$instances[ $context ] ) ) { return null; } return self::$instances[ $context ]; } /** * Get the args. * * @access public * @since 1.0.0 * @param false|string $arg Get a specific argument, or get all. * @return array|string */ public function get_args( $arg = false ) { if ( false !== $arg ) { if ( isset( $this->args[ $arg ] ) ) { return $this->args[ $arg ]; } return null; } return (array) $this->args; } /** * Adds any bundled products to self::$bundled. * * @access private * @since 1.0.0 * @param array $args Inherited from the constructor. * @return void */ private function add_bundled( $args ) { if ( ! isset( $args['bundled'] ) ) { return; } // Make sure we're dealing with an array. $bundled = (array) $args['bundled']; foreach ( $bundled as $bundle ) { self::$bundled[] = $bundle; } } /** * Get an array of our bundled products. * * @access public * @since 1.0.0 * @return array */ public function get_bundled() { return array_unique( self::$bundled ); } /** * Enqueue any scripts & stylesheets needed. * * @access public * @since 1.0.0 */ public function admin_scripts() { wp_enqueue_style( 'fusion-patcher', FUSION_LIBRARY_URL . '/assets/css/fusion-patcher-style.css', false, time() ); } /** * Check if the product is bundled or not. * * @access public * @since 1.0.0 * @param false|string $product If false check the current product. * @return bool */ public function is_bundled( $product = false ) { if ( ! $product ) { $product = $this->args['context']; } return (bool) ( in_array( $product, self::$bundled, true ) ); } /** * Get the $apply_patch private property. * * @access public * @since 1.0.0 * @return object */ public function get_apply_patch() { return $this->apply_patch; } /** * Get the $admin_screen private property. * * @access public * @since 1.0.0 * @return object */ public function get_admin_screen() { return $this->admin_screen; } /** * Get the $patcher_checker private property. * * @access public * @since 1.0.0 * @return object */ public function get_patcher_checker() { return $this->patcher_checker; } }
[+]
..
[-] fusion-icon.php
[edit]
[-] class-fusion-fusionredux.php
[edit]
[-] class-fusion-featured-image.php
[edit]
[-] class-fusion-dynamic-js-file.php
[edit]
[-] class-fusion-settings.php
[edit]
[-] class-fusion-updater.php
[edit]
[-] class-fusion-images.php
[edit]
[-] class-fusion-dynamic-css.php
[edit]
[-] class-fusion-sanitize.php
[edit]
[-] class-fusion-scripts.php
[edit]
[-] wc-functions.php
[edit]
[-] class-fusion-dynamic-css-helpers.php
[edit]
[-] class-fusion-dynamic-css-inline.php
[edit]
[-] class-fusion-patcher-apply-patch.php
[edit]
[+]
importer
[-] class-fusion-helper.php
[edit]
[-] class-fusion-color.php
[edit]
[+]
redux
[-] class-fusion-library-autoloader.php
[edit]
[-] class-fusion-envato-api.php
[edit]
[-] class-fusion-patcher-admin-notices.php
[edit]
[-] class-fusion-data.php
[edit]
[-] class-fusion-dynamic-js.php
[edit]
[-] class-fusion-patcher.php
[edit]
[-] class-fusion-patcher-admin-screen.php
[edit]
[-] class-fusion-dynamic-js-compiler.php
[edit]
[-] class-fusion-patcher-filesystem.php
[edit]
[-] class-fusion-patcher-client.php
[edit]
[-] class-fusion-filesystem.php
[edit]
[-] functions.php
[edit]
[-] class-fusion-admin-notice.php
[edit]
[-] class-fusion-privacy.php
[edit]
[-] class-fusion-dynamic-css-file.php
[edit]
[-] class-fusion-dynamic-js-separate.php
[edit]
[-] class-fusion-patcher-cache.php
[edit]
[-] class-fusion.php
[edit]
[-] class-fusion-multilingual.php
[edit]
[-] class-fusion-cache.php
[edit]
[+]
templates
[-] class-fusion-product-registration.php
[edit]
[-] class-fusion-options.php
[edit]
[-] class-fusion-patcher-checker.php
[edit]