Fix the update server #978 issue. Fixed the change log to load all entries, not just the last one. Fixed #983 so that database updates are created when adding a new adminview. Moved a few builder arrays to the Compiler Registry. Adds super powers to JCB. Adds Gitea API library. Improves Power filters. Fix #991 to add the Utilities service class. Adds Superpower Key (SPK) replacement feature. Adds Superpower search (GREP) feature. Adds Power Insert/Update Classe. Fix #995 that all update sites are using the correct URL.

This commit is contained in:
2023-05-02 02:10:55 +02:00
parent d6c73987f5
commit df16b2e3ad
246 changed files with 24890 additions and 4141 deletions

View File

@@ -57,6 +57,17 @@ class Config extends BaseConfig
$this->config = $config ?: JoomlaFactory::getConfig();
}
/**
* get Gitea Access Token
*
* @return string the access token
* @since 3.2.0
*/
protected function getGiteatoken(): ?string
{
return $this->params->get('access.token');
}
/**
* get add contributors switch
*
@@ -538,6 +549,68 @@ class Config extends BaseConfig
return $this->params->get('jcb_powers_path', 'libraries/jcb_powers');
}
/**
* Get local super powers repository path
*
* @return string The path to the local repository
* @since 3.2.0
*/
protected function getLocalpowersrepositorypath(): string
{
$default = $this->tmp_path . '/super_powers';
if (!$this->add_super_powers)
{
return $default;
}
$global = $this->params->get('local_powers_repository_path', $default);
if (!$this->show_advanced_options)
{
return $global;
}
$value = $this->input->post->get('powers_repository', 2, 'INT');
return $value == 1
? $this->input->post->get('local_powers_repository_path', $global, 'PATH')
: $global;
}
/**
* Get super power approved paths
*
* @return array The approved paths to the repositories on Gitea
* @since 3.2.0
*/
protected function getApprovedpaths(): array
{
$default = (object) ['owner' => 'joomla', 'repo' => 'super-powers', 'branch' => 'master'];
if (!$this->add_own_powers)
{
return [$default];
}
$paths = $this->params->get('approved_paths');
$approved = [];
if (!empty($paths))
{
foreach ($paths as $path)
{
// we make sure to get only the objects
$approved[] = $path;
}
}
// finally we add the default
$approved[] = $default;
return $approved;
}
/**
* get bom path
*
@@ -661,6 +734,42 @@ class Config extends BaseConfig
return (bool) $value;
}
/**
* Get switch to add super powers
*
* @return bool Switch to add super powers
* @since 3.2.0
*/
protected function getAddsuperpowers(): bool
{
$default = (bool) $this->params->get('powers_repository', 0);
if (!$this->show_advanced_options)
{
return $default;
}
$value = $this->input->post->get('powers_repository', 2, 'INT');
return $value == 2 ? $default : (bool) $value;
}
/**
* Get switch to add own super powers
*
* @return bool Switch to add own super powers
* @since 3.2.0
*/
protected function getAddownpowers(): bool
{
if ($this->add_super_powers)
{
return (bool) $this->params->get('super_powers_repositories', 0);
}
return false;
}
/**
* get switch build target switch
*