Moves multiple class methods to their own power classes. Moves many compiler config values to its own config class. Updated the Expantion method to use the new config class.

This commit is contained in:
2022-08-30 17:28:41 +02:00
parent f8ac247377
commit 4928a8baaf
58 changed files with 14568 additions and 12580 deletions

View File

@@ -0,0 +1,56 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @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\Component\Placeholder as ComponentPlaceholder;
/**
* Component Service Provider
*
* @since 3.2.0
*/
class Component 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(ComponentPlaceholder::class, 'Component.Placeholder')
->share('Component.Placeholder', [$this, 'getComponentPlaceholder'], true);
}
/**
* Get the Component Placeholders
*
* @param Container $container The DI container.
*
* @return ComponentPlaceholder
* @since 3.2.0
*/
public function getComponentPlaceholder(Container $container): ComponentPlaceholder
{
return new ComponentPlaceholder(
$container->get('Config')
);
}
}

View File

@@ -0,0 +1,54 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @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\Config as CompilerConfig;
/**
* Compiler Config Service Provider
*
* @since 3.2.0
*/
class Config 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(CompilerConfig::class, 'Config')
->share('Config', [$this, 'getConfig'], true);
}
/**
* Get the Compiler Configurations
*
* @param Container $container The DI container.
*
* @return CompilerConfig
* @since 3.2.0
*/
public function getConfig(Container $container): CompilerConfig
{
return new CompilerConfig();
}
}

View File

@@ -0,0 +1,99 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @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\Customcode as CompilerCustomcode;
use VDM\Joomla\Componentbuilder\Compiler\Customcode\External;
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui;
/**
* Compiler Custom Code Service Provider
*
* @since 3.2.0
*/
class Customcode 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(CompilerCustomcode::class, 'Customcode')
->share('Customcode', [$this, 'getCustomcode'], true);
$container->alias(External::class, 'Customcode.External')
->share('Customcode.External', [$this, 'getExternal'], true);
$container->alias(Gui::class, 'Customcode.Gui')
->share('Customcode.Gui', [$this, 'getGui'], true);
}
/**
* Get the Compiler Customcode
*
* @param Container $container The DI container.
*
* @return CompilerCustomcode
* @since 3.2.0
*/
public function getCustomcode(Container $container): CompilerCustomcode
{
return new CompilerCustomcode(
$container->get('Config'),
$container->get('Placeholder'),
$container->get('Language.Extractor'),
$container->get('Customcode.External')
);
}
/**
* Get the Compiler Customcode External
*
* @param Container $container The DI container.
*
* @return External
* @since 3.2.0
*/
public function getExternal(Container $container): External
{
return new External(
$container->get('Placeholder')
);
}
/**
* Get the Compiler Customcode Gui
*
* @param Container $container The DI container.
*
* @return Gui
* @since 3.2.0
*/
public function getGui(Container $container): Gui
{
return new Gui(
$container->get('Config'),
$container->get('Placeholder.Reverse')
);
}
}

View File

@@ -0,0 +1,55 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @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\Interfaces\EventInterface;
use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\Event as J3Event;
/**
* Event Service Provider
*
* @since 3.2.0
*/
class Event 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(J3Event::class, 'J3.Event')
->share('J3.Event', [$this, 'getJ3Event'], true);
}
/**
* Get the Joomla 3 Event
*
* @param Container $container The DI container.
*
* @return EventInterface
* @since 3.2.0
*/
public function getJ3Event(Container $container): EventInterface
{
return new J3Event();
}
}

View File

@@ -0,0 +1,55 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @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\Interfaces\GetScriptInterface;
use VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaThree\InstallScript as J3InstallScript;
/**
* Extension Script Service Provider
*
* @since 3.2.0
*/
class Extension 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(J3InstallScript::class, 'J3.Extension.InstallScript')
->share('J3.Extension.InstallScript', [$this, 'getJ3ExtensionInstallScript'], true);
}
/**
* Get the Joomla 3 Extension Install Script
*
* @param Container $container The DI container.
*
* @return GetScriptInterface
* @since 3.2.0
*/
public function getJ3ExtensionInstallScript(Container $container): GetScriptInterface
{
return new J3InstallScript();
}
}

View File

@@ -0,0 +1,78 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @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\Language as CompilerLanguage;
use VDM\Joomla\Componentbuilder\Compiler\Language\Extractor;
/**
* Compiler Language Service Provider
*
* @since 3.2.0
*/
class Language 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(CompilerLanguage::class, 'Language')
->share('Language', [$this, 'getLanguage'], true);
$container->alias(Extractor::class, 'Language.Extractor')
->share('Language.Extractor', [$this, 'getLanguageExtractor'], true);
}
/**
* Get the Compiler Language
*
* @param Container $container The DI container.
*
* @return CompilerLanguage
* @since 3.2.0
*/
public function getLanguage(Container $container): CompilerLanguage
{
return new CompilerLanguage(
$container->get('Config')
);
}
/**
* Get the Compiler Language Extractor
*
* @param Container $container The DI container.
*
* @return Extractor
* @since 3.2.0
*/
public function getLanguageExtractor(Container $container): Extractor
{
return new Extractor(
$container->get('Config'),
$container->get('Language'),
$container->get('Placeholder')
);
}
}

View File

@@ -0,0 +1,78 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @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\Placeholder as CompilerPlaceholder;
use VDM\Joomla\Componentbuilder\Compiler\Placeholder\Reverse;
/**
* Compiler Placeholder Service Provider
*
* @since 3.2.0
*/
class Placeholder 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(CompilerPlaceholder::class, 'Placeholder')
->share('Placeholder', [$this, 'getPlaceholder'], true);
$container->alias(Reverse::class, 'Placeholder.Reverse')
->share('Placeholder.Reverse', [$this, 'getPlaceholderReverse'], true);
}
/**
* Get the Compiler Placeholder
*
* @param Container $container The DI container.
*
* @return CompilerPlaceholder
* @since 3.2.0
*/
public function getPlaceholder(Container $container): CompilerPlaceholder
{
return new CompilerPlaceholder(
$container->get('Config')
);
}
/**
* Get the Compiler Placeholder Reverse
*
* @param Container $container The DI container.
*
* @return Worker
* @since 3.2.0
*/
public function getPlaceholderReverse(Container $container): Reverse
{
return new Reverse(
$container->get('Config'),
$container->get('Placeholder'),
$container->get('Language'),
$container->get('Language.Extractor')
);
}
}

View File

@@ -0,0 +1,59 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @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\Power as CompilerPower;
/**
* Compiler Power Service Provider
*
* @since 3.2.0
*/
class Power 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(CompilerPower::class, 'Power')
->share('Power', [$this, 'getPower'], true);
}
/**
* Get the Compiler Power
*
* @param Container $container The DI container.
*
* @return CompilerPower
* @since 3.2.0
*/
public function getPower(Container $container): CompilerPower
{
return new CompilerPower(
$container->get('Config'),
$container->get('Placeholder'),
$container->get('Customcode'),
$container->get('Customcode.Gui')
);
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>