bricks all the bricks

This commit is contained in:
2023-02-16 21:22:46 -05:00
commit bbb70ea329
129 changed files with 13476 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
<?php
namespace cooini\iniRepo\repositories;
use cooini\Inirepo\pluginManager\pluginInstaller;
class pluginRepository extends repository
{
public function getPluginInstaller()
{
return new pluginInstaller($this);
}
public function getRequiredPlugins(): array
{
// TODO: Implement getRequiredPlugins() method.
}
public function getLicensedPlugins(): array
{
return $this->getLicensed("plugin");
}
public function getLicensed(string $type='plugin')
{
$plugins_request = wp_remote_post("https://internal-devrepo.courselauncher.io/test.php", ['body'=>['site'=>get_site_url() ]] );
if( is_wp_error( $plugins_request ) ) {
return false; // Bail early
}
$plugins_response = json_decode( wp_remote_retrieve_body( $plugins_request ));
if ($plugins_response and isset($plugins_response->result))
{
return $plugins_response->result;
}
else
throw new \Exception("Invalid return determining licensed plugins");
}
public function get(string $item_name): array
{
// TODO: Implement get() method.
}
public function isItemLicensed(string $item_name): bool
{
// TODO: Implement isItemLicensed() method.
}
}

View File

@@ -0,0 +1,14 @@
<?php
namespace cooini\iniRepo\repositories;
abstract class repository implements repositoryInterface
{
public string $url;
public string $auth_token;
public function __construct($repo_url, $auth)
{
$this->url = $repo_url;
$this->auth_token = $auth;
}
}

View File

@@ -0,0 +1,9 @@
<?php
namespace cooini\iniRepo\repositories;
interface repositoryInterface
{
public function getLicensed(string $type) ;
public function get(string $item_name) : array;
public function isItemLicensed(string $item_name) : bool;
}