Compare commits
No commits in common. "dev" and "master" have entirely different histories.
52
README.md
52
README.md
|
@ -30,7 +30,6 @@ This repository contains an index (see below) of all the approved powers within
|
|||
|
||||
- **abstract class Factory** | [Details](src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac) | [Code](src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php) | [Settings](src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json) | Super__d910d8b8_4c23_4f3e_8cda_438f2d2bd7ac__Power
|
||||
- **final class Component** | [Details](src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0) | [Code](src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/code.php) | [Settings](src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/settings.json) | Super__e2472b22_a329_44d8_b4a2_ae3ba99e17a0__Power
|
||||
- **final class JoomlaPower** | [Details](src/3730a000-ab64-477d-8b0f-70eaf71b517a) | [Code](src/3730a000-ab64-477d-8b0f-70eaf71b517a/code.php) | [Settings](src/3730a000-ab64-477d-8b0f-70eaf71b517a/settings.json) | Super__3730a000_ab64_477d_8b0f_70eaf71b517a__Power
|
||||
- **class Config** | [Details](src/fa4bf18e-301e-42e3-91fb-6e0096c07adc) | [Code](src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.php) | [Settings](src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/settings.json) | Super__fa4bf18e_301e_42e3_91fb_6e0096c07adc__Power
|
||||
- **class Customcode** | [Details](src/313b43c4-98c3-4f62-9177-2d73ec8eba31) | [Code](src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.php) | [Settings](src/313b43c4-98c3-4f62-9177-2d73ec8eba31/settings.json) | Super__313b43c4_98c3_4f62_9177_2d73ec8eba31__Power
|
||||
- **class Field** | [Details](src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75) | [Code](src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/code.php) | [Settings](src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/settings.json) | Super__d7ba2d5d_10b6_470d_978d_9f91ea65ee75__Power
|
||||
|
@ -41,22 +40,14 @@ This repository contains an index (see below) of all the approved powers within
|
|||
- **Namespace**: [VDM\Joomla\Componentbuilder\Interfaces](#vdm-joomla-componentbuilder-interfaces)
|
||||
|
||||
- **interface Cryptinterface** | [Details](src/81de8f57-dd9c-4a17-964f-848cd4a0743b) | [Code](src/81de8f57-dd9c-4a17-964f-848cd4a0743b/code.php) | [Settings](src/81de8f57-dd9c-4a17-964f-848cd4a0743b/settings.json) | Super__81de8f57_dd9c_4a17_964f_848cd4a0743b__Power
|
||||
- **interface GrepInterface** | [Details](src/c182506a-ab84-439c-b962-1e606b58d545) | [Code](src/c182506a-ab84-439c-b962-1e606b58d545/code.php) | [Settings](src/c182506a-ab84-439c-b962-1e606b58d545/settings.json) | Super__c182506a_ab84_439c_b962_1e606b58d545__Power
|
||||
- **interface Serverinterface** | [Details](src/86ac0760-26f5-4746-9c7f-ce77860f80f8) | [Code](src/86ac0760-26f5-4746-9c7f-ce77860f80f8/code.php) | [Settings](src/86ac0760-26f5-4746-9c7f-ce77860f80f8/settings.json) | Super__86ac0760_26f5_4746_9c7f_ce77860f80f8__Power
|
||||
- **interface SuperInterface** | [Details](src/51de80f2-2868-4c2c-8198-ef79349e9bd7) | [Code](src/51de80f2-2868-4c2c-8198-ef79349e9bd7/code.php) | [Settings](src/51de80f2-2868-4c2c-8198-ef79349e9bd7/settings.json) | Super__51de80f2_2868_4c2c_8198_ef79349e9bd7__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\JoomlaPower](#vdm-joomla-componentbuilder-joomlapower)
|
||||
|
||||
- **abstract class Factory** | [Details](src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400) | [Code](src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400/code.php) | [Settings](src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400/settings.json) | Super__6ee3dc9e_1949_4da5_a74f_d9eb7f14e400__Power
|
||||
- **final class Grep** | [Details](src/355bf21a-f859-4528-9110-bcd2c6d05ea7) | [Code](src/355bf21a-f859-4528-9110-bcd2c6d05ea7/code.php) | [Settings](src/355bf21a-f859-4528-9110-bcd2c6d05ea7/settings.json) | Super__355bf21a_f859_4528_9110_bcd2c6d05ea7__Power
|
||||
- **final class Super** | [Details](src/39a75870-a7f7-45fd-937d-5ba97b85b8ad) | [Code](src/39a75870-a7f7-45fd-937d-5ba97b85b8ad/code.php) | [Settings](src/39a75870-a7f7-45fd-937d-5ba97b85b8ad/settings.json) | Super__39a75870_a7f7_45fd_937d_5ba97b85b8ad__Power
|
||||
- **class Config** | [Details](src/0b821bba-7503-4448-90e7-f3c1bd51dfd6) | [Code](src/0b821bba-7503-4448-90e7-f3c1bd51dfd6/code.php) | [Settings](src/0b821bba-7503-4448-90e7-f3c1bd51dfd6/settings.json) | Super__0b821bba_7503_4448_90e7_f3c1bd51dfd6__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Power](#vdm-joomla-componentbuilder-power)
|
||||
|
||||
- **abstract class Factory** | [Details](src/a5734b9e-a72d-494c-bc72-c3bc7506015f) | [Code](src/a5734b9e-a72d-494c-bc72-c3bc7506015f/code.php) | [Settings](src/a5734b9e-a72d-494c-bc72-c3bc7506015f/settings.json) | Super__a5734b9e_a72d_494c_bc72_c3bc7506015f__Power
|
||||
- **final class Generator** | [Details](src/505801ac-d3e2-44c6-a300-9a57a96170c6) | [Code](src/505801ac-d3e2-44c6-a300-9a57a96170c6/code.php) | [Settings](src/505801ac-d3e2-44c6-a300-9a57a96170c6/settings.json) | Super__505801ac_d3e2_44c6_a300_9a57a96170c6__Power
|
||||
- **final class Grep** | [Details](src/6784dd52-0909-451a-a872-9a942a023c68) | [Code](src/6784dd52-0909-451a-a872-9a942a023c68/code.php) | [Settings](src/6784dd52-0909-451a-a872-9a942a023c68/settings.json) | Super__6784dd52_0909_451a_a872_9a942a023c68__Power
|
||||
- **final class Super** | [Details](src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff) | [Code](src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/code.php) | [Settings](src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/settings.json) | Super__3ab0eba9_f37b_4b37_aec1_2e78067f2aff__Power
|
||||
- **class Config** | [Details](src/be4ccfae-65a9-401e-bdbe-637d8c226954) | [Code](src/be4ccfae-65a9-401e-bdbe-637d8c226954/code.php) | [Settings](src/be4ccfae-65a9-401e-bdbe-637d8c226954/settings.json) | Super__be4ccfae_65a9_401e_bdbe_637d8c226954__Power
|
||||
- **class Super** | [Details](src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff) | [Code](src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/code.php) | [Settings](src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/settings.json) | Super__3ab0eba9_f37b_4b37_aec1_2e78067f2aff__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Service](#vdm-joomla-componentbuilder-service)
|
||||
|
||||
- **class CoreRules** | [Details](src/f65b52c2-593a-4c35-89d1-4a8e57a1adf0) | [Code](src/f65b52c2-593a-4c35-89d1-4a8e57a1adf0/code.php) | [Settings](src/f65b52c2-593a-4c35-89d1-4a8e57a1adf0/settings.json) | Super__f65b52c2_593a_4c35_89d1_4a8e57a1adf0__Power
|
||||
|
@ -261,10 +252,6 @@ This repository contains an index (see below) of all the approved powers within
|
|||
- **final class Event** | [Details](src/4729c2b0-f12b-4397-8d77-055d38bca98b) | [Code](src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.php) | [Settings](src/4729c2b0-f12b-4397-8d77-055d38bca98b/settings.json) | Super__4729c2b0_f12b_4397_8d77_055d38bca98b__Power
|
||||
- **final class Header** | [Details](src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49) | [Code](src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.php) | [Settings](src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/settings.json) | Super__1ee227b9_da0f_4e7b_ae66_99a9d53f6f49__Power
|
||||
- **final class History** | [Details](src/25c7ca86-6088-4f5f-b9fe-13504779c6ba) | [Code](src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.php) | [Settings](src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/settings.json) | Super__25c7ca86_6088_4f5f_b9fe_13504779c6ba__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\JoomlaPower](#vdm-joomla-componentbuilder-compiler-joomlapower)
|
||||
|
||||
- **final class Extractor** | [Details](src/82505f3f-297f-4d75-a581-929ab3e93689) | [Code](src/82505f3f-297f-4d75-a581-929ab3e93689/code.php) | [Settings](src/82505f3f-297f-4d75-a581-929ab3e93689/settings.json) | Super__82505f3f_297f_4d75_a581_929ab3e93689__Power
|
||||
- **final class Injector** | [Details](src/a6052fe9-0d2b-4b36-b3e7-03b47c483542) | [Code](src/a6052fe9-0d2b-4b36-b3e7-03b47c483542/code.php) | [Settings](src/a6052fe9-0d2b-4b36-b3e7-03b47c483542/settings.json) | Super__a6052fe9_0d2b_4b36_b3e7_03b47c483542__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\JoomlaThree](#vdm-joomla-componentbuilder-compiler-joomlathree)
|
||||
|
||||
- **final class Event** | [Details](src/4b86f62e-ce41-4325-a11a-08148807d0df) | [Code](src/4b86f62e-ce41-4325-a11a-08148807d0df/code.php) | [Settings](src/4b86f62e-ce41-4325-a11a-08148807d0df/settings.json) | Super__4b86f62e_ce41_4325_a11a_08148807d0df__Power
|
||||
|
@ -331,11 +318,11 @@ This repository contains an index (see below) of all the approved powers within
|
|||
- **class Reverse** | [Details](src/ca111518-e47c-4049-b1b2-cb010f23866f) | [Code](src/ca111518-e47c-4049-b1b2-cb010f23866f/code.php) | [Settings](src/ca111518-e47c-4049-b1b2-cb010f23866f/settings.json) | Super__ca111518_e47c_4049_b1b2_cb010f23866f__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Power](#vdm-joomla-componentbuilder-compiler-power)
|
||||
|
||||
- **final class Extractor** | [Details](src/eeb03266-22fd-45bb-953a-961bb6be3a54) | [Code](src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.php) | [Settings](src/eeb03266-22fd-45bb-953a-961bb6be3a54/settings.json) | Super__eeb03266_22fd_45bb_953a_961bb6be3a54__Power
|
||||
- **final class Injector** | [Details](src/763d137c-42bc-4282-98d8-cc5c0654985f) | [Code](src/763d137c-42bc-4282-98d8-cc5c0654985f/code.php) | [Settings](src/763d137c-42bc-4282-98d8-cc5c0654985f/settings.json) | Super__763d137c_42bc_4282_98d8_cc5c0654985f__Power
|
||||
- **final class Parser** | [Details](src/95d0e03f-24fd-4412-bc2e-f0899fcc3205) | [Code](src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/code.php) | [Settings](src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/settings.json) | Super__95d0e03f_24fd_4412_bc2e_f0899fcc3205__Power
|
||||
- **class Autoloader** | [Details](src/6e64917c-d687-4ef3-a655-811319f5a81e) | [Code](src/6e64917c-d687-4ef3-a655-811319f5a81e/code.php) | [Settings](src/6e64917c-d687-4ef3-a655-811319f5a81e/settings.json) | Super__6e64917c_d687_4ef3_a655_811319f5a81e__Power
|
||||
- **class Extractor** | [Details](src/eeb03266-22fd-45bb-953a-961bb6be3a54) | [Code](src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.php) | [Settings](src/eeb03266-22fd-45bb-953a-961bb6be3a54/settings.json) | Super__eeb03266_22fd_45bb_953a_961bb6be3a54__Power
|
||||
- **class Infusion** | [Details](src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c) | [Code](src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.php) | [Settings](src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/settings.json) | Super__0419081e_4cb3_4c65_8c6a_ffe941fb0f1c__Power
|
||||
- **class Injector** | [Details](src/763d137c-42bc-4282-98d8-cc5c0654985f) | [Code](src/763d137c-42bc-4282-98d8-cc5c0654985f/code.php) | [Settings](src/763d137c-42bc-4282-98d8-cc5c0654985f/settings.json) | Super__763d137c_42bc_4282_98d8_cc5c0654985f__Power
|
||||
- **class Plantuml** | [Details](src/ff5e9e63-86d0-4691-ab59-d4b9d9154096) | [Code](src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/code.php) | [Settings](src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/settings.json) | Super__ff5e9e63_86d0_4691_ab59_d4b9d9154096__Power
|
||||
- **class Structure** | [Details](src/324566de-0f7d-4b6e-9caf-8424d55013ae) | [Code](src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.php) | [Settings](src/324566de-0f7d-4b6e-9caf-8424d55013ae/settings.json) | Super__324566de_0f7d_4b6e_9caf_8424d55013ae__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Service](#vdm-joomla-componentbuilder-compiler-service)
|
||||
|
@ -355,7 +342,6 @@ This repository contains an index (see below) of all the approved powers within
|
|||
- **class Field** | [Details](src/c6c30d66-3106-44eb-9272-b2cf7ec74613) | [Code](src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.php) | [Settings](src/c6c30d66-3106-44eb-9272-b2cf7ec74613/settings.json) | Super__c6c30d66_3106_44eb_9272_b2cf7ec74613__Power
|
||||
- **class Header** | [Details](src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d) | [Code](src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.php) | [Settings](src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/settings.json) | Super__36d49d4a_8d0e_435f_ab4c_8f247d96fd4d__Power
|
||||
- **class History** | [Details](src/63782f74-7b03-4745-aa40-0adf8ed4e704) | [Code](src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.php) | [Settings](src/63782f74-7b03-4745-aa40-0adf8ed4e704/settings.json) | Super__63782f74_7b03_4745_aa40_0adf8ed4e704__Power
|
||||
- **class JoomlaPower** | [Details](src/5716c79f-a1c9-4059-9d00-8cccb9f9e061) | [Code](src/5716c79f-a1c9-4059-9d00-8cccb9f9e061/code.php) | [Settings](src/5716c79f-a1c9-4059-9d00-8cccb9f9e061/settings.json) | Super__5716c79f_a1c9_4059_9d00_8cccb9f9e061__Power
|
||||
- **class Joomlamodule** | [Details](src/295186de-5954-4a65-a4c1-2f79ef305743) | [Code](src/295186de-5954-4a65-a4c1-2f79ef305743/code.php) | [Settings](src/295186de-5954-4a65-a4c1-2f79ef305743/settings.json) | Super__295186de_5954_4a65_a4c1_2f79ef305743__Power
|
||||
- **class Joomlaplugin** | [Details](src/9eba241c-af90-42dd-ae05-92ff4d8391d3) | [Code](src/9eba241c-af90-42dd-ae05-92ff4d8391d3/code.php) | [Settings](src/9eba241c-af90-42dd-ae05-92ff4d8391d3/settings.json) | Super__9eba241c_af90_42dd_ae05_92ff4d8391d3__Power
|
||||
- **class Language** | [Details](src/9f00e793-86f8-4ef9-b775-a3eb129f83c0) | [Code](src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/code.php) | [Settings](src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/settings.json) | Super__9f00e793_86f8_4ef9_b775_a3eb129f83c0__Power
|
||||
|
@ -385,29 +371,11 @@ This repository contains an index (see below) of all the approved powers within
|
|||
- **class Pathfix** | [Details](src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f) | [Code](src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/code.php) | [Settings](src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/settings.json) | Super__cdc9b06d_8333_4fa7_ab4d_b810dd90f95f__Power
|
||||
- **class Paths** | [Details](src/6f20369a-8536-4870-a1a3-cda254c939c8) | [Code](src/6f20369a-8536-4870-a1a3-cda254c939c8/code.php) | [Settings](src/6f20369a-8536-4870-a1a3-cda254c939c8/settings.json) | Super__6f20369a_8536_4870_a1a3_cda254c939c8__Power
|
||||
- **class Structure** | [Details](src/1efdded5-d6c8-452c-8f37-0374483a7b3f) | [Code](src/1efdded5-d6c8-452c-8f37-0374483a7b3f/code.php) | [Settings](src/1efdded5-d6c8-452c-8f37-0374483a7b3f/settings.json) | Super__1efdded5_d6c8_452c_8f37_0374483a7b3f__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Interfaces\Database](#vdm-joomla-componentbuilder-interfaces-database)
|
||||
|
||||
- **interface InsertInterface** | [Details](src/95c02df3-fe0a-405b-b506-b7a5b8605b66) | [Code](src/95c02df3-fe0a-405b-b506-b7a5b8605b66/code.php) | [Settings](src/95c02df3-fe0a-405b-b506-b7a5b8605b66/settings.json) | Super__95c02df3_fe0a_405b_b506_b7a5b8605b66__Power
|
||||
- **interface UpdateInterface** | [Details](src/69c29be3-ab25-4f56-944e-7ada6307b10c) | [Code](src/69c29be3-ab25-4f56-944e-7ada6307b10c/code.php) | [Settings](src/69c29be3-ab25-4f56-944e-7ada6307b10c/settings.json) | Super__69c29be3_ab25_4f56_944e_7ada6307b10c__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\JoomlaPower\Database](#vdm-joomla-componentbuilder-joomlapower-database)
|
||||
|
||||
- **final class Insert** | [Details](src/9d53d45e-9b4d-45ec-827b-4916b91c907e) | [Code](src/9d53d45e-9b4d-45ec-827b-4916b91c907e/code.php) | [Settings](src/9d53d45e-9b4d-45ec-827b-4916b91c907e/settings.json) | Super__9d53d45e_9b4d_45ec_827b_4916b91c907e__Power
|
||||
- **final class Load** | [Details](src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a) | [Code](src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a/code.php) | [Settings](src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a/settings.json) | Super__b4ea5de3_653f_43f9_b927_4ba6456b4d0a__Power
|
||||
- **final class Update** | [Details](src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b) | [Code](src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b/code.php) | [Settings](src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b/settings.json) | Super__679473f6_3ea2_49d5_8273_1b29c8f0ad2b__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\JoomlaPower\Model](#vdm-joomla-componentbuilder-joomlapower-model)
|
||||
|
||||
- **final class Load** | [Details](src/05744dd3-4030-4cf8-8dda-a93ab809b473) | [Code](src/05744dd3-4030-4cf8-8dda-a93ab809b473/code.php) | [Settings](src/05744dd3-4030-4cf8-8dda-a93ab809b473/settings.json) | Super__05744dd3_4030_4cf8_8dda_a93ab809b473__Power
|
||||
- **final class Upsert** | [Details](src/9206082e-a3f7-472e-98b2-de90d06cbdcd) | [Code](src/9206082e-a3f7-472e-98b2-de90d06cbdcd/code.php) | [Settings](src/9206082e-a3f7-472e-98b2-de90d06cbdcd/settings.json) | Super__9206082e_a3f7_472e_98b2_de90d06cbdcd__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\JoomlaPower\Service](#vdm-joomla-componentbuilder-joomlapower-service)
|
||||
|
||||
- **class Database** | [Details](src/a2992a91-eec2-4957-811b-8cde22aa1438) | [Code](src/a2992a91-eec2-4957-811b-8cde22aa1438/code.php) | [Settings](src/a2992a91-eec2-4957-811b-8cde22aa1438/settings.json) | Super__a2992a91_eec2_4957_811b_8cde22aa1438__Power
|
||||
- **class JoomlaPower** | [Details](src/38e1ca3e-1908-459a-be87-9f83b292058f) | [Code](src/38e1ca3e-1908-459a-be87-9f83b292058f/code.php) | [Settings](src/38e1ca3e-1908-459a-be87-9f83b292058f/settings.json) | Super__38e1ca3e_1908_459a_be87_9f83b292058f__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Power\Database](#vdm-joomla-componentbuilder-power-database)
|
||||
|
||||
- **interface LoadInterface** | [Details](src/99786f53-64b7-4d52-95b0-5306e7386c3f) | [Code](src/99786f53-64b7-4d52-95b0-5306e7386c3f/code.php) | [Settings](src/99786f53-64b7-4d52-95b0-5306e7386c3f/settings.json) | Super__99786f53_64b7_4d52_95b0_5306e7386c3f__Power
|
||||
- **class Insert** | [Details](src/380bb7a3-cdcc-4336-a699-5070cbf521a5) | [Code](src/380bb7a3-cdcc-4336-a699-5070cbf521a5/code.php) | [Settings](src/380bb7a3-cdcc-4336-a699-5070cbf521a5/settings.json) | Super__380bb7a3_cdcc_4336_a699_5070cbf521a5__Power
|
||||
- **class Load** | [Details](src/1f86db0f-e271-45df-8795-3e503ec76698) | [Code](src/1f86db0f-e271-45df-8795-3e503ec76698/code.php) | [Settings](src/1f86db0f-e271-45df-8795-3e503ec76698/settings.json) | Super__1f86db0f_e271_45df_8795_3e503ec76698__Power
|
||||
- **class Update** | [Details](src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3) | [Code](src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/code.php) | [Settings](src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/settings.json) | Super__e543c123_b1d9_4a0b_83b2_a9d371da5ff3__Power
|
||||
- **final class Insert** | [Details](src/380bb7a3-cdcc-4336-a699-5070cbf521a5) | [Code](src/380bb7a3-cdcc-4336-a699-5070cbf521a5/code.php) | [Settings](src/380bb7a3-cdcc-4336-a699-5070cbf521a5/settings.json) | Super__380bb7a3_cdcc_4336_a699_5070cbf521a5__Power
|
||||
- **final class Load** | [Details](src/1f86db0f-e271-45df-8795-3e503ec76698) | [Code](src/1f86db0f-e271-45df-8795-3e503ec76698/code.php) | [Settings](src/1f86db0f-e271-45df-8795-3e503ec76698/settings.json) | Super__1f86db0f_e271_45df_8795_3e503ec76698__Power
|
||||
- **final class Update** | [Details](src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3) | [Code](src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/code.php) | [Settings](src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/settings.json) | Super__e543c123_b1d9_4a0b_83b2_a9d371da5ff3__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Power\Generator](#vdm-joomla-componentbuilder-power-generator)
|
||||
|
||||
- **final class Bucket** | [Details](src/5d4278f0-7db2-498f-872a-c974bd8ce334) | [Code](src/5d4278f0-7db2-498f-872a-c974bd8ce334/code.php) | [Settings](src/5d4278f0-7db2-498f-872a-c974bd8ce334/settings.json) | Super__5d4278f0_7db2_498f_872a_c974bd8ce334__Power
|
||||
|
@ -418,8 +386,8 @@ This repository contains an index (see below) of all the approved powers within
|
|||
- **final class ServiceProviderBuilder** | [Details](src/8a2a3ee5-6ce2-4604-91e2-01f770228960) | [Code](src/8a2a3ee5-6ce2-4604-91e2-01f770228960/code.php) | [Settings](src/8a2a3ee5-6ce2-4604-91e2-01f770228960/settings.json) | Super__8a2a3ee5_6ce2_4604_91e2_01f770228960__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Power\Model](#vdm-joomla-componentbuilder-power-model)
|
||||
|
||||
- **class Load** | [Details](src/bb29a833-73f7-4283-9327-bc7e41f0723b) | [Code](src/bb29a833-73f7-4283-9327-bc7e41f0723b/code.php) | [Settings](src/bb29a833-73f7-4283-9327-bc7e41f0723b/settings.json) | Super__bb29a833_73f7_4283_9327_bc7e41f0723b__Power
|
||||
- **class Upsert** | [Details](src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5) | [Code](src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/code.php) | [Settings](src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/settings.json) | Super__7c1fb50f_8fb1_4627_8705_6fedf7182ca5__Power
|
||||
- **final class Load** | [Details](src/bb29a833-73f7-4283-9327-bc7e41f0723b) | [Code](src/bb29a833-73f7-4283-9327-bc7e41f0723b/code.php) | [Settings](src/bb29a833-73f7-4283-9327-bc7e41f0723b/settings.json) | Super__bb29a833_73f7_4283_9327_bc7e41f0723b__Power
|
||||
- **final class Upsert** | [Details](src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5) | [Code](src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/code.php) | [Settings](src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/settings.json) | Super__7c1fb50f_8fb1_4627_8705_6fedf7182ca5__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Power\Service](#vdm-joomla-componentbuilder-power-service)
|
||||
|
||||
- **class Database** | [Details](src/7243aaf6-b76c-4391-8698-50abbfc98fbe) | [Code](src/7243aaf6-b76c-4391-8698-50abbfc98fbe/code.php) | [Settings](src/7243aaf6-b76c-4391-8698-50abbfc98fbe/settings.json) | Super__7243aaf6_b76c_4391_8698_50abbfc98fbe__Power
|
||||
|
@ -489,10 +457,6 @@ This repository contains an index (see below) of all the approved powers within
|
|||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Model](#vdm-joomla-componentbuilder-compiler-interfaces-model)
|
||||
|
||||
- **interface CustomtabsInterface** | [Details](src/fcf42c53-0967-4c87-9699-a4d86adfdadf) | [Code](src/fcf42c53-0967-4c87-9699-a4d86adfdadf/code.php) | [Settings](src/fcf42c53-0967-4c87-9699-a4d86adfdadf/settings.json) | Super__fcf42c53_0967_4c87_9699_a4d86adfdadf__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Power](#vdm-joomla-componentbuilder-compiler-interfaces-power)
|
||||
|
||||
- **interface ExtractorInterface** | [Details](src/c159425c-51f9-4a15-af99-f2d0c6d7aae8) | [Code](src/c159425c-51f9-4a15-af99-f2d0c6d7aae8/code.php) | [Settings](src/c159425c-51f9-4a15-af99-f2d0c6d7aae8/settings.json) | Super__c159425c_51f9_4a15_af99_f2d0c6d7aae8__Power
|
||||
- **interface InjectorInterface** | [Details](src/e923311a-4058-4e81-9f67-5956fd0c627c) | [Code](src/e923311a-4058-4e81-9f67-5956fd0c627c/code.php) | [Settings](src/e923311a-4058-4e81-9f67-5956fd0c627c/settings.json) | Super__e923311a_4058_4e81_9f67_5956fd0c627c__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaFive](#vdm-joomla-componentbuilder-compiler-model-joomlafive)
|
||||
|
||||
- **final class Customtabs** | [Details](src/92cc3144-1d3d-45b2-b49f-c7d356950033) | [Code](src/92cc3144-1d3d-45b2-b49f-c7d356950033/code.php) | [Settings](src/92cc3144-1d3d-45b2-b49f-c7d356950033/settings.json) | Super__92cc3144_1d3d_45b2_b49f_c7d356950033__Power
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,8 +18,8 @@ use Joomla\CMS\Filesystem\Folder;
|
|||
use Joomla\CMS\Application\CMSApplication;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Version;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui;
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace VDM\Joomla\Componentbuilder\Power\Service;
|
|||
use Joomla\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use VDM\Joomla\Componentbuilder\Power\Config;
|
||||
use VastDevelopmentMethod\Joomla\Componentbuilder\Table;
|
||||
use VDM\Joomla\Componentbuilder\Table;
|
||||
use VDM\Joomla\Componentbuilder\Power\Grep;
|
||||
use VDM\Joomla\Componentbuilder\Power\Super as Superpower;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Power\Parser;
|
||||
|
|
|
@ -14,8 +14,8 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Model;
|
|||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\Component\Helper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\Component\Helper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -21,9 +21,9 @@ 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\Placeholder;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface as Event;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ObjectHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\ObjectHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,10 +14,10 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Customcode\Extractor;
|
|||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Filesystem\Folder;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\JsonHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\GetHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\String\ClassfunctionHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\JsonHelper;
|
||||
use VDM\Joomla\Utilities\GetHelper;
|
||||
use VDM\Joomla\Utilities\String\ClassfunctionHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
|
||||
|
|
|
@ -25,8 +25,8 @@ use VDM\Joomla\Componentbuilder\Compiler\Creator\Layout;
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Creator\Fieldsetinterface;
|
||||
|
||||
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# final class Load (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\JoomlaPower\Model**
|
||||
> extends: **ExtendingLoad**
|
||||
```uml
|
||||
@startuml
|
||||
class Load << (F,LightGreen) >> #RoyalBlue {
|
||||
# getTable() : string
|
||||
}
|
||||
|
||||
note right of Load::getTable
|
||||
Get the current active table
|
||||
|
||||
since: 3.2.0
|
||||
return: string
|
||||
end note
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
||||
---
|
||||
```
|
||||
██╗ ██████╗██████╗
|
||||
██║██╔════╝██╔══██╗
|
||||
██║██║ ██████╔╝
|
||||
██ ██║██║ ██╔══██╗
|
||||
╚█████╔╝╚██████╗██████╔╝
|
||||
╚════╝ ╚═════╝╚═════╝
|
||||
```
|
||||
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
<?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\JoomlaPower\Model;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\ModelInterface;
|
||||
use VDM\Joomla\Componentbuilder\Power\Model\Load as ExtendingLoad;
|
||||
|
||||
|
||||
/**
|
||||
* Joomla Power Model Load
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class Load extends ExtendingLoad implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* Get the current active table
|
||||
*
|
||||
* @return string
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getTable(): string
|
||||
{
|
||||
return 'joomla_power';
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
/**
|
||||
* Get the current active table
|
||||
*
|
||||
* @return string
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getTable(): string
|
||||
{
|
||||
return 'joomla_power';
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"add_head": "0",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "bb29a833-73f7-4283-9327-bc7e41f0723b",
|
||||
"guid": "05744dd3-4030-4cf8-8dda-a93ab809b473",
|
||||
"implements": [
|
||||
"8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff"
|
||||
],
|
||||
"load_selection": null,
|
||||
"name": "Load",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.JoomlaPower.Model.Load",
|
||||
"type": "final class",
|
||||
"use_selection": null,
|
||||
"namespace": "VDM\\Joomla\\Componentbuilder.JoomlaPower.Model.Load",
|
||||
"description": "Joomla Power Model Load\r\n\r\n@since 3.2.0",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "",
|
||||
"composer": ""
|
||||
}
|
|
@ -21,8 +21,8 @@ use VDM\Joomla\Componentbuilder\Compiler\Customcode;
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Dynamicget;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\JsonHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\JsonHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service;
|
|||
|
||||
use Joomla\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use VastDevelopmentMethod\Joomla\Componentbuilder\Server\Model\Load as ServerLoad;
|
||||
use VDM\Joomla\Componentbuilder\Server\Model\Load as ServerLoad;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Joomlaplugins;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Joomlamodules;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Historycomponent;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
||||
|
|
|
@ -26,10 +26,10 @@ use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\TemplateData;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ObjectHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\FileHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\ObjectHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\FileHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry\Traits\ToString;
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\ToString;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,115 +0,0 @@
|
|||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# class Config (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\JoomlaPower**
|
||||
> extends: **BaseConfig**
|
||||
```uml
|
||||
@startuml
|
||||
class Config #Gold {
|
||||
# JoomlaRegistry $config
|
||||
+ __construct(?Input $input = null, ?JoomlaRegistry $params = null, ...)
|
||||
# getGiteatoken() : ?string
|
||||
# getAddcustomgiteaurl() : int
|
||||
# getCustomgiteaurl() : ?string
|
||||
# getCustomgiteatoken() : ?string
|
||||
# getJoomlapowerscoreorganisation() : string
|
||||
# getJoomlapowersinitrepos() : array
|
||||
# getTmppath() : string
|
||||
# getLocaljoomlapowersrepositorypath() : string
|
||||
# getApprovedjoomlapaths() : array
|
||||
}
|
||||
|
||||
note right of Config::__construct
|
||||
Constructor
|
||||
|
||||
since: 3.2.0
|
||||
|
||||
arguments:
|
||||
?Input $input = null
|
||||
?JoomlaRegistry $params = null
|
||||
?JoomlaRegistry $config = null
|
||||
end note
|
||||
|
||||
note left of Config::getGiteatoken
|
||||
get Gitea Access Token
|
||||
|
||||
since: 3.2.0
|
||||
return: ?string
|
||||
end note
|
||||
|
||||
note right of Config::getAddcustomgiteaurl
|
||||
get Add Custom Gitea URL
|
||||
|
||||
since: 3.2.0
|
||||
return: int
|
||||
end note
|
||||
|
||||
note left of Config::getCustomgiteaurl
|
||||
get Custom Gitea URL
|
||||
|
||||
since: 3.2.0
|
||||
return: ?string
|
||||
end note
|
||||
|
||||
note right of Config::getCustomgiteatoken
|
||||
get Custom Gitea Access Token
|
||||
|
||||
since: 3.2.0
|
||||
return: ?string
|
||||
end note
|
||||
|
||||
note left of Config::getJoomlapowerscoreorganisation
|
||||
Get super power core organisation
|
||||
|
||||
since: 3.2.0
|
||||
return: string
|
||||
end note
|
||||
|
||||
note right of Config::getJoomlapowersinitrepos
|
||||
Get Joomla power init repos
|
||||
|
||||
since: 3.2.0
|
||||
return: array
|
||||
end note
|
||||
|
||||
note left of Config::getTmppath
|
||||
get temporary path
|
||||
|
||||
since: 3.2.0
|
||||
return: string
|
||||
end note
|
||||
|
||||
note right of Config::getLocaljoomlapowersrepositorypath
|
||||
Get local joomla super powers repository path
|
||||
|
||||
since: 3.2.0
|
||||
return: string
|
||||
end note
|
||||
|
||||
note left of Config::getApprovedjoomlapaths
|
||||
Get joomla power approved paths
|
||||
|
||||
since: 3.2.0
|
||||
return: array
|
||||
end note
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
||||
---
|
||||
```
|
||||
██╗ ██████╗██████╗
|
||||
██║██╔════╝██╔══██╗
|
||||
██║██║ ██████╔╝
|
||||
██ ██║██║ ██╔══██╗
|
||||
╚█████╔╝╚██████╗██████╔╝
|
||||
╚════╝ ╚═════╝╚═════╝
|
||||
```
|
||||
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
|
|
@ -1,182 +0,0 @@
|
|||
<?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\JoomlaPower;
|
||||
|
||||
|
||||
use Joomla\Registry\Registry as JoomlaRegistry;
|
||||
use Joomla\CMS\Factory as JoomlaFactory;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\GetHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Componentbuilder\Abstraction\BaseConfig;
|
||||
|
||||
|
||||
/**
|
||||
* Compiler Configurations
|
||||
*
|
||||
* All these functions are accessed via the direct name without the get:
|
||||
* example: $this->component_code_name calls: $this->getComponentcodename()
|
||||
*
|
||||
* All values once called are cached, yet can be updated directly:
|
||||
* example: $this->component_code_name = 'new_code_name'; // be warned!
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
class Config extends BaseConfig
|
||||
{
|
||||
/**
|
||||
* The Global Joomla Configuration
|
||||
*
|
||||
* @var JoomlaRegistry
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected JoomlaRegistry $config;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Input|null $input Input
|
||||
* @param Registry|null $params The component parameters
|
||||
* @param Registry|null $config The Joomla configuration
|
||||
*
|
||||
* @throws \Exception
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?Input $input = null, ?JoomlaRegistry $params = null, ?JoomlaRegistry $config = null)
|
||||
{
|
||||
parent::__construct($input, $params);
|
||||
|
||||
$this->config = $config ?: JoomlaFactory::getConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
* get Gitea Access Token
|
||||
*
|
||||
* @return string the access token
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getGiteatoken(): ?string
|
||||
{
|
||||
return $this->custom_gitea_token ?? $this->params->get('gitea_token');
|
||||
}
|
||||
|
||||
/**
|
||||
* get Add Custom Gitea URL
|
||||
*
|
||||
* @return int the add switch
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getAddcustomgiteaurl(): int
|
||||
{
|
||||
return $this->params->get('add_custom_gitea_url', 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* get Custom Gitea URL
|
||||
*
|
||||
* @return string the custom gitea url
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getCustomgiteaurl(): ?string
|
||||
{
|
||||
if ($this->add_custom_gitea_url == 2)
|
||||
{
|
||||
return $this->params->get('custom_gitea_url');
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* get Custom Gitea Access Token
|
||||
*
|
||||
* @return string the custom access token
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getCustomgiteatoken(): ?string
|
||||
{
|
||||
if ($this->add_custom_gitea_url == 2)
|
||||
{
|
||||
return $this->params->get('custom_gitea_token');
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get super power core organisation
|
||||
*
|
||||
* @return string The super power core organisation
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getJoomlapowerscoreorganisation(): string
|
||||
{
|
||||
// the VDM default organisation is [joomla]
|
||||
$organisation = 'joomla';
|
||||
|
||||
return $this->params->get('joomla_powers_core_organisation', $organisation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Joomla power init repos
|
||||
*
|
||||
* @return array The init repositories on Gitea
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getJoomlapowersinitrepos(): array
|
||||
{
|
||||
// some defaults repos we need by JCB
|
||||
$repos = [];
|
||||
$repos[$this->joomla_powers_core_organisation . '.joomla-powers'] = (object) ['owner' => $this->joomla_powers_core_organisation, 'repo' => 'joomla-powers', 'branch' => 'master'];
|
||||
|
||||
return $repos;
|
||||
}
|
||||
|
||||
/**
|
||||
* get temporary path
|
||||
*
|
||||
* @return string The temporary path
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getTmppath(): string
|
||||
{
|
||||
// get the temporary path
|
||||
return $this->config->get('tmp_path');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get local joomla super powers repository path
|
||||
*
|
||||
* @return string The path to the local repository
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getLocaljoomlapowersrepositorypath(): string
|
||||
{
|
||||
$default = $this->tmp_path . '/joomla_powers';
|
||||
|
||||
return $this->params->get('local_joomla_powers_repository_path', $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get joomla power approved paths
|
||||
*
|
||||
* @return array The paths to the repositories on Gitea
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getApprovedjoomlapaths(): array
|
||||
{
|
||||
// some defaults repos we need by JCB
|
||||
$approved = $this->joomla_powers_init_repos;
|
||||
|
||||
return array_values($approved);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,146 +0,0 @@
|
|||
/**
|
||||
* The Global Joomla Configuration
|
||||
*
|
||||
* @var JoomlaRegistry
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected JoomlaRegistry $config;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Input|null $input Input
|
||||
* @param Registry|null $params The component parameters
|
||||
* @param Registry|null $config The Joomla configuration
|
||||
*
|
||||
* @throws \Exception
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?Input $input = null, ?JoomlaRegistry $params = null, ?JoomlaRegistry $config = null)
|
||||
{
|
||||
parent::__construct($input, $params);
|
||||
|
||||
$this->config = $config ?: JoomlaFactory::getConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
* get Gitea Access Token
|
||||
*
|
||||
* @return string the access token
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getGiteatoken(): ?string
|
||||
{
|
||||
return $this->custom_gitea_token ?? $this->params->get('gitea_token');
|
||||
}
|
||||
|
||||
/**
|
||||
* get Add Custom Gitea URL
|
||||
*
|
||||
* @return int the add switch
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getAddcustomgiteaurl(): int
|
||||
{
|
||||
return $this->params->get('add_custom_gitea_url', 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* get Custom Gitea URL
|
||||
*
|
||||
* @return string the custom gitea url
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getCustomgiteaurl(): ?string
|
||||
{
|
||||
if ($this->add_custom_gitea_url == 2)
|
||||
{
|
||||
return $this->params->get('custom_gitea_url');
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* get Custom Gitea Access Token
|
||||
*
|
||||
* @return string the custom access token
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getCustomgiteatoken(): ?string
|
||||
{
|
||||
if ($this->add_custom_gitea_url == 2)
|
||||
{
|
||||
return $this->params->get('custom_gitea_token');
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get super power core organisation
|
||||
*
|
||||
* @return string The super power core organisation
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getJoomlapowerscoreorganisation(): string
|
||||
{
|
||||
// the VDM default organisation is [joomla]
|
||||
$organisation = 'joomla';
|
||||
|
||||
return $this->params->get('joomla_powers_core_organisation', $organisation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Joomla power init repos
|
||||
*
|
||||
* @return array The init repositories on Gitea
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getJoomlapowersinitrepos(): array
|
||||
{
|
||||
// some defaults repos we need by JCB
|
||||
$repos = [];
|
||||
$repos[$this->joomla_powers_core_organisation . '.joomla-powers'] = (object) ['owner' => $this->joomla_powers_core_organisation, 'repo' => 'joomla-powers', 'branch' => 'master'];
|
||||
|
||||
return $repos;
|
||||
}
|
||||
|
||||
/**
|
||||
* get temporary path
|
||||
*
|
||||
* @return string The temporary path
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getTmppath(): string
|
||||
{
|
||||
// get the temporary path
|
||||
return $this->config->get('tmp_path');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get local joomla super powers repository path
|
||||
*
|
||||
* @return string The path to the local repository
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getLocaljoomlapowersrepositorypath(): string
|
||||
{
|
||||
$default = $this->tmp_path . '/joomla_powers';
|
||||
|
||||
return $this->params->get('local_joomla_powers_repository_path', $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get joomla power approved paths
|
||||
*
|
||||
* @return array The paths to the repositories on Gitea
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getApprovedjoomlapaths(): array
|
||||
{
|
||||
// some defaults repos we need by JCB
|
||||
$approved = $this->joomla_powers_init_repos;
|
||||
|
||||
return array_values($approved);
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
{
|
||||
"add_head": "1",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "9769f3b2-17bf-4f20-b54b-3a4ebe572b36",
|
||||
"guid": "0b821bba-7503-4448-90e7-f3c1bd51dfd6",
|
||||
"implements": null,
|
||||
"load_selection": null,
|
||||
"name": "Config",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.JoomlaPower.Config",
|
||||
"type": "class",
|
||||
"use_selection": {
|
||||
"use_selection0": {
|
||||
"use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection1": {
|
||||
"use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef",
|
||||
"as": "default"
|
||||
}
|
||||
},
|
||||
"namespace": "VDM\\Joomla\\Componentbuilder.JoomlaPower.Config",
|
||||
"description": "Compiler Configurations\r\n\r\n\tAll these functions are accessed via the direct name without the get:\r\n\texample: $this->component_code_name calls: $this->getComponentcodename()\r\n\r\n\tAll values once called are cached, yet can be updated directly:\r\n\texample: $this->component_code_name = 'new_code_name'; \/\/ be warned!\r\n\r\n@since 3.2.0",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "use Joomla\\Registry\\Registry as JoomlaRegistry;\r\nuse Joomla\\CMS\\Factory as JoomlaFactory;",
|
||||
"composer": ""
|
||||
}
|
|
@ -17,7 +17,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\FootableScripts;
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Builder\GoogleChart;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\GetModule;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\UikitComp;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\Component\Helper;
|
||||
use VDM\Joomla\Utilities\Component\Helper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
```uml
|
||||
@startuml
|
||||
class DatabaseKeys << (F,LightGreen) >> #RoyalBlue {
|
||||
# bool $addAsArray
|
||||
# bool $uniqueArray
|
||||
}
|
||||
|
||||
@enduml
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -23,20 +23,5 @@ use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
|||
*/
|
||||
final class DatabaseKeys extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* Base switch to add values as string or array
|
||||
*
|
||||
* @var boolean
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected bool $addAsArray = true;
|
||||
|
||||
/**
|
||||
* Base switch to keep array values unique
|
||||
*
|
||||
* @var boolean
|
||||
* @since 3.2.2
|
||||
**/
|
||||
protected bool $uniqueArray = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +1 @@
|
|||
/**
|
||||
* Base switch to add values as string or array
|
||||
*
|
||||
* @var boolean
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected bool $addAsArray = true;
|
||||
|
||||
/**
|
||||
* Base switch to keep array values unique
|
||||
*
|
||||
* @var boolean
|
||||
* @since 3.2.2
|
||||
**/
|
||||
protected bool $uniqueArray = true;
|
||||
###CODEPOWER###
|
|
@ -12,8 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Model;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Utilities\JsonHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\JsonHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -39,18 +39,7 @@ class Permissions
|
|||
|
||||
if (ArrayHelper::check($item->addpermissions))
|
||||
{
|
||||
if (isset($item->addpermissions["action"]) && is_array($item->addpermissions["action"])
|
||||
&& isset($item->addpermissions["implementation"]) && is_array($item->addpermissions["implementation"]))
|
||||
{
|
||||
foreach ($item->addpermissions["action"] as $k => $action)
|
||||
{
|
||||
$item->permissions[] = ['action' => $action, 'implementation' => $item->addpermissions["implementation"][$k]];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$item->permissions = array_values($item->addpermissions);
|
||||
}
|
||||
$item->permissions = array_values($item->addpermissions);
|
||||
}
|
||||
|
||||
unset($item->addpermissions);
|
||||
|
|
|
@ -14,18 +14,7 @@
|
|||
|
||||
if (ArrayHelper::check($item->addpermissions))
|
||||
{
|
||||
if (isset($item->addpermissions["action"]) && is_array($item->addpermissions["action"])
|
||||
&& isset($item->addpermissions["implementation"]) && is_array($item->addpermissions["implementation"]))
|
||||
{
|
||||
foreach ($item->addpermissions["action"] as $k => $action)
|
||||
{
|
||||
$item->permissions[] = ['action' => $action, 'implementation' => $item->addpermissions["implementation"][$k]];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$item->permissions = array_values($item->addpermissions);
|
||||
}
|
||||
$item->permissions = array_values($item->addpermissions);
|
||||
}
|
||||
|
||||
unset($item->addpermissions);
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry\Traits\Count;
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\Count;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,7 +19,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\Contributors;
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsets;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionsParams;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield as Customfield;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterConstructorDefault as Def
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterConstructorManual as ManualConstructor;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterMethodsDefault as DefaultMethods;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterMethodsManual as ManualMethods;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,8 +13,8 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Field;
|
|||
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\GetHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\GetHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Model;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Utilities\JsonHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\JsonHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,9 +26,9 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionViews;
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionFields;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionComponent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\CustomButtonPermissions;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\MathHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\MathHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -460,7 +460,7 @@ final class AccessSections
|
|||
}
|
||||
}
|
||||
|
||||
$this->permission->set(
|
||||
$this->permission ->set(
|
||||
$custom_admin_view, $customAdminCode, $customAdminCode,
|
||||
$menuControllers, 'customAdmin'
|
||||
);
|
||||
|
@ -661,8 +661,7 @@ final class AccessSections
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->permission->set(
|
||||
$this->permission ->set(
|
||||
$view, $nameView, $nameViews, $menuControllers
|
||||
);
|
||||
}
|
||||
|
|
|
@ -420,7 +420,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
$this->permission->set(
|
||||
$this->permission ->set(
|
||||
$custom_admin_view, $customAdminCode, $customAdminCode,
|
||||
$menuControllers, 'customAdmin'
|
||||
);
|
||||
|
@ -621,8 +621,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->permission->set(
|
||||
$this->permission ->set(
|
||||
$view, $nameView, $nameViews, $menuControllers
|
||||
);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFive;
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
|
|
|
@ -16,9 +16,9 @@ use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Updatesql;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ObjectHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\JsonHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\ObjectHelper;
|
||||
use VDM\Joomla\Utilities\JsonHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry\Traits\InArray;
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\InArray;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry\Traits\ToString;
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\ToString;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour;
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
|
|
|
@ -15,11 +15,11 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Customcode;
|
|||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Application\CMSApplication;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\GetHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\FileHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\String\FieldHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\GetHelper;
|
||||
use VDM\Joomla\Utilities\FileHelper;
|
||||
use VDM\Joomla\Utilities\String\FieldHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Placeholder\Reverse;
|
||||
|
|
|
@ -17,10 +17,10 @@ use Joomla\CMS\User\User;
|
|||
use Joomla\CMS\Application\CMSApplication;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Filesystem\Path;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\GetHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\FileHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\GetHelper;
|
||||
use VDM\Joomla\Utilities\FileHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode\ExternalInterface;
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Model;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\JsonHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\JsonHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,8 +13,8 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaThree;
|
|||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Extension\InstallInterface;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\GetScriptInterface;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Utilities;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Componentbuilder\Abstraction\BaseRegistry;
|
||||
use VDM\Joomla\Componentbuilder\Abstraction\BaseRegistry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,8 +22,8 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\Category;
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\Tags;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface;
|
||||
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths;
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\File;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Files;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,14 +6,13 @@
|
|||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# class Load (Details)
|
||||
# final class Load (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Power\Database**
|
||||
```uml
|
||||
@startuml
|
||||
class Load #Gold {
|
||||
class Load << (F,LightGreen) >> #RoyalBlue {
|
||||
# Model $model
|
||||
# Database $load
|
||||
# string $table
|
||||
+ __construct(Model $model, Database $load)
|
||||
+ value(array $keys, string $field) : mixed
|
||||
+ item(array $keys) : ?object
|
||||
|
|
|
@ -12,9 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Power\Database;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\ModelInterface as Model;
|
||||
use VastDevelopmentMethod\Joomla\Database\Load as Database;
|
||||
use VDM\Joomla\Componentbuilder\Power\Database\LoadInterface;
|
||||
use VDM\Joomla\Componentbuilder\Power\Model\Load as Model;
|
||||
use VDM\Joomla\Database\Load as Database;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -22,7 +21,7 @@ use VDM\Joomla\Componentbuilder\Power\Database\LoadInterface;
|
|||
*
|
||||
* @since 2.0.1
|
||||
*/
|
||||
class Load implements LoadInterface
|
||||
final class Load
|
||||
{
|
||||
/**
|
||||
* Model Load
|
||||
|
@ -40,14 +39,6 @@ class Load implements LoadInterface
|
|||
*/
|
||||
protected Database $load;
|
||||
|
||||
/**
|
||||
* Table Name
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2.1
|
||||
*/
|
||||
protected string $table = 'power';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
@ -83,11 +74,11 @@ class Load implements LoadInterface
|
|||
return $this->model->value(
|
||||
$this->load->value(
|
||||
["a.{$field}" => $field],
|
||||
['a' => $this->table],
|
||||
['a' => 'power'],
|
||||
$this->prefix($keys)
|
||||
),
|
||||
$field,
|
||||
$this->table
|
||||
'power'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -110,10 +101,10 @@ class Load implements LoadInterface
|
|||
return $this->model->item(
|
||||
$this->load->item(
|
||||
['all' => 'a.*'],
|
||||
['a' => $this->table],
|
||||
['a' => 'power'],
|
||||
$this->prefix($keys)
|
||||
),
|
||||
$this->table
|
||||
'power'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -139,9 +130,9 @@ class Load implements LoadInterface
|
|||
{
|
||||
return $this->model->items(
|
||||
$this->load->items(
|
||||
['all' => 'a.*'], ['a' => $this->table], $this->prefix($keys)
|
||||
['all' => 'a.*'], ['a' => 'power'], $this->prefix($keys)
|
||||
),
|
||||
$this->table
|
||||
'power'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,14 +14,6 @@
|
|||
*/
|
||||
protected Database $load;
|
||||
|
||||
/**
|
||||
* Table Name
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2.1
|
||||
*/
|
||||
protected string $table = 'power';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
@ -57,11 +49,11 @@
|
|||
return $this->model->value(
|
||||
$this->load->value(
|
||||
["a.{$field}" => $field],
|
||||
['a' => $this->table],
|
||||
['a' => 'power'],
|
||||
$this->prefix($keys)
|
||||
),
|
||||
$field,
|
||||
$this->table
|
||||
'power'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -84,10 +76,10 @@
|
|||
return $this->model->item(
|
||||
$this->load->item(
|
||||
['all' => 'a.*'],
|
||||
['a' => $this->table],
|
||||
['a' => 'power'],
|
||||
$this->prefix($keys)
|
||||
),
|
||||
$this->table
|
||||
'power'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -113,9 +105,9 @@
|
|||
{
|
||||
return $this->model->items(
|
||||
$this->load->items(
|
||||
['all' => 'a.*'], ['a' => $this->table], $this->prefix($keys)
|
||||
['all' => 'a.*'], ['a' => 'power'], $this->prefix($keys)
|
||||
),
|
||||
$this->table
|
||||
'power'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,17 +3,15 @@
|
|||
"add_licensing_template": "2",
|
||||
"extends": "0",
|
||||
"guid": "1f86db0f-e271-45df-8795-3e503ec76698",
|
||||
"implements": [
|
||||
"99786f53-64b7-4d52-95b0-5306e7386c3f"
|
||||
],
|
||||
"implements": null,
|
||||
"load_selection": null,
|
||||
"name": "Load",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Power.Database.Load",
|
||||
"type": "class",
|
||||
"type": "final class",
|
||||
"use_selection": {
|
||||
"use_selection0": {
|
||||
"use": "8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff",
|
||||
"use": "bb29a833-73f7-4283-9327-bc7e41f0723b",
|
||||
"as": "Model"
|
||||
},
|
||||
"use_selection1": {
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,9 +16,9 @@ use VDM\Joomla\Componentbuilder\Compiler\Config;
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Language;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield as Customfield;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsets;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\GetHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\GetHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
|
||||
|
||||
|
|
|
@ -28,13 +28,13 @@ use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsGooglechart;
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsEmailHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsEncryption;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsCustomfield;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\GetHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\GetHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\MathHelper;
|
||||
use VDM\Joomla\Utilities\MathHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,24 +12,22 @@
|
|||
@startuml
|
||||
class FileInjector << (F,LightGreen) >> #RoyalBlue {
|
||||
# Power $power
|
||||
# JoomlaPower $joomla
|
||||
+ __construct(Power $power, JoomlaPower $joomla)
|
||||
+ __construct(Power $power)
|
||||
+ add(string $file, string $data, ...) : void
|
||||
- openFileWithLock(string $file) : resource
|
||||
- processFile(resource $actual_file, resource $temp_file, ...) : void
|
||||
- truncateIfNeeded(resource $actual_file, string $data, ...) : void
|
||||
- copyRemainingData(resource $actual_file, resource $temp_file, ...) : void
|
||||
- injectSuperPowers(resource $actual_file) : void
|
||||
- injectJoomlaPowers(resource $actual_file) : void
|
||||
}
|
||||
|
||||
note right of FileInjector::__construct
|
||||
Constructor.
|
||||
|
||||
since: 3.2.1
|
||||
since: 3.2.0
|
||||
end note
|
||||
|
||||
note left of FileInjector::add
|
||||
note right of FileInjector::add
|
||||
Inserts or replaces data in a file at a specific position.
|
||||
|
||||
since: 3.2.0
|
||||
|
@ -49,7 +47,7 @@ note right of FileInjector::openFileWithLock
|
|||
return: resource
|
||||
end note
|
||||
|
||||
note left of FileInjector::processFile
|
||||
note right of FileInjector::processFile
|
||||
Processes the file for data insertion and copying the remaining data.
|
||||
|
||||
since: 3.2.0
|
||||
|
@ -75,7 +73,7 @@ note right of FileInjector::truncateIfNeeded
|
|||
int $position
|
||||
end note
|
||||
|
||||
note left of FileInjector::copyRemainingData
|
||||
note right of FileInjector::copyRemainingData
|
||||
Copies the remaining data from the temporary stream to the actual file.
|
||||
|
||||
since: 3.2.0
|
||||
|
@ -94,13 +92,6 @@ note right of FileInjector::injectSuperPowers
|
|||
since: 3.2.0
|
||||
return: void
|
||||
end note
|
||||
|
||||
note left of FileInjector::injectJoomlaPowers
|
||||
Injects Joomla powers into the file content, if found, and updates the file.
|
||||
|
||||
since: 3.2.1
|
||||
return: void
|
||||
end note
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
|
|
@ -13,8 +13,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Utilities;
|
|||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Power\Injector as Power;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\JoomlaPower\Injector as JoomlaPower;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\MathHelper;
|
||||
use VDM\Joomla\Utilities\MathHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -34,41 +33,23 @@ final class FileInjector
|
|||
protected Power $power;
|
||||
|
||||
/**
|
||||
* The Joomla Injector Class.
|
||||
*
|
||||
* @var JoomlaPower
|
||||
* @since 3.2.1
|
||||
*/
|
||||
protected JoomlaPower $joomla;
|
||||
|
||||
/**
|
||||
* The power pattern to get the powers
|
||||
* The pattern to get the powers
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected string $powerPattern = '/Super_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/';
|
||||
|
||||
/**
|
||||
* The Joomla power pattern to get the powers
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected string $joomlaPattern = '/Joomla_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/';
|
||||
protected string $pattern = '/Super_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Power $power The Injector Class.
|
||||
* @param JoomlaPower $joomla The Joomla Injector Class.
|
||||
* @param Power $power The Injector Class.
|
||||
*
|
||||
* @since 3.2.1
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Power $power, JoomlaPower $joomla)
|
||||
public function __construct(Power $power)
|
||||
{
|
||||
$this->power = $power;
|
||||
$this->joomla = $joomla;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -91,9 +72,7 @@ final class FileInjector
|
|||
throw new \InvalidArgumentException('Position cannot be negative.');
|
||||
}
|
||||
|
||||
$found_joomla_powers = preg_match($this->joomlaPattern, $data);
|
||||
$found_super_powers = preg_match($this->powerPattern, $data);
|
||||
|
||||
$found_super_powers = preg_match($this->pattern, $data);
|
||||
$actual_file = $this->openFileWithLock($file);
|
||||
|
||||
try
|
||||
|
@ -106,11 +85,6 @@ final class FileInjector
|
|||
|
||||
$this->processFile($actual_file, $temp_file, $data, $position, $replace);
|
||||
|
||||
if ($found_joomla_powers)
|
||||
{
|
||||
$this->injectJoomlaPowers($actual_file);
|
||||
}
|
||||
|
||||
if ($found_super_powers)
|
||||
{
|
||||
$this->injectSuperPowers($actual_file);
|
||||
|
@ -233,28 +207,6 @@ final class FileInjector
|
|||
ftruncate($actual_file, 0);
|
||||
rewind($actual_file);
|
||||
|
||||
fwrite($actual_file, $power_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Injects Joomla powers into the file content, if found, and updates the file.
|
||||
*
|
||||
* @param resource $actual_file The file handle of the actual file.
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function injectJoomlaPowers($actual_file): void
|
||||
{
|
||||
rewind($actual_file);
|
||||
|
||||
$power_data = $this->joomla->power(
|
||||
stream_get_contents($actual_file)
|
||||
);
|
||||
|
||||
ftruncate($actual_file, 0);
|
||||
rewind($actual_file);
|
||||
|
||||
fwrite($actual_file, $power_data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,41 +7,23 @@
|
|||
protected Power $power;
|
||||
|
||||
/**
|
||||
* The Joomla Injector Class.
|
||||
*
|
||||
* @var JoomlaPower
|
||||
* @since 3.2.1
|
||||
*/
|
||||
protected JoomlaPower $joomla;
|
||||
|
||||
/**
|
||||
* The power pattern to get the powers
|
||||
* The pattern to get the powers
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected string $powerPattern = '/Super_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/';
|
||||
|
||||
/**
|
||||
* The Joomla power pattern to get the powers
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected string $joomlaPattern = '/Joomla_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/';
|
||||
protected string $pattern = '/Super_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Power $power The Injector Class.
|
||||
* @param JoomlaPower $joomla The Joomla Injector Class.
|
||||
* @param Power $power The Injector Class.
|
||||
*
|
||||
* @since 3.2.1
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Power $power, JoomlaPower $joomla)
|
||||
public function __construct(Power $power)
|
||||
{
|
||||
$this->power = $power;
|
||||
$this->joomla = $joomla;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -64,9 +46,7 @@
|
|||
throw new \InvalidArgumentException('Position cannot be negative.');
|
||||
}
|
||||
|
||||
$found_joomla_powers = preg_match($this->joomlaPattern, $data);
|
||||
$found_super_powers = preg_match($this->powerPattern, $data);
|
||||
|
||||
$found_super_powers = preg_match($this->pattern, $data);
|
||||
$actual_file = $this->openFileWithLock($file);
|
||||
|
||||
try
|
||||
|
@ -79,11 +59,6 @@
|
|||
|
||||
$this->processFile($actual_file, $temp_file, $data, $position, $replace);
|
||||
|
||||
if ($found_joomla_powers)
|
||||
{
|
||||
$this->injectJoomlaPowers($actual_file);
|
||||
}
|
||||
|
||||
if ($found_super_powers)
|
||||
{
|
||||
$this->injectSuperPowers($actual_file);
|
||||
|
@ -206,27 +181,5 @@
|
|||
ftruncate($actual_file, 0);
|
||||
rewind($actual_file);
|
||||
|
||||
fwrite($actual_file, $power_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Injects Joomla powers into the file content, if found, and updates the file.
|
||||
*
|
||||
* @param resource $actual_file The file handle of the actual file.
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function injectJoomlaPowers($actual_file): void
|
||||
{
|
||||
rewind($actual_file);
|
||||
|
||||
$power_data = $this->joomla->power(
|
||||
stream_get_contents($actual_file)
|
||||
);
|
||||
|
||||
ftruncate($actual_file, 0);
|
||||
rewind($actual_file);
|
||||
|
||||
fwrite($actual_file, $power_data);
|
||||
}
|
|
@ -15,10 +15,6 @@
|
|||
"as": "Power"
|
||||
},
|
||||
"use_selection1": {
|
||||
"use": "a6052fe9-0d2b-4b36-b3e7-03b47c483542",
|
||||
"as": "JoomlaPower"
|
||||
},
|
||||
"use_selection2": {
|
||||
"use": "152c8793-8b75-4715-996a-257b9f65451c",
|
||||
"as": "default"
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree;
|
|||
|
||||
|
||||
use Joomla\CMS\Filesystem\Folder;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreRuleInterface;
|
||||
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,8 +14,8 @@ namespace VDM\Joomla\Componentbuilder\Compiler\JoomlaFour;
|
|||
|
||||
use Joomla\CMS\Factory;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\JsonHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\JsonHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface;
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Model;
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree;
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -62,7 +62,7 @@ class Placeholder implements ServiceProviderInterface
|
|||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return Reverse
|
||||
* @return Worker
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function getPlaceholderReverse(Container $container): Reverse
|
||||
|
@ -72,8 +72,7 @@ class Placeholder implements ServiceProviderInterface
|
|||
$container->get('Placeholder'),
|
||||
$container->get('Language'),
|
||||
$container->get('Language.Extractor'),
|
||||
$container->get('Power.Extractor'),
|
||||
$container->get('Joomla.Power.Extractor')
|
||||
$container->get('Power.Extractor')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return Reverse
|
||||
* @return Worker
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function getPlaceholderReverse(Container $container): Reverse
|
||||
|
@ -45,7 +45,6 @@
|
|||
$container->get('Placeholder'),
|
||||
$container->get('Language'),
|
||||
$container->get('Language.Extractor'),
|
||||
$container->get('Power.Extractor'),
|
||||
$container->get('Joomla.Power.Extractor')
|
||||
$container->get('Power.Extractor')
|
||||
);
|
||||
}
|
|
@ -19,10 +19,9 @@ class Customcode #Gold {
|
|||
# Placeholder $placeholder
|
||||
# Extractor $extractor
|
||||
# Power $power
|
||||
# JoomlaPower $joomla
|
||||
# External $external
|
||||
# $db
|
||||
+ __construct(Config $config, Placeholder $placeholder, ...)
|
||||
+ __construct(?Config $config = null, ?Placeholder $placeholder = null, ...)
|
||||
+ update(string $string, int $debug) : string
|
||||
+ set(string $string, int $debug, ...) : string
|
||||
+ get(?array $ids = null, bool $setLang = true, ...) : bool
|
||||
|
@ -37,12 +36,11 @@ note right of Customcode::__construct
|
|||
since: 3.2.0
|
||||
|
||||
arguments:
|
||||
Config $config
|
||||
Placeholder $placeholder
|
||||
Extractor $extractor
|
||||
Power $power
|
||||
JoomlaPower $joomla
|
||||
External $external
|
||||
?Config $config = null
|
||||
?Placeholder $placeholder = null
|
||||
?Extractor $extractor = null
|
||||
?Power $power = null
|
||||
?External $external = null
|
||||
end note
|
||||
|
||||
note right of Customcode::update
|
||||
|
|
|
@ -18,12 +18,11 @@ use VDM\Joomla\Componentbuilder\Compiler\Config;
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Language\Extractor;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Power\Extractor as Power;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\JoomlaPower\Extractor as JoomlaPower;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\External;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\GetHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\GetHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\CustomcodeInterface;
|
||||
|
||||
|
||||
|
@ -112,14 +111,6 @@ class Customcode implements CustomcodeInterface
|
|||
**/
|
||||
protected Power $power;
|
||||
|
||||
/**
|
||||
* Joomla Power Extractor
|
||||
*
|
||||
* @var Power
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected JoomlaPower $joomla;
|
||||
|
||||
/**
|
||||
* Compiler Custom Code External
|
||||
*
|
||||
|
@ -138,25 +129,23 @@ class Customcode implements CustomcodeInterface
|
|||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The compiler config object.
|
||||
* @param Placeholder $placeholder The compiler placeholder object.
|
||||
* @param Extractor $extractor The compiler language extractor object.
|
||||
* @param Power $power The compiler power extractor object.
|
||||
* @param JoomlaPower $joomla The compiler joomla power extractor object.
|
||||
* @param External $external The compiler external custom code object.
|
||||
* @param \JDatabaseDriver $db The Database Driver object.
|
||||
* @param Config|null $config The compiler config object.
|
||||
* @param Placeholder|null $placeholder The compiler placeholder object.
|
||||
* @param Extractor|null $extractor The compiler language extractor object.
|
||||
* @param Power|null $power The compiler power extractor object.
|
||||
* @param External|null $external The compiler external custom code object.
|
||||
* @param \JDatabaseDriver $db The Database Driver object.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Placeholder $placeholder,
|
||||
Extractor $extractor, Power $power, JoomlaPower $joomla, External $external)
|
||||
public function __construct(?Config $config = null, ?Placeholder $placeholder = null,
|
||||
?Extractor $extractor = null, ?Power $power = null, ?External $external = null)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->placeholder = $placeholder;
|
||||
$this->extractor = $extractor;
|
||||
$this->power = $power;
|
||||
$this->joomla = $joomla;
|
||||
$this->external = $external;
|
||||
$this->config = $config ?: Compiler::_('Config');
|
||||
$this->placeholder = $placeholder ?: Compiler::_('Placeholder');
|
||||
$this->extractor = $extractor ?: Compiler::_('Language.Extractor');
|
||||
$this->power = $power ?: Compiler::_('Power.Extractor');
|
||||
$this->external = $external ?: Compiler::_('Customcode.External');
|
||||
$this->db = Factory::getDbo();
|
||||
}
|
||||
|
||||
|
@ -181,9 +170,8 @@ class Customcode implements CustomcodeInterface
|
|||
)
|
||||
);
|
||||
|
||||
// extract any found powers
|
||||
// extract any found super powers
|
||||
$this->power->search($string);
|
||||
$this->joomla->search($string);
|
||||
}
|
||||
// if debug
|
||||
if ($debug)
|
||||
|
|
|
@ -76,14 +76,6 @@
|
|||
**/
|
||||
protected Power $power;
|
||||
|
||||
/**
|
||||
* Joomla Power Extractor
|
||||
*
|
||||
* @var Power
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected JoomlaPower $joomla;
|
||||
|
||||
/**
|
||||
* Compiler Custom Code External
|
||||
*
|
||||
|
@ -102,25 +94,23 @@
|
|||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The compiler config object.
|
||||
* @param Placeholder $placeholder The compiler placeholder object.
|
||||
* @param Extractor $extractor The compiler language extractor object.
|
||||
* @param Power $power The compiler power extractor object.
|
||||
* @param JoomlaPower $joomla The compiler joomla power extractor object.
|
||||
* @param External $external The compiler external custom code object.
|
||||
* @param \JDatabaseDriver $db The Database Driver object.
|
||||
* @param Config|null $config The compiler config object.
|
||||
* @param Placeholder|null $placeholder The compiler placeholder object.
|
||||
* @param Extractor|null $extractor The compiler language extractor object.
|
||||
* @param Power|null $power The compiler power extractor object.
|
||||
* @param External|null $external The compiler external custom code object.
|
||||
* @param \JDatabaseDriver $db The Database Driver object.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Placeholder $placeholder,
|
||||
Extractor $extractor, Power $power, JoomlaPower $joomla, External $external)
|
||||
public function __construct(?Config $config = null, ?Placeholder $placeholder = null,
|
||||
?Extractor $extractor = null, ?Power $power = null, ?External $external = null)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->placeholder = $placeholder;
|
||||
$this->extractor = $extractor;
|
||||
$this->power = $power;
|
||||
$this->joomla = $joomla;
|
||||
$this->external = $external;
|
||||
$this->config = $config ?: Compiler::_('Config');
|
||||
$this->placeholder = $placeholder ?: Compiler::_('Placeholder');
|
||||
$this->extractor = $extractor ?: Compiler::_('Language.Extractor');
|
||||
$this->power = $power ?: Compiler::_('Power.Extractor');
|
||||
$this->external = $external ?: Compiler::_('Customcode.External');
|
||||
$this->db = Factory::getDbo();
|
||||
}
|
||||
|
||||
|
@ -145,9 +135,8 @@
|
|||
)
|
||||
);
|
||||
|
||||
// extract any found powers
|
||||
// extract any found super powers
|
||||
$this->power->search($string);
|
||||
$this->joomla->search($string);
|
||||
}
|
||||
// if debug
|
||||
if ($debug)
|
||||
|
|
|
@ -12,47 +12,43 @@
|
|||
"system_name": "JCB.Compiler.Customcode",
|
||||
"type": "class",
|
||||
"use_selection": {
|
||||
"use_selection0": {
|
||||
"use_selection3": {
|
||||
"use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac",
|
||||
"as": "Compiler"
|
||||
},
|
||||
"use_selection1": {
|
||||
"use_selection4": {
|
||||
"use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection2": {
|
||||
"use_selection5": {
|
||||
"use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection3": {
|
||||
"use_selection6": {
|
||||
"use": "d33b9278-c409-4aec-a047-b72f56712391",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection4": {
|
||||
"use_selection7": {
|
||||
"use": "eeb03266-22fd-45bb-953a-961bb6be3a54",
|
||||
"as": "Power"
|
||||
},
|
||||
"use_selection5": {
|
||||
"use": "82505f3f-297f-4d75-a581-929ab3e93689",
|
||||
"as": "JoomlaPower"
|
||||
},
|
||||
"use_selection6": {
|
||||
"use_selection8": {
|
||||
"use": "1cef0266-99e2-40d8-919f-c2ce32226b0a",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection7": {
|
||||
"use_selection9": {
|
||||
"use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection8": {
|
||||
"use_selection1": {
|
||||
"use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection9": {
|
||||
"use_selection0": {
|
||||
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection10": {
|
||||
"use_selection2": {
|
||||
"use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc",
|
||||
"as": "default"
|
||||
}
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry\Traits\VarExport;
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\VarExport;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -25,11 +25,11 @@ use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths;
|
|||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Folder;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\File;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Files;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ObjectHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\JsonHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\FileHelper;
|
||||
use VDM\Joomla\Utilities\ObjectHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\JsonHelper;
|
||||
use VDM\Joomla\Utilities\FileHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
||||
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Model;
|
|||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry\Traits\InArray;
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\InArray;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\Registryinterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Registry;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Model;
|
|||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\MysqlTableSetting;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# final class Grep (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\JoomlaPower**
|
||||
> extends: **ExtendingGrep**
|
||||
```uml
|
||||
@startuml
|
||||
class Grep << (F,LightGreen) >> #RoyalBlue {
|
||||
# array $order
|
||||
# remoteIndex(object $path) : void
|
||||
- searchRemote(string $guid) : ?object
|
||||
- getRemote(object $path, string $guid) : ?object
|
||||
- loadRemoteFile(string $owner, string $repo, ...) : mixed
|
||||
}
|
||||
|
||||
note right of Grep::remoteIndex
|
||||
Load the remote repository index of powers
|
||||
|
||||
since: 3.2.0
|
||||
return: void
|
||||
end note
|
||||
|
||||
note right of Grep::searchRemote
|
||||
Search for a remote power
|
||||
|
||||
since: 3.2.0
|
||||
return: ?object
|
||||
end note
|
||||
|
||||
note right of Grep::getRemote
|
||||
Get a remote power
|
||||
|
||||
since: 3.2.0
|
||||
return: ?object
|
||||
end note
|
||||
|
||||
note right of Grep::loadRemoteFile
|
||||
Load the remote file
|
||||
|
||||
since: 3.2.0
|
||||
return: mixed
|
||||
|
||||
arguments:
|
||||
string $owner
|
||||
string $repo
|
||||
string $path
|
||||
?string $branch
|
||||
end note
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
||||
---
|
||||
```
|
||||
██╗ ██████╗██████╗
|
||||
██║██╔════╝██╔══██╗
|
||||
██║██║ ██████╔╝
|
||||
██ ██║██║ ██╔══██╗
|
||||
╚█████╔╝╚██████╗██████╔╝
|
||||
╚════╝ ╚═════╝╚═════╝
|
||||
```
|
||||
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
|
|
@ -1,165 +0,0 @@
|
|||
<?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\JoomlaPower;
|
||||
|
||||
|
||||
use Joomla\CMS\Language\Text;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\FileHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\JsonHelper;
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\GrepInterface;
|
||||
use VastDevelopmentMethod\Joomla\Abstraction\Grep as ExtendingGrep;
|
||||
|
||||
|
||||
/**
|
||||
* Global Resource Empowerment Platform
|
||||
*
|
||||
* The Grep feature will try to find your joomla power in the repositories listed in the global
|
||||
* Options of JCB in the super powers tab, and if it can't be found there will try the global core
|
||||
* Super powers of JCB. All searches are performed according the the [algorithm:cascading]
|
||||
* See documentation for more details: https://git.vdm.dev/joomla/super-powers/wiki
|
||||
*
|
||||
* @since 3.2.1
|
||||
*/
|
||||
final class Grep extends ExtendingGrep implements GrepInterface
|
||||
{
|
||||
/**
|
||||
* Order of global search
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected array $order = ['remote'];
|
||||
|
||||
/**
|
||||
* Load the remote repository index of powers
|
||||
*
|
||||
* @param object $path The repository path details
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function remoteIndex(object &$path): void
|
||||
{
|
||||
if (isset($path->index))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$path->index = $this->contents->get($path->owner, $path->repo, 'joomla-powers.json', $path->branch);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
$this->app->enqueueMessage(
|
||||
Text::sprintf('COM_COMPONENTBUILDER_PSUPER_POWERB_REPOSITORY_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP', $this->contents->api(), $path->path, $e->getMessage()),
|
||||
'Error'
|
||||
);
|
||||
|
||||
$path->index = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for a remote power
|
||||
*
|
||||
* @param string $guid The global unique id of the power
|
||||
*
|
||||
* @return object|null
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function searchRemote(string $guid): ?object
|
||||
{
|
||||
// we can only search if we have paths
|
||||
if ($this->path && $this->paths)
|
||||
{
|
||||
foreach ($this->paths as $path)
|
||||
{
|
||||
// get local index
|
||||
$this->remoteIndex($path);
|
||||
|
||||
if (!empty($path->index) && isset($path->index->{$guid}))
|
||||
{
|
||||
return $this->getRemote($path, $guid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a remote power
|
||||
*
|
||||
* @param object $path The repository path details
|
||||
* @param string $guid The global unique id of the power
|
||||
*
|
||||
* @return object|null
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function getRemote(object $path, string $guid): ?object
|
||||
{
|
||||
if (empty($path->index->{$guid}->settings))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// get the settings
|
||||
if (($power = $this->loadRemoteFile($path->owner, $path->repo, $path->index->{$guid}->settings, $path->branch)) !== null &&
|
||||
isset($power->guid))
|
||||
{
|
||||
// set the git details in params
|
||||
$power->params = (object) [
|
||||
'git' => [
|
||||
'owner' => $path->owner,
|
||||
'repo' => $path->repo,
|
||||
'branch' => $path->branch
|
||||
]
|
||||
];
|
||||
|
||||
return $power;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the remote file
|
||||
*
|
||||
* @param string $owner The repository owner
|
||||
* @param string $repo The repository name
|
||||
* @param string $path The repository path to file
|
||||
* @param string|null $branch The repository branch name
|
||||
*
|
||||
* @return mixed
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function loadRemoteFile(string $owner, string $repo, string $path, ?string $branch)
|
||||
{
|
||||
try
|
||||
{
|
||||
$data = $this->contents->get($owner, $repo, $path, $branch);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
$this->app->enqueueMessage(
|
||||
Text::sprintf('COM_COMPONENTBUILDER_PFILE_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP', $this->contents->api(), $path, $e->getMessage()),
|
||||
'Error'
|
||||
);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,130 +0,0 @@
|
|||
/**
|
||||
* Order of global search
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected array $order = ['remote'];
|
||||
|
||||
/**
|
||||
* Load the remote repository index of powers
|
||||
*
|
||||
* @param object $path The repository path details
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function remoteIndex(object &$path): void
|
||||
{
|
||||
if (isset($path->index))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$path->index = $this->contents->get($path->owner, $path->repo, 'joomla-powers.json', $path->branch);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
$this->app->enqueueMessage(
|
||||
Text::sprintf('<p>Super Power</b> repository at <b>%s/%s</b> gave the following error!<br />%s</p>', $this->contents->api(), $path->path, $e->getMessage()),
|
||||
'Error'
|
||||
);
|
||||
|
||||
$path->index = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for a remote power
|
||||
*
|
||||
* @param string $guid The global unique id of the power
|
||||
*
|
||||
* @return object|null
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function searchRemote(string $guid): ?object
|
||||
{
|
||||
// we can only search if we have paths
|
||||
if ($this->path && $this->paths)
|
||||
{
|
||||
foreach ($this->paths as $path)
|
||||
{
|
||||
// get local index
|
||||
$this->remoteIndex($path);
|
||||
|
||||
if (!empty($path->index) && isset($path->index->{$guid}))
|
||||
{
|
||||
return $this->getRemote($path, $guid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a remote power
|
||||
*
|
||||
* @param object $path The repository path details
|
||||
* @param string $guid The global unique id of the power
|
||||
*
|
||||
* @return object|null
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function getRemote(object $path, string $guid): ?object
|
||||
{
|
||||
if (empty($path->index->{$guid}->settings))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// get the settings
|
||||
if (($power = $this->loadRemoteFile($path->owner, $path->repo, $path->index->{$guid}->settings, $path->branch)) !== null &&
|
||||
isset($power->guid))
|
||||
{
|
||||
// set the git details in params
|
||||
$power->params = (object) [
|
||||
'git' => [
|
||||
'owner' => $path->owner,
|
||||
'repo' => $path->repo,
|
||||
'branch' => $path->branch
|
||||
]
|
||||
];
|
||||
|
||||
return $power;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the remote file
|
||||
*
|
||||
* @param string $owner The repository owner
|
||||
* @param string $repo The repository name
|
||||
* @param string $path The repository path to file
|
||||
* @param string|null $branch The repository branch name
|
||||
*
|
||||
* @return mixed
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function loadRemoteFile(string $owner, string $repo, string $path, ?string $branch)
|
||||
{
|
||||
try
|
||||
{
|
||||
$data = $this->contents->get($owner, $repo, $path, $branch);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
$this->app->enqueueMessage(
|
||||
Text::sprintf('<p>File at <b>%s/%s</b> gave the following error!<br />%s</p>', $this->contents->api(), $path, $e->getMessage()),
|
||||
'Error'
|
||||
);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"add_head": "1",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "1401a167-0ce4-4f4a-afee-2d8b02ed339b",
|
||||
"guid": "355bf21a-f859-4528-9110-bcd2c6d05ea7",
|
||||
"implements": [
|
||||
"c182506a-ab84-439c-b962-1e606b58d545"
|
||||
],
|
||||
"load_selection": null,
|
||||
"name": "Grep",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.JoomlaPower.Grep",
|
||||
"type": "final class",
|
||||
"use_selection": {
|
||||
"use_selection0": {
|
||||
"use": "a223b31e-ea1d-4cdf-92ae-5f9becffaff0",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection1": {
|
||||
"use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18",
|
||||
"as": "default"
|
||||
}
|
||||
},
|
||||
"namespace": "VDM\\Joomla\\Componentbuilder.JoomlaPower.Grep",
|
||||
"description": "Global Resource Empowerment Platform\r\n\r\n The Grep feature will try to find your joomla power in the repositories listed in the global\r\n Options of JCB in the super powers tab, and if it can't be found there will try the global core\r\n Super powers of JCB. All searches are performed according the the [algorithm:cascading]\r\n See documentation for more details: https:\/\/git.vdm.dev\/joomla\/super-powers\/wiki\r\n\r\n@since 3.2.1",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "use Joomla\\CMS\\Language\\Text;",
|
||||
"composer": ""
|
||||
}
|
|
@ -1,184 +0,0 @@
|
|||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# final class JoomlaPower (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Compiler**
|
||||
```uml
|
||||
@startuml
|
||||
class JoomlaPower << (F,LightGreen) >> #RoyalBlue {
|
||||
+ array $active
|
||||
+ array $namespace
|
||||
+ array $superpowers
|
||||
# string $fixUrl
|
||||
# array $state
|
||||
# array $retry
|
||||
# Config $config
|
||||
# Placeholder $placeholder
|
||||
# Customcode $customcode
|
||||
# Gui $gui
|
||||
# Superpower $superpower
|
||||
# $db
|
||||
# $app
|
||||
+ __construct(Config $config, Placeholder $placeholder, ...)
|
||||
+ load(array $guids) : void
|
||||
+ get(string $guid, int $build) : ?object
|
||||
- set(string $guid) : bool
|
||||
- convertSettingsToArray(string $settingsJson) : ?array
|
||||
- setTargetVersion(string $guid, ?array $settings) : bool
|
||||
- setNamespaceAndType(string $guid, array $namespace) : void
|
||||
- setClassAndNamespace(string $guid) : void
|
||||
- handlePowerNotFound(string $guid) : bool
|
||||
- extractLastNameFromNamespace(string $namespace) : ?string
|
||||
- removeLastNameFromNamespace(string $namespace) : string
|
||||
- isPowerSet(string $guid) : bool
|
||||
- isGuidValid(string $guid) : bool
|
||||
- getPowerData(string $guid) : ?object
|
||||
- getCleanNamespace(string $namespace) : string
|
||||
- getUseNamespace(string $namespace, string $as = 'default') : string
|
||||
- setSuperPowers(string $guid) : void
|
||||
}
|
||||
|
||||
note right of JoomlaPower::__construct
|
||||
Constructor.
|
||||
|
||||
since: 3.2.1
|
||||
|
||||
arguments:
|
||||
Config $config
|
||||
Placeholder $placeholder
|
||||
Customcode $customcode
|
||||
Gui $gui
|
||||
Superpower $superpower
|
||||
end note
|
||||
|
||||
note left of JoomlaPower::load
|
||||
load all the powers linked to this component
|
||||
|
||||
since: 3.2.1
|
||||
return: void
|
||||
end note
|
||||
|
||||
note right of JoomlaPower::get
|
||||
Get a power
|
||||
|
||||
since: 3.2.1
|
||||
return: ?object
|
||||
end note
|
||||
|
||||
note left of JoomlaPower::set
|
||||
Set a Joomla power
|
||||
|
||||
since: 3.2.1
|
||||
return: bool
|
||||
end note
|
||||
|
||||
note right of JoomlaPower::convertSettingsToArray
|
||||
Convert settings JSON string to array
|
||||
|
||||
since: 3.2.2
|
||||
return: ?array
|
||||
end note
|
||||
|
||||
note left of JoomlaPower::setTargetVersion
|
||||
Set the target version based on Joomla version and settings
|
||||
|
||||
since: 3.2.2
|
||||
return: bool
|
||||
end note
|
||||
|
||||
note right of JoomlaPower::setNamespaceAndType
|
||||
Set namespace and type for the active power
|
||||
|
||||
since: 3.2.2
|
||||
return: void
|
||||
end note
|
||||
|
||||
note left of JoomlaPower::setClassAndNamespace
|
||||
Set class name and namespace for the active power
|
||||
|
||||
since: 3.2.2
|
||||
return: void
|
||||
end note
|
||||
|
||||
note right of JoomlaPower::handlePowerNotFound
|
||||
Handle power not found scenario
|
||||
|
||||
since: 3.2.2
|
||||
return: bool
|
||||
end note
|
||||
|
||||
note left of JoomlaPower::extractLastNameFromNamespace
|
||||
Extracts the last part of a namespace string, which is typically the class name.
|
||||
|
||||
since: 3.2.1
|
||||
return: ?string
|
||||
end note
|
||||
|
||||
note right of JoomlaPower::removeLastNameFromNamespace
|
||||
Removes the last name from the namespace.
|
||||
|
||||
since: 3.2.1
|
||||
return: string
|
||||
end note
|
||||
|
||||
note left of JoomlaPower::isPowerSet
|
||||
Check if the power is already set
|
||||
|
||||
since: 3.2.1
|
||||
return: bool
|
||||
end note
|
||||
|
||||
note right of JoomlaPower::isGuidValid
|
||||
Validate the GUID
|
||||
|
||||
since: 3.2.1
|
||||
return: bool
|
||||
end note
|
||||
|
||||
note left of JoomlaPower::getPowerData
|
||||
Get the power data from the database
|
||||
|
||||
since: 3.2.1
|
||||
return: ?object
|
||||
end note
|
||||
|
||||
note right of JoomlaPower::getCleanNamespace
|
||||
Get Clean Namespace without use or ; as part of the name space
|
||||
|
||||
since: 3.2.1
|
||||
return: string
|
||||
end note
|
||||
|
||||
note left of JoomlaPower::getUseNamespace
|
||||
Get [use Namespace\Class;]
|
||||
|
||||
since: 3.2.1
|
||||
return: string
|
||||
end note
|
||||
|
||||
note right of JoomlaPower::setSuperPowers
|
||||
Set the super powers of this power
|
||||
|
||||
since: 3.2.1
|
||||
return: void
|
||||
end note
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
||||
---
|
||||
```
|
||||
██╗ ██████╗██████╗
|
||||
██║██╔════╝██╔══██╗
|
||||
██║██║ ██████╔╝
|
||||
██ ██║██║ ██╔══██╗
|
||||
╚█████╔╝╚██████╗██████╔╝
|
||||
╚════╝ ╚═════╝╚═════╝
|
||||
```
|
||||
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
|
|
@ -1,542 +0,0 @@
|
|||
<?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;
|
||||
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Application\CMSApplication;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui;
|
||||
use VDM\Joomla\Componentbuilder\JoomlaPower\Super as SuperPower;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\ArrayHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\JsonHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\GuidHelper;
|
||||
use VastDevelopmentMethod\Joomla\Utilities\String\NamespaceHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\PowerInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Joomla Power
|
||||
*
|
||||
* @since 3.2.1
|
||||
*/
|
||||
final class JoomlaPower implements PowerInterface
|
||||
{
|
||||
/**
|
||||
* All loaded powers
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.1
|
||||
**/
|
||||
public array $active = [];
|
||||
|
||||
/**
|
||||
* All power namespaces
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.1
|
||||
**/
|
||||
public array $namespace = [];
|
||||
|
||||
/**
|
||||
* All super powers of this build
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.1
|
||||
**/
|
||||
public array $superpowers = [];
|
||||
|
||||
/**
|
||||
* Old super powers found in the local repos
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.1
|
||||
**/
|
||||
public array $old_superpowers = [];
|
||||
|
||||
/**
|
||||
* The url to the power, if there is an error.
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected string $fixUrl;
|
||||
|
||||
/**
|
||||
* The state of all loaded powers
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected array $state = [];
|
||||
|
||||
/**
|
||||
* The state of retry to loaded powers
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected array $retry = [];
|
||||
|
||||
/**
|
||||
* Compiler Config
|
||||
*
|
||||
* @var Config
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected Config $config;
|
||||
|
||||
/**
|
||||
* Compiler Placeholder
|
||||
*
|
||||
* @var Placeholder
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected Placeholder $placeholder;
|
||||
|
||||
/**
|
||||
* Compiler Customcode
|
||||
*
|
||||
* @var Customcode
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected Customcode $customcode;
|
||||
|
||||
/**
|
||||
* Compiler Customcode in Gui
|
||||
*
|
||||
* @var Gui
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected Gui $gui;
|
||||
|
||||
/**
|
||||
* The JCB Superpower class
|
||||
*
|
||||
* @var Superpower
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected Superpower $superpower;
|
||||
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected $app;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The compiler config object.
|
||||
* @param Placeholder $placeholder The compiler placeholder object.
|
||||
* @param Customcode $customcode The compiler customcode object.
|
||||
* @param Gui $gui The compiler customcode gui object.
|
||||
* @param Superpower $superpower The JCB superpower object.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @since 3.2.1
|
||||
*/
|
||||
public function __construct(Config $config, Placeholder $placeholder,
|
||||
Customcode $customcode, Gui $gui, Superpower $superpower)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->placeholder = $placeholder;
|
||||
$this->customcode = $customcode;
|
||||
$this->gui = $gui;
|
||||
$this->superpower = $superpower;
|
||||
$this->db = Factory::getDbo();
|
||||
$this->app = Factory::getApplication();
|
||||
}
|
||||
|
||||
/**
|
||||
* load all the powers linked to this component
|
||||
*
|
||||
* @param array $guids The global unique ids of the linked powers
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.1
|
||||
*/
|
||||
public function load(array $guids)
|
||||
{
|
||||
if (ArrayHelper::check($guids))
|
||||
{
|
||||
foreach ($guids as $guid => $build)
|
||||
{
|
||||
$this->get($guid, $build);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a power
|
||||
*
|
||||
* @param string $guid The global unique id of the power
|
||||
* @param int $build Force build switch (to override global switch)
|
||||
*
|
||||
* @return object|null
|
||||
* @since 3.2.1
|
||||
*/
|
||||
public function get(string $guid, int $build = 0): ?object
|
||||
{
|
||||
if (($this->config->get('add_power', true) || $build == 1) && $this->set($guid))
|
||||
{
|
||||
return $this->active[$guid];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a Joomla power
|
||||
*
|
||||
* @param string $guid The global unique id of the power
|
||||
*
|
||||
* @return bool true on successful setting of a power
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function set(string $guid): bool
|
||||
{
|
||||
// Check if power is already set
|
||||
if ($this->isPowerSet($guid))
|
||||
{
|
||||
return $this->state[$guid];
|
||||
}
|
||||
|
||||
// Validate GUID
|
||||
if (!$this->isGuidValid($guid))
|
||||
{
|
||||
$this->state[$guid] = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the power data
|
||||
$this->active[$guid] = $this->getPowerData($guid);
|
||||
|
||||
// Validate power data object
|
||||
if ($this->active[$guid] === null)
|
||||
{
|
||||
return $this->handlePowerNotFound($guid);
|
||||
}
|
||||
|
||||
// Prevent recursive loading of the same power
|
||||
$this->state[$guid] = true;
|
||||
|
||||
// Convert settings to array if valid JSON
|
||||
$settings = $this->convertSettingsToArray(
|
||||
$this->active[$guid]->settings
|
||||
);
|
||||
|
||||
// Set the target version if settings array is valid
|
||||
if (!$this->setTargetVersion($guid, $settings))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set class name and namespace
|
||||
$this->setClassAndNamespace($guid);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert settings JSON string to array
|
||||
*
|
||||
* @param string $settingsJson
|
||||
*
|
||||
* @return array|null
|
||||
* @since 3.2.2
|
||||
*/
|
||||
private function convertSettingsToArray(string $settingsJson): ?array
|
||||
{
|
||||
if (JsonHelper::check($settingsJson))
|
||||
{
|
||||
return json_decode($settingsJson, true);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the target version based on Joomla version and settings
|
||||
*
|
||||
* @param string $guid
|
||||
* @param array|null $settings
|
||||
*
|
||||
* @return bool
|
||||
* @since 3.2.2
|
||||
*/
|
||||
private function setTargetVersion(string $guid, ?array $settings): bool
|
||||
{
|
||||
$joomla_version = $this->config->joomla_version;
|
||||
|
||||
if (!$joomla_version || !ArrayHelper::check($settings))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$joomla_version_target = null;
|
||||
$target_found = false;
|
||||
|
||||
foreach ($settings as $namespace)
|
||||
{
|
||||
// Set default values for all versions
|
||||
if ($namespace['joomla_version'] == 0)
|
||||
{
|
||||
$this->setNamespaceAndType($guid, $namespace);
|
||||
$target_found = true;
|
||||
}
|
||||
|
||||
// Check for direct target version
|
||||
if ($joomla_version == $namespace['joomla_version'])
|
||||
{
|
||||
$joomla_version_target = $namespace;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($joomla_version_target)
|
||||
{
|
||||
$this->setNamespaceAndType($guid, $joomla_version_target);
|
||||
$target_found = true;
|
||||
}
|
||||
|
||||
if (!$target_found)
|
||||
{
|
||||
$this->app->enqueueMessage(
|
||||
Text::sprintf('COM_COMPONENTBUILDER_PJOOMLA_POWER_BGUIDSB_WAS_FOUND_BUT_MISSING_A_NAMESPACE_VALUE_FOR_JOOMLA_SP', $guid, $joomla_version),
|
||||
'Error'
|
||||
);
|
||||
|
||||
$this->state[$guid] = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set namespace and type for the active power
|
||||
*
|
||||
* @param string $guid
|
||||
* @param array $namespace
|
||||
*
|
||||
* @since 3.2.2
|
||||
*/
|
||||
private function setNamespaceAndType(string $guid, array $namespace): void
|
||||
{
|
||||
$this->active[$guid]->namespace = $namespace['namespace'];
|
||||
$this->active[$guid]->type = $namespace['type'] ?? 'class';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set class name and namespace for the active power
|
||||
*
|
||||
* @param string $guid
|
||||
*
|
||||
* @since 3.2.2
|
||||
*/
|
||||
private function setClassAndNamespace(string $guid): void
|
||||
{
|
||||
$this->active[$guid]->class_name = $this->extractLastNameFromNamespace(
|
||||
$this->active[$guid]->namespace
|
||||
);
|
||||
|
||||
$this->active[$guid]->_namespace = $this->removeLastNameFromNamespace(
|
||||
$this->active[$guid]->namespace
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle power not found scenario
|
||||
*
|
||||
* @param string $guid
|
||||
*
|
||||
* @return bool
|
||||
* @since 3.2.2
|
||||
*/
|
||||
private function handlePowerNotFound(string $guid): bool
|
||||
{
|
||||
if (empty($this->retry[$guid]) && $this->superpower->load($guid, ['remote', 'local']))
|
||||
{
|
||||
// Retry loading the power
|
||||
unset($this->state[$guid]);
|
||||
unset($this->active[$guid]);
|
||||
|
||||
$this->retry[$guid] = true;
|
||||
|
||||
return $this->set($guid);
|
||||
}
|
||||
|
||||
$this->app->enqueueMessage(
|
||||
Text::sprintf('COM_COMPONENTBUILDER_PJOOMLA_POWER_BGUIDSB_NOT_FOUNDP', $guid),
|
||||
'Error'
|
||||
);
|
||||
|
||||
$this->state[$guid] = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the last part of a namespace string, which is typically the class name.
|
||||
*
|
||||
* @param string $namespace The namespace string to extract from.
|
||||
*
|
||||
* @return string|null The extracted class name.
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function extractLastNameFromNamespace(string $namespace): ?string
|
||||
{
|
||||
$parts = explode('\\', $namespace);
|
||||
$result = end($parts);
|
||||
|
||||
// Remove '\\' from the beginning and end of the resulting string
|
||||
$result = trim($result, '\\');
|
||||
|
||||
// If the resulting string is empty, return null
|
||||
return empty($result) ? null : $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the last name from the namespace.
|
||||
*
|
||||
* @param string $namespace The namespace
|
||||
*
|
||||
* @return string The namespace shortened
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function removeLastNameFromNamespace(string $namespace): string
|
||||
{
|
||||
// Remove '\\' from the beginning and end of the resulting string
|
||||
$namespace = trim($namespace, '\\');
|
||||
|
||||
$parts = explode('\\', $namespace);
|
||||
|
||||
// Remove the last part (the class name)
|
||||
array_pop($parts);
|
||||
|
||||
// Reassemble the namespace without the class name
|
||||
return implode('\\', $parts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the power is already set
|
||||
*
|
||||
* @param string $guid The global unique id of the power
|
||||
*
|
||||
* @return bool true if the power is already set
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function isPowerSet(string $guid): bool
|
||||
{
|
||||
return isset($this->state[$guid]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate the GUID
|
||||
*
|
||||
* @param string $guid The global unique id of the power
|
||||
*
|
||||
* @return bool true if the GUID is valid
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function isGuidValid(string $guid): bool
|
||||
{
|
||||
return GuidHelper::valid($guid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the power data from the database
|
||||
*
|
||||
* @param string $guid The global unique id of the power
|
||||
*
|
||||
* @return object|null The power data
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function getPowerData(string $guid): ?object
|
||||
{
|
||||
$query = $this->db->getQuery(true);
|
||||
$query->select('a.*');
|
||||
$query->from('#__componentbuilder_joomla_power AS a');
|
||||
$query->where($this->db->quoteName('a.guid') . ' = ' . $this->db->quote($guid));
|
||||
|
||||
$this->db->setQuery($query);
|
||||
$this->db->execute();
|
||||
|
||||
if ($this->db->getNumRows())
|
||||
{
|
||||
return $this->db->loadObject();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Clean Namespace without use or ; as part of the name space
|
||||
*
|
||||
* @param string $namespace The actual name space
|
||||
* @param bool $removeNumbers The switch to remove numbers
|
||||
*
|
||||
* @return string
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function getCleanNamespace(string $namespace): string
|
||||
{
|
||||
// trim possible (use) or (;) or (starting or ending \) added to the namespace
|
||||
return NamespaceHelper::safe(str_replace(['use ', ';'], '', $namespace));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get [use Namespace\Class;]
|
||||
*
|
||||
* @param string $namespace The actual name space
|
||||
* @param string $as The use as name (default is none)
|
||||
*
|
||||
* @return string
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function getUseNamespace(string $namespace, string $as = 'default'): string
|
||||
{
|
||||
// check if it has an AS option
|
||||
if ($as !== 'default')
|
||||
{
|
||||
return 'use ' . $namespace . ' as ' . $as . ';';
|
||||
}
|
||||
return 'use ' . $namespace . ';';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the super powers of this power
|
||||
*
|
||||
* @param string $guid The global unique id of the power
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function setSuperPowers(string $guid): void
|
||||
{
|
||||
// soon
|
||||
}
|
||||
}
|
||||
|
|
@ -1,504 +0,0 @@
|
|||
/**
|
||||
* All loaded powers
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.1
|
||||
**/
|
||||
public array $active = [];
|
||||
|
||||
/**
|
||||
* All power namespaces
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.1
|
||||
**/
|
||||
public array $namespace = [];
|
||||
|
||||
/**
|
||||
* All super powers of this build
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.1
|
||||
**/
|
||||
public array $superpowers = [];
|
||||
|
||||
/**
|
||||
* Old super powers found in the local repos
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.1
|
||||
**/
|
||||
public array $old_superpowers = [];
|
||||
|
||||
/**
|
||||
* The url to the power, if there is an error.
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected string $fixUrl;
|
||||
|
||||
/**
|
||||
* The state of all loaded powers
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected array $state = [];
|
||||
|
||||
/**
|
||||
* The state of retry to loaded powers
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected array $retry = [];
|
||||
|
||||
/**
|
||||
* Compiler Config
|
||||
*
|
||||
* @var Config
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected Config $config;
|
||||
|
||||
/**
|
||||
* Compiler Placeholder
|
||||
*
|
||||
* @var Placeholder
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected Placeholder $placeholder;
|
||||
|
||||
/**
|
||||
* Compiler Customcode
|
||||
*
|
||||
* @var Customcode
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected Customcode $customcode;
|
||||
|
||||
/**
|
||||
* Compiler Customcode in Gui
|
||||
*
|
||||
* @var Gui
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected Gui $gui;
|
||||
|
||||
/**
|
||||
* The JCB Superpower class
|
||||
*
|
||||
* @var Superpower
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected Superpower $superpower;
|
||||
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @since 3.2.1
|
||||
**/
|
||||
protected $app;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The compiler config object.
|
||||
* @param Placeholder $placeholder The compiler placeholder object.
|
||||
* @param Customcode $customcode The compiler customcode object.
|
||||
* @param Gui $gui The compiler customcode gui object.
|
||||
* @param Superpower $superpower The JCB superpower object.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @since 3.2.1
|
||||
*/
|
||||
public function __construct(Config $config, Placeholder $placeholder,
|
||||
Customcode $customcode, Gui $gui, Superpower $superpower)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->placeholder = $placeholder;
|
||||
$this->customcode = $customcode;
|
||||
$this->gui = $gui;
|
||||
$this->superpower = $superpower;
|
||||
$this->db = Factory::getDbo();
|
||||
$this->app = Factory::getApplication();
|
||||
}
|
||||
|
||||
/**
|
||||
* load all the powers linked to this component
|
||||
*
|
||||
* @param array $guids The global unique ids of the linked powers
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.1
|
||||
*/
|
||||
public function load(array $guids)
|
||||
{
|
||||
if (ArrayHelper::check($guids))
|
||||
{
|
||||
foreach ($guids as $guid => $build)
|
||||
{
|
||||
$this->get($guid, $build);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a power
|
||||
*
|
||||
* @param string $guid The global unique id of the power
|
||||
* @param int $build Force build switch (to override global switch)
|
||||
*
|
||||
* @return object|null
|
||||
* @since 3.2.1
|
||||
*/
|
||||
public function get(string $guid, int $build = 0): ?object
|
||||
{
|
||||
if (($this->config->get('add_power', true) || $build == 1) && $this->set($guid))
|
||||
{
|
||||
return $this->active[$guid];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a Joomla power
|
||||
*
|
||||
* @param string $guid The global unique id of the power
|
||||
*
|
||||
* @return bool true on successful setting of a power
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function set(string $guid): bool
|
||||
{
|
||||
// Check if power is already set
|
||||
if ($this->isPowerSet($guid))
|
||||
{
|
||||
return $this->state[$guid];
|
||||
}
|
||||
|
||||
// Validate GUID
|
||||
if (!$this->isGuidValid($guid))
|
||||
{
|
||||
$this->state[$guid] = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the power data
|
||||
$this->active[$guid] = $this->getPowerData($guid);
|
||||
|
||||
// Validate power data object
|
||||
if ($this->active[$guid] === null)
|
||||
{
|
||||
return $this->handlePowerNotFound($guid);
|
||||
}
|
||||
|
||||
// Prevent recursive loading of the same power
|
||||
$this->state[$guid] = true;
|
||||
|
||||
// Convert settings to array if valid JSON
|
||||
$settings = $this->convertSettingsToArray(
|
||||
$this->active[$guid]->settings
|
||||
);
|
||||
|
||||
// Set the target version if settings array is valid
|
||||
if (!$this->setTargetVersion($guid, $settings))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set class name and namespace
|
||||
$this->setClassAndNamespace($guid);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert settings JSON string to array
|
||||
*
|
||||
* @param string $settingsJson
|
||||
*
|
||||
* @return array|null
|
||||
* @since 3.2.2
|
||||
*/
|
||||
private function convertSettingsToArray(string $settingsJson): ?array
|
||||
{
|
||||
if (JsonHelper::check($settingsJson))
|
||||
{
|
||||
return json_decode($settingsJson, true);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the target version based on Joomla version and settings
|
||||
*
|
||||
* @param string $guid
|
||||
* @param array|null $settings
|
||||
*
|
||||
* @return bool
|
||||
* @since 3.2.2
|
||||
*/
|
||||
private function setTargetVersion(string $guid, ?array $settings): bool
|
||||
{
|
||||
$joomla_version = $this->config->joomla_version;
|
||||
|
||||
if (!$joomla_version || !ArrayHelper::check($settings))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$joomla_version_target = null;
|
||||
$target_found = false;
|
||||
|
||||
foreach ($settings as $namespace)
|
||||
{
|
||||
// Set default values for all versions
|
||||
if ($namespace['joomla_version'] == 0)
|
||||
{
|
||||
$this->setNamespaceAndType($guid, $namespace);
|
||||
$target_found = true;
|
||||
}
|
||||
|
||||
// Check for direct target version
|
||||
if ($joomla_version == $namespace['joomla_version'])
|
||||
{
|
||||
$joomla_version_target = $namespace;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($joomla_version_target)
|
||||
{
|
||||
$this->setNamespaceAndType($guid, $joomla_version_target);
|
||||
$target_found = true;
|
||||
}
|
||||
|
||||
if (!$target_found)
|
||||
{
|
||||
$this->app->enqueueMessage(
|
||||
Text::sprintf('<p>Joomla Power <b>guid:%s</b> was found, but missing a namespace value for Joomla %s!</p>', $guid, $joomla_version),
|
||||
'Error'
|
||||
);
|
||||
|
||||
$this->state[$guid] = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set namespace and type for the active power
|
||||
*
|
||||
* @param string $guid
|
||||
* @param array $namespace
|
||||
*
|
||||
* @since 3.2.2
|
||||
*/
|
||||
private function setNamespaceAndType(string $guid, array $namespace): void
|
||||
{
|
||||
$this->active[$guid]->namespace = $namespace['namespace'];
|
||||
$this->active[$guid]->type = $namespace['type'] ?? 'class';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set class name and namespace for the active power
|
||||
*
|
||||
* @param string $guid
|
||||
*
|
||||
* @since 3.2.2
|
||||
*/
|
||||
private function setClassAndNamespace(string $guid): void
|
||||
{
|
||||
$this->active[$guid]->class_name = $this->extractLastNameFromNamespace(
|
||||
$this->active[$guid]->namespace
|
||||
);
|
||||
|
||||
$this->active[$guid]->_namespace = $this->removeLastNameFromNamespace(
|
||||
$this->active[$guid]->namespace
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle power not found scenario
|
||||
*
|
||||
* @param string $guid
|
||||
*
|
||||
* @return bool
|
||||
* @since 3.2.2
|
||||
*/
|
||||
private function handlePowerNotFound(string $guid): bool
|
||||
{
|
||||
if (empty($this->retry[$guid]) && $this->superpower->load($guid, ['remote', 'local']))
|
||||
{
|
||||
// Retry loading the power
|
||||
unset($this->state[$guid]);
|
||||
unset($this->active[$guid]);
|
||||
|
||||
$this->retry[$guid] = true;
|
||||
|
||||
return $this->set($guid);
|
||||
}
|
||||
|
||||
$this->app->enqueueMessage(
|
||||
Text::sprintf('<p>Joomla Power <b>guid:%s</b> not found!</p>', $guid),
|
||||
'Error'
|
||||
);
|
||||
|
||||
$this->state[$guid] = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the last part of a namespace string, which is typically the class name.
|
||||
*
|
||||
* @param string $namespace The namespace string to extract from.
|
||||
*
|
||||
* @return string|null The extracted class name.
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function extractLastNameFromNamespace(string $namespace): ?string
|
||||
{
|
||||
$parts = explode('\\', $namespace);
|
||||
$result = end($parts);
|
||||
|
||||
// Remove '\\' from the beginning and end of the resulting string
|
||||
$result = trim($result, '\\');
|
||||
|
||||
// If the resulting string is empty, return null
|
||||
return empty($result) ? null : $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the last name from the namespace.
|
||||
*
|
||||
* @param string $namespace The namespace
|
||||
*
|
||||
* @return string The namespace shortened
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function removeLastNameFromNamespace(string $namespace): string
|
||||
{
|
||||
// Remove '\\' from the beginning and end of the resulting string
|
||||
$namespace = trim($namespace, '\\');
|
||||
|
||||
$parts = explode('\\', $namespace);
|
||||
|
||||
// Remove the last part (the class name)
|
||||
array_pop($parts);
|
||||
|
||||
// Reassemble the namespace without the class name
|
||||
return implode('\\', $parts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the power is already set
|
||||
*
|
||||
* @param string $guid The global unique id of the power
|
||||
*
|
||||
* @return bool true if the power is already set
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function isPowerSet(string $guid): bool
|
||||
{
|
||||
return isset($this->state[$guid]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate the GUID
|
||||
*
|
||||
* @param string $guid The global unique id of the power
|
||||
*
|
||||
* @return bool true if the GUID is valid
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function isGuidValid(string $guid): bool
|
||||
{
|
||||
return GuidHelper::valid($guid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the power data from the database
|
||||
*
|
||||
* @param string $guid The global unique id of the power
|
||||
*
|
||||
* @return object|null The power data
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function getPowerData(string $guid): ?object
|
||||
{
|
||||
$query = $this->db->getQuery(true);
|
||||
$query->select('a.*');
|
||||
$query->from('#__componentbuilder_joomla_power AS a');
|
||||
$query->where($this->db->quoteName('a.guid') . ' = ' . $this->db->quote($guid));
|
||||
|
||||
$this->db->setQuery($query);
|
||||
$this->db->execute();
|
||||
|
||||
if ($this->db->getNumRows())
|
||||
{
|
||||
return $this->db->loadObject();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Clean Namespace without use or ; as part of the name space
|
||||
*
|
||||
* @param string $namespace The actual name space
|
||||
* @param bool $removeNumbers The switch to remove numbers
|
||||
*
|
||||
* @return string
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function getCleanNamespace(string $namespace): string
|
||||
{
|
||||
// trim possible (use) or (;) or (starting or ending \) added to the namespace
|
||||
return NamespaceHelper::safe(str_replace(['use ', ';'], '', $namespace));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get [use Namespace\Class;]
|
||||
*
|
||||
* @param string $namespace The actual name space
|
||||
* @param string $as The use as name (default is none)
|
||||
*
|
||||
* @return string
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function getUseNamespace(string $namespace, string $as = 'default'): string
|
||||
{
|
||||
// check if it has an AS option
|
||||
if ($as !== 'default')
|
||||
{
|
||||
return 'use ' . $namespace . ' as ' . $as . ';';
|
||||
}
|
||||
return 'use ' . $namespace . ';';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the super powers of this power
|
||||
*
|
||||
* @param string $guid The global unique id of the power
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.1
|
||||
*/
|
||||
private function setSuperPowers(string $guid): void
|
||||
{
|
||||
// soon
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
{
|
||||
"add_head": "1",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "0",
|
||||
"guid": "3730a000-ab64-477d-8b0f-70eaf71b517a",
|
||||
"implements": [
|
||||
"1133c2d7-ba7e-4c95-8cde-01f084d04682"
|
||||
],
|
||||
"load_selection": null,
|
||||
"name": "JoomlaPower",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Compiler.JoomlaPower",
|
||||
"type": "final class",
|
||||
"use_selection": {
|
||||
"use_selection0": {
|
||||
"use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection1": {
|
||||
"use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection2": {
|
||||
"use": "313b43c4-98c3-4f62-9177-2d73ec8eba31",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection3": {
|
||||
"use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection4": {
|
||||
"use": "39a75870-a7f7-45fd-937d-5ba97b85b8ad",
|
||||
"as": "SuperPower"
|
||||
},
|
||||
"use_selection5": {
|
||||
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection6": {
|
||||
"use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection7": {
|
||||
"use": "9c513baf-b279-43fd-ae29-a585c8cbc4f0",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection8": {
|
||||
"use": "ce8cf834-6bac-44fb-941c-861f7e046cc0",
|
||||
"as": "default"
|
||||
}
|
||||
},
|
||||
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.JoomlaPower",
|
||||
"description": "Joomla Power\r\n\r\n@since 3.2.1",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\Application\\CMSApplication;\r\nuse Joomla\\CMS\\Language\\Text;",
|
||||
"composer": ""
|
||||
}
|
|
@ -6,14 +6,13 @@
|
|||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# class Insert (Details)
|
||||
# final class Insert (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Power\Database**
|
||||
```uml
|
||||
@startuml
|
||||
class Insert #Gold {
|
||||
class Insert << (F,LightGreen) >> #RoyalBlue {
|
||||
# Model $model
|
||||
# Database $database
|
||||
# string $table
|
||||
+ __construct(Model $model, Database $database)
|
||||
+ value(mixed $value, string $field, ...) : bool
|
||||
+ row(array $item) : bool
|
||||
|
|
|
@ -12,9 +12,8 @@
|
|||
namespace VDM\Joomla\Componentbuilder\Power\Database;
|
||||
|
||||
|
||||
use VastDevelopmentMethod\Joomla\Interfaces\ModelInterface as Model;
|
||||
use VastDevelopmentMethod\Joomla\Database\Insert as Database;
|
||||
use VDM\Joomla\Componentbuilder\Interfaces\Database\InsertInterface;
|
||||
use VDM\Joomla\Componentbuilder\Power\Model\Upsert as Model;
|
||||
use VDM\Joomla\Database\Insert as Database;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -22,7 +21,7 @@ use VDM\Joomla\Componentbuilder\Interfaces\Database\InsertInterface;
|
|||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
class Insert implements InsertInterface
|
||||
final class Insert
|
||||
{
|
||||
/**
|
||||
* Model
|
||||
|
@ -40,14 +39,6 @@ class Insert implements InsertInterface
|
|||
*/
|
||||
protected Database $database;
|
||||
|
||||
/**
|
||||
* Table Name
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2.1
|
||||
*/
|
||||
protected string $table = 'power';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
@ -97,10 +88,10 @@ class Insert implements InsertInterface
|
|||
public function row(array $item): bool
|
||||
{
|
||||
// check if object could be modelled
|
||||
if (($item = $this->model->row($item, $this->table)) !== null)
|
||||
if (($item = $this->model->row($item, 'power')) !== null)
|
||||
{
|
||||
// Insert the column of this table
|
||||
return $this->database->row($item, $this->table);
|
||||
return $this->database->row($item, 'power');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -117,10 +108,10 @@ class Insert implements InsertInterface
|
|||
public function rows(?array $items): bool
|
||||
{
|
||||
// check if object could be modelled
|
||||
if (($items = $this->model->rows($items, $this->table)) !== null)
|
||||
if (($items = $this->model->rows($items, 'power')) !== null)
|
||||
{
|
||||
// Insert the column of this table
|
||||
return $this->database->rows($items, $this->table);
|
||||
return $this->database->rows($items, 'power');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -137,10 +128,10 @@ class Insert implements InsertInterface
|
|||
public function item(object $item): bool
|
||||
{
|
||||
// check if object could be modelled
|
||||
if (($item = $this->model->item($item, $this->table)) !== null)
|
||||
if (($item = $this->model->item($item, 'power')) !== null)
|
||||
{
|
||||
// Insert the column of this table
|
||||
return $this->database->item($item, $this->table);
|
||||
return $this->database->item($item, 'power');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -157,12 +148,13 @@ class Insert implements InsertInterface
|
|||
public function items(?array $items): bool
|
||||
{
|
||||
// check if object could be modelled
|
||||
if (($items = $this->model->items($items, $this->table)) !== null)
|
||||
if (($items = $this->model->items($items, 'power')) !== null)
|
||||
{
|
||||
// Update the column of this table using guid as the primary key.
|
||||
return $this->database->items($items, $this->table);
|
||||
return $this->database->items($items, 'power');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -14,14 +14,6 @@
|
|||
*/
|
||||
protected Database $database;
|
||||
|
||||
/**
|
||||
* Table Name
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2.1
|
||||
*/
|
||||
protected string $table = 'power';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
@ -71,10 +63,10 @@
|
|||
public function row(array $item): bool
|
||||
{
|
||||
// check if object could be modelled
|
||||
if (($item = $this->model->row($item, $this->table)) !== null)
|
||||
if (($item = $this->model->row($item, 'power')) !== null)
|
||||
{
|
||||
// Insert the column of this table
|
||||
return $this->database->row($item, $this->table);
|
||||
return $this->database->row($item, 'power');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -91,10 +83,10 @@
|
|||
public function rows(?array $items): bool
|
||||
{
|
||||
// check if object could be modelled
|
||||
if (($items = $this->model->rows($items, $this->table)) !== null)
|
||||
if (($items = $this->model->rows($items, 'power')) !== null)
|
||||
{
|
||||
// Insert the column of this table
|
||||
return $this->database->rows($items, $this->table);
|
||||
return $this->database->rows($items, 'power');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -111,10 +103,10 @@
|
|||
public function item(object $item): bool
|
||||
{
|
||||
// check if object could be modelled
|
||||
if (($item = $this->model->item($item, $this->table)) !== null)
|
||||
if (($item = $this->model->item($item, 'power')) !== null)
|
||||
{
|
||||
// Insert the column of this table
|
||||
return $this->database->item($item, $this->table);
|
||||
return $this->database->item($item, 'power');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -131,10 +123,10 @@
|
|||
public function items(?array $items): bool
|
||||
{
|
||||
// check if object could be modelled
|
||||
if (($items = $this->model->items($items, $this->table)) !== null)
|
||||
if (($items = $this->model->items($items, 'power')) !== null)
|
||||
{
|
||||
// Update the column of this table using guid as the primary key.
|
||||
return $this->database->items($items, $this->table);
|
||||
return $this->database->items($items, 'power');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,17 +3,15 @@
|
|||
"add_licensing_template": "2",
|
||||
"extends": "0",
|
||||
"guid": "380bb7a3-cdcc-4336-a699-5070cbf521a5",
|
||||
"implements": [
|
||||
"95c02df3-fe0a-405b-b506-b7a5b8605b66"
|
||||
],
|
||||
"implements": null,
|
||||
"load_selection": null,
|
||||
"name": "Insert",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Power.Database.Insert",
|
||||
"type": "class",
|
||||
"type": "final class",
|
||||
"use_selection": {
|
||||
"use_selection0": {
|
||||
"use": "8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff",
|
||||
"use": "7c1fb50f-8fb1-4627-8705-6fedf7182ca5",
|
||||
"as": "Model"
|
||||
},
|
||||
"use_selection1": {
|
||||
|
|
|
@ -1,77 +0,0 @@
|
|||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# class JoomlaPower (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\JoomlaPower\Service**
|
||||
```uml
|
||||
@startuml
|
||||
class JoomlaPower #Gold {
|
||||
+ register(Container $container) : void
|
||||
+ getConfig(Container $container) : Config
|
||||
+ getTable(Container $container) : Table
|
||||
+ getGrep(Container $container) : Grep
|
||||
+ getSuperpower(Container $container) : Superpower
|
||||
+ getParser(Container $container) : Parser
|
||||
}
|
||||
|
||||
note right of JoomlaPower::register
|
||||
Registers the service provider with a DI container.
|
||||
|
||||
since: 3.2.0
|
||||
return: void
|
||||
end note
|
||||
|
||||
note right of JoomlaPower::getConfig
|
||||
Get The Config Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: Config
|
||||
end note
|
||||
|
||||
note right of JoomlaPower::getTable
|
||||
Get The Table Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: Table
|
||||
end note
|
||||
|
||||
note right of JoomlaPower::getGrep
|
||||
Get The Grep Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: Grep
|
||||
end note
|
||||
|
||||
note right of JoomlaPower::getSuperpower
|
||||
Get The Super Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: Superpower
|
||||
end note
|
||||
|
||||
note right of JoomlaPower::getParser
|
||||
Get The Parser Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: Parser
|
||||
end note
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
||||
---
|
||||
```
|
||||
██╗ ██████╗██████╗
|
||||
██║██╔════╝██╔══██╗
|
||||
██║██║ ██████╔╝
|
||||
██ ██║██║ ██╔══██╗
|
||||
╚█████╔╝╚██████╗██████╔╝
|
||||
╚════╝ ╚═════╝╚═════╝
|
||||
```
|
||||
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
|
|
@ -1,130 +0,0 @@
|
|||
<?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\JoomlaPower\Service;
|
||||
|
||||
|
||||
use Joomla\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use VDM\Joomla\Componentbuilder\JoomlaPower\Config;
|
||||
use VastDevelopmentMethod\Joomla\Componentbuilder\Table;
|
||||
use VDM\Joomla\Componentbuilder\JoomlaPower\Grep;
|
||||
use VDM\Joomla\Componentbuilder\JoomlaPower\Super as Superpower;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Power\Parser;
|
||||
|
||||
|
||||
/**
|
||||
* Joomla Power Service Provider
|
||||
*
|
||||
* @since 3.2.1
|
||||
*/
|
||||
class JoomlaPower 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(Config::class, 'Config')
|
||||
->share('Config', [$this, 'getConfig'], true);
|
||||
|
||||
$container->alias(Table::class, 'Table')
|
||||
->share('Table', [$this, 'getTable'], true);
|
||||
|
||||
$container->alias(Grep::class, 'Joomla.Power.Grep')
|
||||
->share('Joomla.Power.Grep', [$this, 'getGrep'], true);
|
||||
|
||||
$container->alias(Superpower::class, 'Joomlapower')
|
||||
->share('Joomlapower', [$this, 'getSuperpower'], true);
|
||||
|
||||
$container->alias(Parser::class, 'Power.Parser')
|
||||
->share('Power.Parser', [$this, 'getParser'], true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get The Config Class.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return Config
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function getConfig(Container $container): Config
|
||||
{
|
||||
return new Config();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get The Table Class.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return Table
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function getTable(Container $container): Table
|
||||
{
|
||||
return new Table();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get The Grep Class.
|
||||
*
|
||||
* @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_joomla_powers_repository_path,
|
||||
$container->get('Config')->approved_joomla_paths,
|
||||
$container->get('Gitea.Repository.Contents')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get The Super Class.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return Superpower
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function getSuperpower(Container $container): Superpower
|
||||
{
|
||||
return new Superpower(
|
||||
$container->get('Joomla.Power.Grep'),
|
||||
$container->get('Joomla.Power.Database.Insert'),
|
||||
$container->get('Joomla.Power.Database.Update')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get The Parser Class.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return Parser
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function getParser(Container $container): Parser
|
||||
{
|
||||
return new Parser();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,98 +0,0 @@
|
|||
/**
|
||||
* 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(Config::class, 'Config')
|
||||
->share('Config', [$this, 'getConfig'], true);
|
||||
|
||||
$container->alias(Table::class, 'Table')
|
||||
->share('Table', [$this, 'getTable'], true);
|
||||
|
||||
$container->alias(Grep::class, 'Joomla.Power.Grep')
|
||||
->share('Joomla.Power.Grep', [$this, 'getGrep'], true);
|
||||
|
||||
$container->alias(Superpower::class, 'Joomlapower')
|
||||
->share('Joomlapower', [$this, 'getSuperpower'], true);
|
||||
|
||||
$container->alias(Parser::class, 'Power.Parser')
|
||||
->share('Power.Parser', [$this, 'getParser'], true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get The Config Class.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return Config
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function getConfig(Container $container): Config
|
||||
{
|
||||
return new Config();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get The Table Class.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return Table
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function getTable(Container $container): Table
|
||||
{
|
||||
return new Table();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get The Grep Class.
|
||||
*
|
||||
* @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_joomla_powers_repository_path,
|
||||
$container->get('Config')->approved_joomla_paths,
|
||||
$container->get('Gitea.Repository.Contents')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get The Super Class.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return Superpower
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function getSuperpower(Container $container): Superpower
|
||||
{
|
||||
return new Superpower(
|
||||
$container->get('Joomla.Power.Grep'),
|
||||
$container->get('Joomla.Power.Database.Insert'),
|
||||
$container->get('Joomla.Power.Database.Update')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get The Parser Class.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return Parser
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function getParser(Container $container): Parser
|
||||
{
|
||||
return new Parser();
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
{
|
||||
"add_head": "1",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "0",
|
||||
"guid": "38e1ca3e-1908-459a-be87-9f83b292058f",
|
||||
"implements": [
|
||||
"-1"
|
||||
],
|
||||
"load_selection": null,
|
||||
"name": "JoomlaPower",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.JoomlaPower.Service.JoomlaPower",
|
||||
"type": "class",
|
||||
"use_selection": {
|
||||
"use_selection0": {
|
||||
"use": "0b821bba-7503-4448-90e7-f3c1bd51dfd6",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection1": {
|
||||
"use": "bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection2": {
|
||||
"use": "355bf21a-f859-4528-9110-bcd2c6d05ea7",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection3": {
|
||||
"use": "39a75870-a7f7-45fd-937d-5ba97b85b8ad",
|
||||
"as": "Superpower"
|
||||
},
|
||||
"use_selection4": {
|
||||
"use": "95d0e03f-24fd-4412-bc2e-f0899fcc3205",
|
||||
"as": "default"
|
||||
}
|
||||
},
|
||||
"namespace": "VDM\\Joomla\\Componentbuilder.JoomlaPower.Service.JoomlaPower",
|
||||
"description": "Joomla Power Service Provider\r\n\r\n@since 3.2.1",
|
||||
"implements_custom": "ServiceProviderInterface",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;",
|
||||
"composer": ""
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user