| Server IP : 89.39.208.18 / Your IP : 216.73.217.74 Web Server : LiteSpeed System : User : ( ) PHP Version : 7.4.33 Disable Function : eval,./,ln,passthru,dl,system,exec,popen,shell_exec,posix_getpwuid,posix_uname,ftp_exec,posix_uname,posix_getpwuid,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,get_current_user,getmyuid,getmygid,listen,chgrp,apache_note,apache_setenv,apache_child_terminate,closelog,debugger_off,debugge_on,ini_restore,netscript,escapeshellarg,cmd,backtick,virtual,show_sourc,show_source,pclose,pcntl_exec,datasec,old_offset,ctrl_dir,ini_alter,leak,listen,chgrp,apache_setenv,define_syslog_variables,root,diskfreespace,disk_free_space,disk_total_space,posix_kill,getmyuid,getmygid,apache_child_terminate,php_ini_scanned_files,ls,ps_aux,chown,getrusage,posixc,posame,chgrp,posix_setuid,posix_setsid,posix_setgid,apache_note,apache_setenv,x_getuid,e_ini_file,nfo,SQL,mysql_li,t_dbs,filegroup,highlight_file,ilegetcontents,get_dir,popen,popens,pfsockopen,dos_conv,apache_get_modules,crack_check,crack_closedict,rar_open,bzopen,bzread,bzwrite,shellcode,posix_isatty,posix_getservbyname,escapeshellarg,hypot,pg_host,pos,posix_access,inurl,posix_times,posix_mknod,pclose,ps_fill,symlink,id,escapeshellcmd,php_uname,phpinfo MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home3/././././mahyarcake/./www/wp-content/plugins/woocommerce/src/Blocks/Domain/ |
Upload File : |
<?php
namespace Automattic\WooCommerce\Blocks\Domain;
use Automattic\WooCommerce\Blocks\Options;
use Automattic\WooCommerce\Blocks\Domain\Services\FeatureGating;
/**
* Main package class.
*
* Returns information about the package and handles init.
*
* @since 2.5.0
*/
class Package {
/**
* Holds the current version of the blocks plugin.
*
* @var string
*/
private $version;
/**
* Holds the main path to the blocks plugin directory.
*
* @var string
*/
private $path;
/**
* Holds locally the plugin_dir_url to avoid recomputing it.
*
* @var string
*/
private $plugin_dir_url;
/**
* Holds the feature gating class instance.
*
* @var FeatureGating
*/
private $feature_gating;
/**
* Constructor
*
* @param string $version Version of the plugin.
* @param string $plugin_path Path to the main plugin file.
* @param FeatureGating $feature_gating Feature gating class instance.
*/
public function __construct( $version, $plugin_path, FeatureGating $feature_gating ) {
$this->version = $version;
$this->path = $plugin_path;
$this->feature_gating = $feature_gating;
}
/**
* Returns the version of WooCommerce Blocks.
*
* Note: since Blocks was merged into WooCommerce Core, the version of
* WC Blocks doesn't update anymore. Use
* `Constants::get_constant( 'WC_VERSION' )` when possible to get the
* WooCommerce Core version.
*
* @return string
*/
public function get_version() {
return $this->version;
}
/**
* Returns the version of WooCommerce Blocks stored in the database.
*
* @return string
*/
public function get_version_stored_on_db() {
return get_option( Options::WC_BLOCK_VERSION, '' );
}
/**
* Sets the version of WooCommerce Blocks in the database.
* This is useful during the first installation or after the upgrade process.
*/
public function set_version_stored_on_db() {
update_option( Options::WC_BLOCK_VERSION, $this->get_version() );
}
/**
* Returns the path to the plugin directory.
*
* @param string $relative_path If provided, the relative path will be
* appended to the plugin path.
*
* @return string
*/
public function get_path( $relative_path = '' ) {
return trailingslashit( $this->path ) . $relative_path;
}
/**
* Returns the url to the blocks plugin directory.
*
* @param string $relative_url If provided, the relative url will be
* appended to the plugin url.
*
* @return string
*/
public function get_url( $relative_url = '' ) {
if ( ! $this->plugin_dir_url ) {
// Append index.php so WP does not return the parent directory.
$this->plugin_dir_url = plugin_dir_url( $this->path . '/index.php' );
}
return $this->plugin_dir_url . $relative_url;
}
/**
* Returns an instance of the the FeatureGating class.
*
* @return FeatureGating
*/
public function feature() {
return $this->feature_gating;
}
/**
* Checks if we're executing the code in an experimental build mode.
*
* @return boolean
*/
public function is_experimental_build() {
return $this->feature()->is_experimental_build();
}
/**
* Checks if we're executing the code in an feature plugin or experimental build mode.
*
* @return boolean
*/
public function is_feature_plugin_build() {
return $this->feature()->is_feature_plugin_build();
}
}