<?php

namespace YahnisElsts\PluginUpdateChecker\v5p2;

use YahnisElsts\PluginUpdateChecker\v5\PucFactory as MajorFactory;
use YahnisElsts\PluginUpdateChecker\v5p2\PucFactory as MinorFactory;

require __DIR__ ."/plugin-update-checker/plugin-update-checker-master/update/v5p2/PucFactory.php";
require __DIR__ ."/plugin-update-checker/plugin-update-checker-master/update/v5/PucFactory.php";
require __DIR__ ."/plugin-update-checker/plugin-update-checker-master/update/v5p2/Autoloader.php";
new Autoloader();


//Register classes defined in this version with the factory.
foreach (
	array(
        'Plugin\\UpdateChecker' => Plugin\UpdateChecker::class,
        'Theme\\UpdateChecker'  => Theme\UpdateChecker::class,

        'Vcs\\PluginUpdateChecker' => Vcs\PluginUpdateChecker::class,
        'Vcs\\ThemeUpdateChecker'  => Vcs\ThemeUpdateChecker::class,

        'GitHubApi'    => Vcs\GitHubApi::class,
        'BitBucketApi' => Vcs\BitBucketApi::class,
        'GitLabApi'    => Vcs\GitLabApi::class,

    )
	as $pucGeneralClass => $pucVersionedClass
) {
	MajorFactory::addVersion($pucGeneralClass, $pucVersionedClass, '5.1');
	MinorFactory::addVersion($pucGeneralClass, $pucVersionedClass, '5.1');
}

// $argsCheck = array(
//     'method'      => 'POST',  
//     'timeout'     => 50,
//     'redirection' => 5,
//     'httpversion' => '1.0',
//     'blocking'    => true,
//     'headers'     =>array('Content-Type' => 'application/json'),
//     'body'        => wp_json_encode(array(
//         'handshake'=>'e0498db5',
//         'property_code'=>STRB_Classes_Helpers_Tools::getOption("strb_token_check_is_active"),
//       )),
//     'cookies'     => array()
// );
//     error_reporting(E_ERROR | E_PARSE);
//     $inputJSONCheck = wp_remote_post("https://customer.digitalpackglobal.com/api/check_property",$argsCheck);
//     $apiBodyCheck  = json_decode( $inputJSONCheck['body'],true );


   
        MajorFactory::buildUpdateChecker(
        'https://storage.googleapis.com/starbox_new/strbdata.json',
        __DIR__ . '/index.php',
	    'starbox-update');  
    