Added CaptchaInstanceManager to \vCaptcha\Managers

This commit is contained in:
Zi Xing 2022-01-13 13:18:02 -05:00
parent 7270b7b87c
commit 9acbbe4f00
3 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,20 @@
<?php
/** @noinspection PhpMissingFieldTypeInspection */
namespace vCaptcha\Managers;
use vCaptcha\vCaptcha;
class CaptchaInstanceManager
{
private $vcaptcha;
/**
* @param vCaptcha $vcaptcha
*/
public function __construct(vCaptcha $vcaptcha)
{
$this->vcaptcha = $vcaptcha;
}
}

View File

@ -38,7 +38,13 @@
{ {
"required": true, "required": true,
"file": "vCaptcha.php" "file": "vCaptcha.php"
},
{
"required": true,
"file": "Managers/CaptchaInstanceManager.php"
} }
], ],
"files": [] "files": [
"package.json"
]
} }

View File

@ -8,6 +8,7 @@
use acm2\Exceptions\ConfigurationNotDefinedException; use acm2\Exceptions\ConfigurationNotDefinedException;
use acm2\Objects\Schema; use acm2\Objects\Schema;
use mysqli; use mysqli;
use vCaptcha\Managers\CaptchaInstanceManager;
class vCaptcha class vCaptcha
{ {
@ -26,6 +27,11 @@
*/ */
private $DatabaseConnection; private $DatabaseConnection;
/**
* @var CaptchaInstanceManager
*/
private $CaptchaInstanceManager;
/** /**
* @throws ConfigurationNotDefinedException * @throws ConfigurationNotDefinedException
*/ */
@ -45,6 +51,7 @@
$this->acm->updateConfiguration(); $this->acm->updateConfiguration();
$this->DatabaseConfiguration = $this->acm->getConfiguration('Database'); $this->DatabaseConfiguration = $this->acm->getConfiguration('Database');
$this->CaptchaInstanceManager = new CaptchaInstanceManager($this);
} }
/** /**
@ -87,4 +94,12 @@
$this->DatabaseConfiguration['Port'] $this->DatabaseConfiguration['Port']
); );
} }
/**
* @return CaptchaInstanceManager
*/
public function getCaptchaInstanceManager(): CaptchaInstanceManager
{
return $this->CaptchaInstanceManager;
}
} }