Adds better remote repository management for the super power features. Fixes #1014 so that powers are added to components.

This commit is contained in:
2023-10-20 20:29:19 +02:00
parent e99899f6f1
commit ae9451292f
21 changed files with 234 additions and 51 deletions

View File

@@ -85,6 +85,16 @@ abstract class Api
$this->http->setToken($token);
}
}
/**
* Get the API url
*
* @return string
* @since 3.2.0
**/
public function api()
{
return $this->uri->api();
}
}

View File

@@ -58,7 +58,7 @@ class Jcb implements ServiceProviderInterface
$gitea_url = Helper::getParams('com_componentbuilder')->get('custom_gitea_url');
// only load this if we have a custom URL set
if ($add_gitea_url == 2 && is_string($gitea_url) && strpos($gitea_url, 'http') !== false)
if ($add_gitea_url == 2 && !empty($gitea_url) && strpos($gitea_url, 'http') !== false)
{
return new Uri($gitea_url);
}

View File

@@ -72,7 +72,6 @@ final class Http extends JoomlaHttp
$headers['Authorization'] = 'token ' . $token;
$this->setOption('headers', $headers);
}
}
}

View File

@@ -134,7 +134,6 @@ final class Uri
private function setVersion($version)
{
$this->version = $version;
}
}
}