| Server IP : 121.121.20.254 / Your IP : 216.73.216.165 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/AIWEBSTATION/wp-content/plugins/fluent-crm/app/Api/ |
Upload File : |
<?php
namespace FluentCrm\App\Api;
/**
* Internal PHP API Class
*
* Please do not use this class directly. use FluentCrmApi($module) instead.
*
* @package FluentCrm\App\Api\Classes
*
* @version 1.0.0
*/
final class Api
{
public $app;
public function __construct($app)
{
$this->app = $app;
$this->register();
}
private function register()
{
foreach ($this->getClasses() as $key => $class) {
$this->app->singleton($this->key($key), function($app) use ($class) {
return new FCApi($app->make($class));
});
}
}
private function getClasses()
{
return require_once(
$this->app['path.app'].'Api/config.php'
);
}
private function key($key)
{
return '__fluentcrm_api__.' . $key;
}
public function __get($key)
{
try {
return $this->app[$this->key($key)];
} catch(\Exception $e) {
/* translators: %s: requested FluentCRM API module key */
throw new \Exception(sprintf(esc_html__("The '%s' doesn't exist in FluentCrmApi.", 'fluent-crm'), esc_html($key)));
}
}
}