PHP code example of italystrap / platform-requirements-check

1. Go to this page and download the library: Download italystrap/platform-requirements-check library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

italystrap / platform-requirements-check example snippets




declare(strict_types=1);



use ItalyStrap\PlatformRequirementsCheck\RequirementInterface;

class MyRequirement implements RequirementInterface
{
    // implement the interface methods
}



declare(strict_types=1);

entsCheck\RequirementInterface;

$ck()) {
    echo $



declare(strict_types=1);

entsCheck\Requirements;
use ItalyStrap\PlatformRequirementsCheck\RangeVersionRequirement;

$ng
    PHP_VERSION, // The current version to check against
    '7.4', // The minimum version you need, this is optional
    '8.0' // The maximum version you need, this is optional
    ),
    // add other 



declare(strict_types=1);

entsCheck\RangeVersionRequirement;

$current_version = '7.4';

$so will be replaced with 7.4 and the max version is 8.0, so 7.4 >= 7.4 and 7.4 <= 8.0

#######################################

$current_version = '8.0';

$


use ItalyStrap\PlatformRequirementsCheck\RangeVersionRequirement;

$



declare(strict_types=1);

// ... Main plugin file
/**
 * Plugin Name:       YOUR PLUGIN NAME
 * Plugin URI:        YOUR PLUGIN SITE
 * Description:       YOUR PLUGIN DESCRIPTION
 * Version:           1.0.0
 * Requires at least: 5.3
 * Requires PHP:      8.0.29
 * Author:            YOUR NAME
 * Author URI:        YOUR SITE
 * License:           GPL-2.0-or-later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       YOUR TEXT DOMAIN
 * Domain Path:       /languages
 */
 
 // ... Do yout stuff
 



declare(strict_types=1);

// ...bootstrap.php
equirementsCheck\RangeVersionRequirement(
        'PHP',
        \PHP_VERSION,
        (string)$plugin_data['RequiresPHP'],
        '8.0.29'
    ),
    new \ItalyStrap\PlatformRequirementsCheck\RangeVersionRequirement(
        'WP',
        $GLOBALS['wp_version'],
        (string)$plugin_data['RequiresWP'],
        '6.2'
    ),
];

$on(
        'admin_notices',
        static function () use ($