本文整理汇总了PHP中Magento\Backend\App\ConfigInterface::getValue方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigInterface::getValue方法的具体用法?PHP ConfigInterface::getValue怎么用?PHP ConfigInterface::getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Backend\App\ConfigInterface
的用法示例。
在下文中一共展示了ConfigInterface::getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFrontName
/**
* Retrieve area front name
*
* @return string
*/
public function getFrontName()
{
$isCustomPathUsed = (bool) (string) $this->config->getValue(self::XML_PATH_USE_CUSTOM_ADMIN_PATH);
if ($isCustomPathUsed) {
return (string) $this->config->getValue(self::XML_PATH_CUSTOM_ADMIN_PATH);
}
return $this->defaultFrontName;
}
示例2: __construct
public function __construct(\Magento\Backend\App\ConfigInterface $backendConfig, \Symfony\Component\Yaml\Parser $yamlParser, \Magento\Framework\Filesystem $filesystem, \Magento\Config\Model\Config\Factory $configFactory)
{
$this->_yamlParser = $yamlParser;
$this->_backendConfig = $backendConfig;
$this->_directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT);
$this->_folderLocation = str_replace('###MAGE_BASE###', $this->_getBaseDir(), $this->_backendConfig->getValue(self::XML_SYSTEM_PATH));
$this->_configFactory = $configFactory;
}
示例3: getFrontName
/**
* Retrieve area front name
*
* @param bool $checkHost If true, verify front name is valid for this url (hostname is correct)
* @return string|bool
*/
public function getFrontName($checkHost = false)
{
if ($checkHost && !$this->isHostBackend()) {
return false;
}
$isCustomPathUsed = (bool)(string)$this->config->getValue(self::XML_PATH_USE_CUSTOM_ADMIN_PATH);
if ($isCustomPathUsed) {
return (string)$this->config->getValue(self::XML_PATH_CUSTOM_ADMIN_PATH);
}
return $this->defaultFrontName;
}
示例4: _canShowNotification
/**
* Check verification result and return true if system must to show notification message
*
* @return bool
*/
private function _canShowNotification()
{
if ($this->_cache->load(self::VERIFICATION_RESULT_CACHE_KEY)) {
return false;
}
if ($this->_isFileAccessible()) {
return true;
}
$adminSessionLifetime = (int) $this->_backendConfig->getValue('admin/security/session_lifetime');
$this->_cache->save(true, self::VERIFICATION_RESULT_CACHE_KEY, [], $adminSessionLifetime);
return false;
}
示例5: sendPasswordResetNotificationEmail
/**
* Send email to when password is resetting
*
* @return $this
*/
public function sendPasswordResetNotificationEmail()
{
$templateId = $this->_config->getValue(self::XML_PATH_RESET_PASSWORD_TEMPLATE);
$transport = $this->_transportBuilder->setTemplateIdentifier($templateId)->setTemplateOptions(['area' => FrontNameResolver::AREA_CODE, 'store' => Store::DEFAULT_STORE_ID])->setTemplateVars(['user' => $this, 'store' => $this->_storeManager->getStore(Store::DEFAULT_STORE_ID)])->setFrom($this->_config->getValue(self::XML_PATH_FORGOT_EMAIL_IDENTITY))->addTo($this->getEmail(), $this->getName())->getTransport();
$transport->sendMessage();
return $this;
}
示例6: sendPasswordResetNotificationEmail
/**
* Send email to when password is resetting
*
* @return $this
*/
public function sendPasswordResetNotificationEmail()
{
// Set all required params and send emails
/** @var \Magento\Framework\Mail\TransportInterface $transport */
$transport = $this->_transportBuilder->setTemplateIdentifier($this->_config->getValue(self::XML_PATH_RESET_PASSWORD_TEMPLATE))->setTemplateOptions(['area' => \Magento\Framework\App\Area::AREA_FRONTEND, 'store' => 0])->setTemplateVars(['user' => $this, 'store' => $this->_storeManager->getStore(0)])->setFrom($this->_config->getValue(self::XML_PATH_FORGOT_EMAIL_IDENTITY))->addTo($this->getEmail(), $this->getName())->getTransport();
$transport->sendMessage();
return $this;
}
示例7: sendUserNotificationEmail
/**
* Send user notification email
*
* @param string $changes
* @param string $email
* @return $this
*/
protected function sendUserNotificationEmail($changes, $email = null)
{
if ($email === null) {
$email = $this->getEmail();
}
$transport = $this->_transportBuilder->setTemplateIdentifier($this->_config->getValue(self::XML_PATH_USER_NOTIFICATION_TEMPLATE))->setTemplateModel('Magento\\Email\\Model\\BackendTemplate')->setTemplateOptions(['area' => FrontNameResolver::AREA_CODE, 'store' => Store::DEFAULT_STORE_ID])->setTemplateVars(['user' => $this, 'store' => $this->_storeManager->getStore(Store::DEFAULT_STORE_ID), 'changes' => $changes])->setFrom($this->_config->getValue(self::XML_PATH_FORGOT_EMAIL_IDENTITY))->addTo($email, $this->getName())->getTransport();
$transport->sendMessage();
return $this;
}
示例8: prolong
/**
* Set session UpdatedAt to current time and update cookie expiration time
*
* @return void
*/
public function prolong()
{
$lifetime = $this->_config->getValue(self::XML_PATH_SESSION_LIFETIME);
$currentTime = time();
$this->setUpdatedAt($currentTime);
$cookieValue = $this->_cookie->get($this->getName());
if ($cookieValue) {
$this->_cookie->set($this->getName(), $cookieValue, $lifetime, $this->sessionConfig->getCookiePath(), $this->sessionConfig->getCookieDomain(), $this->sessionConfig->getCookieSecure(), $this->sessionConfig->getCookieHttpOnly());
}
}
示例9: prolong
/**
* Set session UpdatedAt to current time and update cookie expiration time
*
* @return void
*/
public function prolong()
{
$lifetime = $this->_config->getValue(self::XML_PATH_SESSION_LIFETIME);
$currentTime = time();
$this->setUpdatedAt($currentTime);
$cookieValue = $this->cookieManager->getCookie($this->getName());
if ($cookieValue) {
$cookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata()->setDuration($lifetime)->setPath($this->sessionConfig->getCookiePath())->setDomain($this->sessionConfig->getCookieDomain())->setSecure($this->sessionConfig->getCookieSecure())->setHttpOnly($this->sessionConfig->getCookieHttpOnly());
$this->cookieManager->setPublicCookie($this->getName(), $cookieValue, $cookieMetadata);
}
}
示例10: isLoggedIn
/**
* Check if user is logged in
*
* @return boolean
*/
public function isLoggedIn()
{
$lifetime = $this->_config->getValue(self::XML_PATH_SESSION_LIFETIME);
$currentTime = time();
/* Validate admin session lifetime that should be more than 60 seconds */
if ($lifetime >= 60 && $this->getUpdatedAt() < $currentTime - $lifetime) {
return false;
}
if ($this->getUser() && $this->getUser()->getId()) {
return true;
}
return false;
}
示例11: __construct
/**
* @param \Magento\Framework\App\Helper\Context $context
* @param \Magento\Framework\Registry $coreRegistry
* @param \Magento\Framework\ObjectManager\ConfigInterface $config
*/
public function __construct(\Magento\Framework\App\Helper\Context $context, \Magento\Framework\Registry $coreRegistry, \Magento\Framework\ObjectManager\ConfigInterface $config, \Magento\Backend\App\ConfigInterface $backendConfig, \Magento\Framework\Module\ModuleListInterface $moduleList, \Magento\Framework\Module\ResourceInterface $moduleResource, \Magento\Framework\Module\ModuleList\Loader $loader, \Magento\Framework\Xml\Parser $parser, \Magento\Framework\Filesystem\Driver\File $driver, \Magento\Framework\UrlInterface $urlBuilder, \Magento\Framework\App\ProductMetadataInterface $productMetadata, \Magento\Framework\ObjectManagerInterface $objectManager)
{
$this->_backendConfig = $backendConfig;
$this->moduleList = $moduleList;
$this->moduleResource = $moduleResource;
$this->_loader = $loader;
$this->parser = $parser;
$this->driver = $driver;
$this->_objectManager = $objectManager;
$this->urlBuilder = $urlBuilder;
$this->productMetadata = $productMetadata;
$this->_allowedFeedType = explode(',', $backendConfig->getValue(\Ced\DevTool\Model\Feed::XML_FEED_TYPES));
parent::__construct($context);
}
示例12: getGeneralLocale
/**
* Get general interface locale
*
* @return string
*/
public function getGeneralLocale()
{
return $this->_backendConfig->getValue('general/locale/code');
}
示例13: getResetPasswordLinkExpirationPeriod
/**
* Retrieve customer reset password link expiration period in days
*
* @return int
*/
public function getResetPasswordLinkExpirationPeriod()
{
return (int) $this->_config->getValue(self::XML_PATH_ADMIN_RESET_PASSWORD_LINK_EXPIRATION_PERIOD);
}
示例14: getFrequency
/**
* Retrieve Update Frequency
*
* @return int
*/
public function getFrequency()
{
return $this->_backendConfig->getValue(self::XML_FREQUENCY_PATH) * 3600;
}
示例15: getMaxFailures
/**
* Get admin maxiumum security failures from config
*
* @return int
*/
public function getMaxFailures()
{
return (int) $this->backendConfig->getValue('admin/security/lockout_failures');
}