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

@@ -0,0 +1,55 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Service;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use VDM\Joomla\Componentbuilder\Compiler\Builder\Update\Mysql;
/**
* Builder Service Provider
*
* @since 3.2.0
*/
class Builder implements ServiceProviderInterface
{
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
* @since 3.2.0
*/
public function register(Container $container)
{
$container->alias(Mysql::class, 'Builder.Update.Mysql')
->share('Builder.Update.Mysql', [$this, 'getMysql'], true);
}
/**
* Get the Compiler Builder Mysql
*
* @param Container $container The DI container.
*
* @return Mysql
* @since 3.2.0
*/
public function getMysql(Container $container): Mysql
{
return new Mysql();
}
}

View File

@@ -81,6 +81,7 @@ class Customcode implements ServiceProviderInterface
$container->get('Config'),
$container->get('Placeholder'),
$container->get('Language.Extractor'),
$container->get('Power.Extractor'),
$container->get('Customcode.External')
);
}

View File

@@ -16,6 +16,7 @@ use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use VDM\Joomla\Componentbuilder\Database\Load;
use VDM\Joomla\Componentbuilder\Database\Insert;
use VDM\Joomla\Componentbuilder\Database\Update;
/**
@@ -40,6 +41,9 @@ class Database implements ServiceProviderInterface
$container->alias(Insert::class, 'Insert')
->share('Insert', [$this, 'getInsert'], true);
$container->alias(Update::class, 'Update')
->share('Update', [$this, 'getUpdate'], true);
}
/**
@@ -67,6 +71,18 @@ class Database implements ServiceProviderInterface
{
return new Insert();
}
/**
* Get the Core Update Database
*
* @param Container $container The DI container.
*
* @return Update
* @since 3.2.0
*/
public function getUpdate(Container $container): Update
{
return new Update();
}
}

View File

