| Server IP : 121.121.20.254 / Your IP : 216.73.216.123 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/KnowledgeBase/wp-content/plugins/smtp2go/app/ |
Upload File : |
<?php
namespace SMTP2GO\App;
class SettingsHelper
{
private static $fieldToConstantMapping = array(
'smtp2go_api_key' => 'SMTP2GO_API_KEY',
);
public static function settingHasDefinedConstant($field)
{
if (!defined('SMTP2GO_USE_CONSTANTS') || defined('SMTP2GO_USE_CONSTANTS') && constant('SMTP2GO_USE_CONSTANTS') === false) {
return false;
}
if (isset(static::$fieldToConstantMapping[$field]) && defined(static::$fieldToConstantMapping[$field])) {
return true;
}
return false;
}
public static function getOption($field)
{
if (static::settingHasDefinedConstant($field)) {
return constant(static::$fieldToConstantMapping[$field]);
}
return get_option($field);
}
}