本文整理汇总了PHP中Magento\Framework\Module\ModuleListInterface::getOne方法的典型用法代码示例。如果您正苦于以下问题:PHP ModuleListInterface::getOne方法的具体用法?PHP ModuleListInterface::getOne怎么用?PHP ModuleListInterface::getOne使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\Module\ModuleListInterface
的用法示例。
在下文中一共展示了ModuleListInterface::getOne方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Return info block html
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
* @return string
*/
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$m = $this->moduleList->getOne($this->getModuleName());
$html = '<div style="padding:10px;background-color:#f8f8f8;border:1px solid #ddd;margin-bottom:7px;">
Login As Customer Extension v' . $m['setup_version'] . ' was developed by <a href="http://magefan.com/" target="_blank">MageFan</a>.
</div>';
return $html;
}
示例2: getVersion
/**
* Magento version
*
* @return string
*/
public function getVersion()
{
$module = $this->moduleList->getOne('Magento_Backend');
if (is_array($module) && isset($module['setup_version'])) {
return $module['setup_version'];
}
return '2.0.0';
}
示例3: __construct
/**
* Constructor
*
* @param LoggerInterface $log
* @param ModuleListInterface $moduleList
* @param SetupFileResolver $fileResolver
* @param string $moduleName
* @param \Magento\Framework\App\Resource $resource
* @param string $connectionName
*/
public function __construct(LoggerInterface $log, ModuleListInterface $moduleList, SetupFileResolver $fileResolver, $moduleName, \Magento\Framework\App\Resource $resource, $connectionName = SetupInterface::DEFAULT_SETUP_CONNECTION)
{
parent::__construct($resource, $connectionName);
$this->logger = $log;
$this->fileResolver = $fileResolver;
$this->moduleConfig = $moduleList->getOne($moduleName);
$this->resource = new Resource($resource);
$this->resourceName = $this->fileResolver->getResourceCode($moduleName);
}
示例4: isModuleVersionEqual
/**
* Check if DB data is up to date
*
* @param string $moduleName
* @param string|bool $version
* @return bool
* @throws \UnexpectedValueException
*/
private function isModuleVersionEqual($moduleName, $version)
{
$module = $this->moduleList->getOne($moduleName);
if (empty($module['setup_version'])) {
throw new \UnexpectedValueException("Setup version for module '{$moduleName}' is not specified");
}
$configVer = $module['setup_version'];
return $version !== false && version_compare($configVer, $version) === ModuleDataSetupInterface::VERSION_COMPARE_EQUAL;
}
示例5: getVersions
/**
* Getting the version of Magento and the version of the extension
* @return array
*/
protected function getVersions()
{
$version = array();
$productMetadata = $this->_objectManager->get('\\Magento\\Framework\\App\\ProductMetadata');
$version['storePlatformVersion'] = $productMetadata->getVersion();
$version['signifydClientApp'] = 'Magento 2';
$version['storePlatform'] = 'Magento 2';
$version['signifydClientAppVersion'] = (string) $this->_moduleList->getOne('Signifyd_Connect')['setup_version'];
return $version;
}
示例6: getUmcModules
/**
* get available modules
*
* @return array
*/
public function getUmcModules()
{
$modules = $this->helpConfig->getConfig('module', true, []);
$installed = [];
foreach ($modules as $module) {
$moduleData = $this->moduleList->getOne($module['id']);
if ($moduleData) {
$version = $moduleData['setup_version'];
if (isset($module['build'])) {
$version .= '-' . $module['build'];
}
$installed[] = ['module' => $module['id'], 'version' => $version];
}
}
return $installed;
}
示例7: getConnectorVersion
/**
* Get current connector version.
*
* @return mixed
*/
public function getConnectorVersion()
{
return $this->moduleInterface->getOne(self::MODULE_NAME)['setup_version'];
}
示例8: getConfigVersion
private function getConfigVersion()
{
return $this->moduleList->getOne(Module::IDENTIFIER)['setup_version'];
}
示例9: getVersion
/**
* Get Module version number
*
* @return string
*/
public function getVersion()
{
$moduleInfo = $this->_moduleList->getOne($this->getModuleName());
return $moduleInfo['setup_version'];
}
示例10: getExtensionVersion
public function getExtensionVersion()
{
$moduleCode = 'MagePsycho_Easypathhints';
$moduleInfo = $this->_moduleList->getOne($moduleCode);
return $moduleInfo['setup_version'];
}
示例11: handleDBSchemaData
/**
* Handles database schema and data (install/upgrade/backup/uninstall etc)
*
* @param SchemaSetupInterface | ModuleDataSetupInterface $setup
* @param string $type
* @return void
* @throws \Exception
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
private function handleDBSchemaData($setup, $type)
{
if (!(($type === 'schema') || ($type === 'data'))) {
throw new \Magento\Setup\Exception("Unsupported operation type $type is requested");
}
$this->assertDeploymentConfigExists();
$this->assertDbAccessible();
$resource = new \Magento\Framework\Module\ModuleResource($this->context);
$verType = $type . '-version';
$installType = $type . '-install';
$upgradeType = $type . '-upgrade';
$moduleNames = $this->moduleList->getNames();
$moduleContextList = $this->generateListOfModuleContext($resource, $verType);
foreach ($moduleNames as $moduleName) {
$this->log->log("Module '{$moduleName}':");
$configVer = $this->moduleList->getOne($moduleName)['setup_version'];
$currentVersion = $moduleContextList[$moduleName]->getVersion();
// Schema/Data is installed
if ($currentVersion !== '') {
$status = version_compare($configVer, $currentVersion);
if ($status == \Magento\Framework\Setup\ModuleDataSetupInterface::VERSION_COMPARE_GREATER) {
$upgrader = $this->getSchemaDataHandler($moduleName, $upgradeType);
if ($upgrader) {
$this->log->logInline("Upgrading $type.. ");
$upgrader->upgrade($setup, $moduleContextList[$moduleName]);
}
if ($type === 'schema') {
$resource->setDbVersion($moduleName, $configVer);
} elseif ($type === 'data') {
$resource->setDataVersion($moduleName, $configVer);
}
}
} elseif ($configVer) {
$installer = $this->getSchemaDataHandler($moduleName, $installType);
if ($installer) {
$this->log->logInline("Installing $type.. ");
$installer->install($setup, $moduleContextList[$moduleName]);
}
$upgrader = $this->getSchemaDataHandler($moduleName, $upgradeType);
if ($upgrader) {
$this->log->logInline("Upgrading $type.. ");
$upgrader->upgrade($setup, $moduleContextList[$moduleName]);
}
if ($type === 'schema') {
$resource->setDbVersion($moduleName, $configVer);
} elseif ($type === 'data') {
$resource->setDataVersion($moduleName, $configVer);
}
}
$this->logProgress();
}
if ($type === 'schema') {
$this->log->log('Schema post-updates:');
$handlerType = 'schema-recurring';
} else if ($type === 'data') {
$this->log->log('Data post-updates:');
$handlerType = 'data-recurring';
}
foreach ($moduleNames as $moduleName) {
$this->log->log("Module '{$moduleName}':");
$modulePostUpdater = $this->getSchemaDataHandler($moduleName, $handlerType);
if ($modulePostUpdater) {
$this->log->logInline('Running ' + str_replace('-', ' ', $handlerType) + '...');
$modulePostUpdater->install($setup, $moduleContextList[$moduleName]);
}
$this->logProgress();
}
}
示例12: getConfigVersion
private function getConfigVersion()
{
return $this->moduleList->getOne(\Ess\M2ePro\Helper\Module::IDENTIFIER)['setup_version'];
}
示例13: getModuleVersion
public function getModuleVersion()
{
return (string) $this->_moduleList->getOne("Adyen_Payment")['setup_version'];
}