Skip to content
Snippets Groups Projects
Commit 108e5129 authored by Sebastian Pisula's avatar Sebastian Pisula
Browse files

feature(core): Added classmap autoload

parent d8f13148
No related branches found
No related tags found
1 merge request!32feature(core): Added classmap autoload
Pipeline #11011 failed
## [3.3.0] - 2022-04-21
### Added
- classmap autoload
## [3.2.7] - 2021-03-01
### Fixed
- Update message and translation
......
......@@ -19,10 +19,10 @@
"wimg/php-compatibility": "^8"
},
"autoload": {
"classmap": ["src"]
},
"autoload-dev": {
"classmap": ["src", "tests"]
"classmap": ["tests"]
},
"extra": {
"text-domain": "wp-basic-requirements",
......
<?php
if ( ! interface_exists( 'WPDesk_Requirement_Checker' ) ) {
require_once 'Requirement_Checker.php';
}
if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) {
/**
* Checks requirements for plugin
* have to be compatible with PHP 5.3.x
*/
class WPDesk_Basic_Requirement_Checker implements WPDesk_Requirement_Checker {
const EXTENSION_NAME_OPENSSL = 'openssl';
const HOOK_ADMIN_NOTICES_ACTION = 'admin_notices';
......@@ -630,4 +621,3 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) {
}
}
}
}
\ No newline at end of file
<?php
if ( ! class_exists( 'Basic_Requirement_Checker' ) ) {
require_once 'Basic_Requirement_Checker.php';
}
if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker_With_Update_Disable' ) ) {
require_once 'Basic_Requirement_Checker_With_Update_Disable.php';
}
/**
* Falicitates createion of requirement checker
*/
......
<?php
if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) {
require_once 'Basic_Requirement_Checker.php';
}
if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker_With_Update_Disable' ) ) {
/**
* Checks requirements for plugin. When required plugin is updated right now, then say that requirements are not met temporary.
* have to be compatible with PHP 5.2.x
*/
class WPDesk_Basic_Requirement_Checker_With_Update_Disable extends WPDesk_Basic_Requirement_Checker {
/**
......@@ -44,4 +35,3 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker_With_Update_Disable' ) )
return isset( $_GET['action'] ) && $_GET['action'] === 'upgrade-plugin' && $_GET['plugin'] === $name;
}
}
}
\ No newline at end of file
<?php
/**
* Checks requirements for plugin
* have to be compatible with PHP 5.2.x
*/
interface WPDesk_Requirement_Checker
{
interface WPDesk_Requirement_Checker {
/**
* @param string $version
*
......
<?php
interface WPDesk_Requirement_Checker_Factory
{
interface WPDesk_Requirement_Checker_Factory {
/**
* @param $plugin_file
* @param $plugin_name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment