update 2023-07-19 12:32:39
This commit is contained in:
parent
5ef0795a29
commit
73c4c18371
@ -82,6 +82,7 @@ This repository contains an index (see below) of all the approved powers within
|
|||||||
|
|
||||||
- **final class Http** | [Details](src/b8c66089-735e-4081-825c-8fe36b28e4a6) | [Code](src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.php) | [Settings](src/b8c66089-735e-4081-825c-8fe36b28e4a6/settings.json) | Super__b8c66089_735e_4081_825c_8fe36b28e4a6__Power
|
- **final class Http** | [Details](src/b8c66089-735e-4081-825c-8fe36b28e4a6) | [Code](src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.php) | [Settings](src/b8c66089-735e-4081-825c-8fe36b28e4a6/settings.json) | Super__b8c66089_735e_4081_825c_8fe36b28e4a6__Power
|
||||||
- **final class Response** | [Details](src/c99e85a0-d120-4f25-bcbf-0940dd7b773b) | [Code](src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.php) | [Settings](src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/settings.json) | Super__c99e85a0_d120_4f25_bcbf_0940dd7b773b__Power
|
- **final class Response** | [Details](src/c99e85a0-d120-4f25-bcbf-0940dd7b773b) | [Code](src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.php) | [Settings](src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/settings.json) | Super__c99e85a0_d120_4f25_bcbf_0940dd7b773b__Power
|
||||||
|
- **final class SessionHelper** | [Details](src/84e84cd1-c938-4559-8414-d5692db4118e) | [Code](src/84e84cd1-c938-4559-8414-d5692db4118e/code.php) | [Settings](src/84e84cd1-c938-4559-8414-d5692db4118e/settings.json) | Super__84e84cd1_c938_4559_8414_d5692db4118e__Power
|
||||||
- **final class StringHelper** | [Details](src/a5b32737-207d-4cf6-b8ae-ee815612c3a0) | [Code](src/a5b32737-207d-4cf6-b8ae-ee815612c3a0/code.php) | [Settings](src/a5b32737-207d-4cf6-b8ae-ee815612c3a0/settings.json) | Super__a5b32737_207d_4cf6_b8ae_ee815612c3a0__Power
|
- **final class StringHelper** | [Details](src/a5b32737-207d-4cf6-b8ae-ee815612c3a0) | [Code](src/a5b32737-207d-4cf6-b8ae-ee815612c3a0/code.php) | [Settings](src/a5b32737-207d-4cf6-b8ae-ee815612c3a0/settings.json) | Super__a5b32737_207d_4cf6_b8ae_ee815612c3a0__Power
|
||||||
- **final class Uri** | [Details](src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb) | [Code](src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.php) | [Settings](src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/settings.json) | Super__fc9ab6f0_c31b_4077_bb1c_2dcddd36f6bb__Power
|
- **final class Uri** | [Details](src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb) | [Code](src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.php) | [Settings](src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/settings.json) | Super__fc9ab6f0_c31b_4077_bb1c_2dcddd36f6bb__Power
|
||||||
|
|
||||||
|
51
src/84e84cd1-c938-4559-8414-d5692db4118e/README.md
Normal file
51
src/84e84cd1-c938-4559-8414-d5692db4118e/README.md
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
```
|
||||||
|
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||||
|
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||||
|
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||||
|
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||||
|
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||||
|
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||||
|
```
|
||||||
|
# final class SessionHelper (Details)
|
||||||
|
> namespace: **VDM\Joomla\GetBible\Utilities**
|
||||||
|
```uml
|
||||||
|
@startuml
|
||||||
|
class SessionHelper << (F,LightGreen) >> #Green {
|
||||||
|
# Session $session
|
||||||
|
+ __construct(?Session $session = null)
|
||||||
|
+ getLinker() : string
|
||||||
|
+ setLinker(string $linker) : bool
|
||||||
|
}
|
||||||
|
|
||||||
|
note right of SessionHelper::__construct
|
||||||
|
Constructor
|
||||||
|
|
||||||
|
since: 3.2.0
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of SessionHelper::getLinker
|
||||||
|
Get the Active Linker GUID Value
|
||||||
|
|
||||||
|
return: string
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of SessionHelper::setLinker
|
||||||
|
Set the Active Linker GUID Value
|
||||||
|
|
||||||
|
return: bool
|
||||||
|
end note
|
||||||
|
|
||||||
|
@enduml
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
```
|
||||||
|
██╗ ██████╗██████╗
|
||||||
|
██║██╔════╝██╔══██╗
|
||||||
|
██║██║ ██████╔╝
|
||||||
|
██ ██║██║ ██╔══██╗
|
||||||
|
╚█████╔╝╚██████╗██████╔╝
|
||||||
|
╚════╝ ╚═════╝╚═════╝
|
||||||
|
```
|
||||||
|
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||||
|
|
87
src/84e84cd1-c938-4559-8414-d5692db4118e/code.php
Normal file
87
src/84e84cd1-c938-4559-8414-d5692db4118e/code.php
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package GetBible
|
||||||
|
*
|
||||||
|
* @created 30th May, 2023
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git GetBible <https://git.vdm.dev/getBible>
|
||||||
|
* @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\GetBible\Utilities;
|
||||||
|
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory as JoomlaFactory;
|
||||||
|
use Joomla\CMS\Session\Session;
|
||||||
|
use VDM\Joomla\Utilities\GuidHelper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The GetBible Session Helper
|
||||||
|
*
|
||||||
|
* @since 2.0.1
|
||||||
|
*/
|
||||||
|
final class SessionHelper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Session
|
||||||
|
*
|
||||||
|
* @var Session
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Session $session;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param Session|null $session The Joomla session.
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function __construct(?Session $session = null)
|
||||||
|
{
|
||||||
|
$this->session = $session ?: JoomlaFactory::getSession();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Active Linker GUID Value
|
||||||
|
*
|
||||||
|
* @return string A Valid Linker GUID Value
|
||||||
|
*/
|
||||||
|
public function getLinker(): string
|
||||||
|
{
|
||||||
|
$linker = $this->session->get('getbible_active_linker_guid', GuidHelper::get());
|
||||||
|
|
||||||
|
if (GuidHelper::valid($linker))
|
||||||
|
{
|
||||||
|
return $linker;
|
||||||
|
}
|
||||||
|
|
||||||
|
$linker = GuidHelper::get();
|
||||||
|
|
||||||
|
$this->session->set('getbible_active_linker_guid', $linker);
|
||||||
|
|
||||||
|
return $linker;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the Active Linker GUID Value
|
||||||
|
*
|
||||||
|
* @param string $linker The linker GUID value.
|
||||||
|
*
|
||||||
|
* @return bool True on success
|
||||||
|
*/
|
||||||
|
public function setLinker($linker): bool
|
||||||
|
{
|
||||||
|
if (GuidHelper::valid($linker))
|
||||||
|
{
|
||||||
|
$this->session->set('getbible_active_linker_guid', $linker);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
59
src/84e84cd1-c938-4559-8414-d5692db4118e/code.power
Normal file
59
src/84e84cd1-c938-4559-8414-d5692db4118e/code.power
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
/**
|
||||||
|
* The Session
|
||||||
|
*
|
||||||
|
* @var Session
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Session $session;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param Session|null $session The Joomla session.
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function __construct(?Session $session = null)
|
||||||
|
{
|
||||||
|
$this->session = $session ?: JoomlaFactory::getSession();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Active Linker GUID Value
|
||||||
|
*
|
||||||
|
* @return string A Valid Linker GUID Value
|
||||||
|
*/
|
||||||
|
public function getLinker(): string
|
||||||
|
{
|
||||||
|
$linker = $this->session->get('getbible_active_linker_guid', GuidHelper::get());
|
||||||
|
|
||||||
|
if (GuidHelper::valid($linker))
|
||||||
|
{
|
||||||
|
return $linker;
|
||||||
|
}
|
||||||
|
|
||||||
|
$linker = GuidHelper::get();
|
||||||
|
|
||||||
|
$this->session->set('getbible_active_linker_guid', $linker);
|
||||||
|
|
||||||
|
return $linker;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the Active Linker GUID Value
|
||||||
|
*
|
||||||
|
* @param string $linker The linker GUID value.
|
||||||
|
*
|
||||||
|
* @return bool True on success
|
||||||
|
*/
|
||||||
|
public function setLinker($linker): bool
|
||||||
|
{
|
||||||
|
if (GuidHelper::valid($linker))
|
||||||
|
{
|
||||||
|
$this->session->set('getbible_active_linker_guid', $linker);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
23
src/84e84cd1-c938-4559-8414-d5692db4118e/settings.json
Normal file
23
src/84e84cd1-c938-4559-8414-d5692db4118e/settings.json
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"add_head": "1",
|
||||||
|
"add_licensing_template": "2",
|
||||||
|
"extends": "0",
|
||||||
|
"guid": "84e84cd1-c938-4559-8414-d5692db4118e",
|
||||||
|
"implements": null,
|
||||||
|
"load_selection": null,
|
||||||
|
"name": "SessionHelper",
|
||||||
|
"power_version": "1.0.0",
|
||||||
|
"system_name": "Joomla.GetBible.Utilities.SessionHelper",
|
||||||
|
"type": "final class",
|
||||||
|
"use_selection": {
|
||||||
|
"use_selection0": {
|
||||||
|
"use": "9c513baf-b279-43fd-ae29-a585c8cbc4f0",
|
||||||
|
"as": "default"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"namespace": "VDM\\Joomla\\GetBible\\Utilities.SessionHelper",
|
||||||
|
"description": "The GetBible Session Helper\r\n\r\n@since 2.0.1",
|
||||||
|
"licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/getBible>\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 as JoomlaFactory;\r\nuse Joomla\\CMS\\Session\\Session;",
|
||||||
|
"composer": ""
|
||||||
|
}
|
@ -16,6 +16,7 @@ class Utilities #Gold {
|
|||||||
+ getResponse(Container $container) : Response
|
+ getResponse(Container $container) : Response
|
||||||
+ getHttp(Container $container) : Http
|
+ getHttp(Container $container) : Http
|
||||||
+ getString(Container $container) : StringHelper
|
+ getString(Container $container) : StringHelper
|
||||||
|
+ getSession(Container $container) : SessionHelper
|
||||||
}
|
}
|
||||||
|
|
||||||
note right of Utilities::register
|
note right of Utilities::register
|
||||||
@ -53,6 +54,13 @@ note right of Utilities::getString
|
|||||||
return: StringHelper
|
return: StringHelper
|
||||||
end note
|
end note
|
||||||
|
|
||||||
|
note right of Utilities::getSession
|
||||||
|
Get the Session Helper class
|
||||||
|
|
||||||
|
since: 3.2.0
|
||||||
|
return: SessionHelper
|
||||||
|
end note
|
||||||
|
|
||||||
@enduml
|
@enduml
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ use VDM\Joomla\GetBible\Utilities\Uri;
|
|||||||
use VDM\Joomla\GetBible\Utilities\Response;
|
use VDM\Joomla\GetBible\Utilities\Response;
|
||||||
use VDM\Joomla\GetBible\Utilities\Http;
|
use VDM\Joomla\GetBible\Utilities\Http;
|
||||||
use VDM\Joomla\GetBible\Utilities\StringHelper;
|
use VDM\Joomla\GetBible\Utilities\StringHelper;
|
||||||
|
use VDM\Joomla\GetBible\Utilities\SessionHelper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -48,6 +49,9 @@ class Utilities implements ServiceProviderInterface
|
|||||||
|
|
||||||
$container->alias(StringHelper::class, 'GetBible.Utilities.String')
|
$container->alias(StringHelper::class, 'GetBible.Utilities.String')
|
||||||
->share('GetBible.Utilities.String', [$this, 'getString'], true);
|
->share('GetBible.Utilities.String', [$this, 'getString'], true);
|
||||||
|
|
||||||
|
$container->alias(SessionHelper::class, 'GetBible.Utilities.Session')
|
||||||
|
->share('GetBible.Utilities.Session', [$this, 'getSession'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -103,5 +107,18 @@ class Utilities implements ServiceProviderInterface
|
|||||||
{
|
{
|
||||||
return new StringHelper();
|
return new StringHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Session Helper class
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return SessionHelper
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function getSession(Container $container): SessionHelper
|
||||||
|
{
|
||||||
|
return new SessionHelper();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
|
|
||||||
$container->alias(StringHelper::class, 'GetBible.Utilities.String')
|
$container->alias(StringHelper::class, 'GetBible.Utilities.String')
|
||||||
->share('GetBible.Utilities.String', [$this, 'getString'], true);
|
->share('GetBible.Utilities.String', [$this, 'getString'], true);
|
||||||
|
|
||||||
|
$container->alias(SessionHelper::class, 'GetBible.Utilities.Session')
|
||||||
|
->share('GetBible.Utilities.Session', [$this, 'getSession'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -74,3 +77,16 @@
|
|||||||
{
|
{
|
||||||
return new StringHelper();
|
return new StringHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Session Helper class
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return SessionHelper
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function getSession(Container $container): SessionHelper
|
||||||
|
{
|
||||||
|
return new SessionHelper();
|
||||||
|
}
|
@ -27,6 +27,10 @@
|
|||||||
"use_selection3": {
|
"use_selection3": {
|
||||||
"use": "a5b32737-207d-4cf6-b8ae-ee815612c3a0",
|
"use": "a5b32737-207d-4cf6-b8ae-ee815612c3a0",
|
||||||
"as": "default"
|
"as": "default"
|
||||||
|
},
|
||||||
|
"use_selection4": {
|
||||||
|
"use": "84e84cd1-c938-4559-8414-d5692db4118e",
|
||||||
|
"as": "default"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"namespace": "VDM\\Joomla\\GetBible\\Service.Utilities",
|
"namespace": "VDM\\Joomla\\GetBible\\Service.Utilities",
|
||||||
|
@ -153,6 +153,17 @@
|
|||||||
"spk": "Super__8336e3c4_f11b_41bc_a2b1_976f99442a84__Power",
|
"spk": "Super__8336e3c4_f11b_41bc_a2b1_976f99442a84__Power",
|
||||||
"guid": "8336e3c4-f11b-41bc-a2b1-976f99442a84"
|
"guid": "8336e3c4-f11b-41bc-a2b1-976f99442a84"
|
||||||
},
|
},
|
||||||
|
"84e84cd1-c938-4559-8414-d5692db4118e": {
|
||||||
|
"name": "SessionHelper",
|
||||||
|
"type": "final class",
|
||||||
|
"namespace": "VDM\\Joomla\\GetBible\\Utilities",
|
||||||
|
"code": "src\/84e84cd1-c938-4559-8414-d5692db4118e\/code.php",
|
||||||
|
"power": "src\/84e84cd1-c938-4559-8414-d5692db4118e\/code.power",
|
||||||
|
"settings": "src\/84e84cd1-c938-4559-8414-d5692db4118e\/settings.json",
|
||||||
|
"path": "src\/84e84cd1-c938-4559-8414-d5692db4118e",
|
||||||
|
"spk": "Super__84e84cd1_c938_4559_8414_d5692db4118e__Power",
|
||||||
|
"guid": "84e84cd1-c938-4559-8414-d5692db4118e"
|
||||||
|
},
|
||||||
"899551ac-943e-4f81-becd-7e15c41f1081": {
|
"899551ac-943e-4f81-becd-7e15c41f1081": {
|
||||||
"name": "Word",
|
"name": "Word",
|
||||||
"type": "final class",
|
"type": "final class",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user