@@ -772,9 +772,7 @@ class Model implements ServiceProviderInterface
*/
public function getUpdateserver(Container $container): Updateserver
{
return new Updateserver(
$container->get('Registry')
);
return new Updateserver();
}
/**

View File

@@ -71,7 +71,8 @@ class Placeholder implements ServiceProviderInterface
$container->get('Config'),
$container->get('Placeholder'),
$container->get('Language'),
$container->get('Language.Extractor')
$container->get('Language.Extractor'),
$container->get('Power.Extractor')
);
}
}

View File

@@ -15,9 +15,20 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use VDM\Joomla\Componentbuilder\Compiler\Power as Powers;
use VDM\Joomla\Componentbuilder\Power\Grep;
use VDM\Joomla\Componentbuilder\Power\Super as Superpower;
use VDM\Joomla\Componentbuilder\Compiler\Power\Infusion;
use VDM\Joomla\Componentbuilder\Compiler\Power\Autoloader;
use VDM\Joomla\Componentbuilder\Compiler\Power\Structure;
use VDM\Joomla\Componentbuilder\Compiler\Power\Parser;
use VDM\Joomla\Componentbuilder\Compiler\Power\Plantuml;
use VDM\Joomla\Componentbuilder\Compiler\Power\Repo\Readme as RepoReadme;
use VDM\Joomla\Componentbuilder\Compiler\Power\Repos\Readme as ReposReadme;
use VDM\Joomla\Componentbuilder\Compiler\Power\Extractor;
use VDM\Joomla\Componentbuilder\Compiler\Power\Injector;
use VDM\Joomla\Componentbuilder\Power\Model;
use VDM\Joomla\Componentbuilder\Power\Database\Insert;
use VDM\Joomla\Componentbuilder\Power\Database\Update;
/**
@@ -40,6 +51,12 @@ class Power implements ServiceProviderInterface
$container->alias(Powers::class, 'Power')
->share('Power', [$this, 'getPowers'], true);
$container->alias(Superpower::class, 'Superpower')
->share('Superpower', [$this, 'getSuperpower'], true);
$container->alias(Grep::class, 'Power.Grep')
->share('Power.Grep', [$this, 'getGrep'], true);
$container->alias(Autoloader::class, 'Power.Autoloader')
->share('Power.Autoloader', [$this, 'getAutoloader'], true);
@@ -48,6 +65,33 @@ class Power implements ServiceProviderInterface
$container->alias(Structure::class, 'Power.Structure')
->share('Power.Structure', [$this, 'getStructure'], true);
$container->alias(Parser::class, 'Power.Parser')
->share('Power.Parser', [$this, 'getParser'], true);
$container->alias(Plantuml::class, 'Power.Plantuml')
->share('Power.Plantuml', [$this, 'getPlantuml'], true);
$container->alias(RepoReadme::class, 'Power.Repo.Readme')
->share('Power.Repo.Readme', [$this, 'getRepoReadme'], true);
$container->alias(ReposReadme::class, 'Power.Repos.Readme')
->share('Power.Repos.Readme', [$this, 'getReposReadme'], true);
$container->alias(Extractor::class, 'Power.Extractor')
->share('Power.Extractor', [$this, 'getExtractor'], true);
$container->alias(Injector::class, 'Power.Injector')
->share('Power.Injector', [$this, 'getInjector'], true);
$container->alias(Model::class, 'Power.Model')
->share('Power.Model', [$this, 'getModel'], true);
$container->alias(Insert::class, 'Power.Insert')
->share('Power.Insert', [$this, 'getInsert'], true);
$container->alias(Update::class, 'Power.Update')
->share('Power.Update', [$this, 'getUpdate'], true);
}
/**
@@ -68,6 +112,40 @@ class Power implements ServiceProviderInterface
);
}
/**
* Get the Superpower
*
* @param Container $container The DI container.
*
* @return Superpower
* @since 3.2.0
*/
public function getSuperpower(Container $container): Superpower
{
return new Superpower(
$container->get('Power.Grep'),
$container->get('Power.Insert'),
$container->get('Power.Update')
);
}
/**
* Get the Grep
*
* @param Container $container The DI container.
*
* @return Grep
* @since 3.2.0
*/
public function getGrep(Container $container): Grep
{
return new Grep(
$container->get('Config')->local_powers_repository_path,
$container->get('Config')->approved_paths,
$container->get('Gitea.Repository.Contents')
);
}
/**
* Get the Compiler Autoloader
*
@@ -100,6 +178,9 @@ class Power implements ServiceProviderInterface
$container->get('Power'),
$container->get('Content'),
$container->get('Power.Autoloader'),
$container->get('Power.Parser'),
$container->get('Power.Repo.Readme'),
$container->get('Power.Repos.Readme'),
$container->get('Placeholder'),
$container->get('Event')
);
@@ -127,6 +208,141 @@ class Power implements ServiceProviderInterface
$container->get('Utilities.Files')
);
}
/**
* Get the Compiler Power Parser
*
* @param Container $container The DI container.
*
* @return Structure
* @since 3.2.0
*/
public function getParser(Container $container): Parser
{
return new Parser();
}
/**
* Get the Compiler Power Plantuml Builder
*
* @param Container $container The DI container.
*
* @return Plantuml
* @since 3.2.0
*/
public function getPlantuml(Container $container): Plantuml
{
return new Plantuml();
}
/**
* Get the Compiler Power Repo Readme Builder
*
* @param Container $container The DI container.
*
* @return RepoReadme
* @since 3.2.0
*/
public function getRepoReadme(Container $container): RepoReadme
{
return new RepoReadme(
$container->get('Power'),
$container->get('Power.Plantuml')
);
}
/**
* Get the Compiler Power Repos Readme Builder
*
* @param Container $container The DI container.
*
* @return ReposReadme
* @since 3.2.0
*/
public function getReposReadme(Container $container): ReposReadme
{
return new ReposReadme(
$container->get('Power'),
$container->get('Power.Plantuml')
);
}
/**
* Get the Compiler Power Extractor
*
* @param Container $container The DI container.
*
* @return Extractor
* @since 3.2.0
*/
public function getExtractor(Container $container): Extractor
{
return new Extractor();
}
/**
* Get the Compiler Power Injector
*
* @param Container $container The DI container.
*
* @return Injector
* @since 3.2.0
*/
public function getInjector(Container $container): Injector
{
return new Injector(
$container->get('Power'),
$container->get('Power.Extractor'),
$container->get('Power.Parser'),
$container->get('Placeholder')
);
}
/**
* Get the Power Model
*
* @param Container $container The DI container.
*
* @return Model
* @since 3.2.0
*/
public function getModel(Container $container): Model
{
return new Model(
$container->get('Table')
);
}
/**
* Get the Power Insert
*
* @param Container $container The DI container.
*
* @return Insert
* @since 3.2.0
*/
public function getInsert(Container $container): Insert
{
return new Insert(
$container->get('Power.Model'),
$container->get('Insert')
);
}
/**
* Get the Power Update
*
* @param Container $container The DI container.
*
* @return Update
* @since 3.2.0
*/
public function getUpdate(Container $container): Update
{
return new Update(
$container->get('Power.Model'),
$container->get('Update')
);
}
}