Astra_Minify::get_cache_dir()

Returns an array with the path and URL for the cache directory.


Description


Return

(array)


Source

File: classes/class-astra-minify.php

		public static function get_cache_dir() {

			if ( null != self::$_dir_info ) {
				return self::$_dir_info;
			}

			$dir_name = 'astra-addon';
			$wp_info  = wp_upload_dir();

			// SSL workaround.
			if ( self::astra_is_ssl() ) {
				$wp_info['baseurl'] = str_ireplace( 'http://', 'https://', $wp_info['baseurl'] );
			}

			// Build the paths.
			$dir_info = array(
				'path' => $wp_info['basedir'] . '/' . $dir_name . '/',
				'url'  => $wp_info['baseurl'] . '/' . $dir_name . '/',
			);

			// Create the cache dir if it doesn't exist.
			if ( ! file_exists( $dir_info['path'] ) ) {
				wp_mkdir_p( $dir_info['path'] );
			}

			self::$_dir_info = $dir_info;

			return self::$_dir_info;
		}

Changelog

Changelog
Version Description
1.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.