Select Git revision
Basic_Requirement_Checker.php
Basic_Requirement_Checker.php 8.58 KiB
<?php
/**
* Checks requirements for plugin
* have to be compatible with PHP 5.2.x
*/
class WPDesk_Basic_Requirement_Checker {
/** @var string */
private $plugin_name = '';
/** @var string */
private $plugin_file = '';
/** @var string */
private $min_php_version;
/** @var string */
private $min_wp_version;
/** @var array */
private $plugin_require;
/** @var array */
private $module_require;
/** @var array */
private $setting_require;
/** @var array */
private $notices;
/**
* @param string $plugin_file
* @param string $plugin_name
* @param string $php_version
* @param string $wp_version
*/
public function __construct( $plugin_file, $plugin_name, $php_version, $wp_version ) {
$this->plugin_file = $plugin_file;
$this->plugin_name = $plugin_name;
$this->set_min_php_require( $php_version );
$this->set_min_wp_require( $wp_version );
$this->plugin_require = array();
$this->module_require = array();
$this->setting_require = array();
$this->notices = array();
}
/**
* @param string $version
*
* @return $this
*/
public function set_min_php_require( $version ) {
$this->min_php_version = $version;
return $this;
}
/**
* @param string $version
*
* @return $this
*/
public function set_min_wp_require( $version ) {
$this->min_wp_version = $version;
return $this;
}