当前位置: 首页>>代码示例>>PHP>>正文


PHP ModuleListInterface::getOne方法代码示例

本文整理汇总了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;
 }
开发者ID:magefan,项目名称:module-login-as-customer,代码行数:13,代码来源:Info.php

示例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';
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:13,代码来源:License.php

示例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);
 }
开发者ID:ViniciusAugusto,项目名称:magento2,代码行数:19,代码来源:SetupModule.php

示例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;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:17,代码来源:DbVersionInfo.php

示例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;
 }
开发者ID:signifyd,项目名称:magento2,代码行数:14,代码来源:PurchaseHelper.php

示例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;
 }
开发者ID:artmouse,项目名称:Umc_Base,代码行数:21,代码来源:Module.php

示例7: getConnectorVersion

 /**
  * Get current connector version.
  *
  * @return mixed
  */
 public function getConnectorVersion()
 {
     return $this->moduleInterface->getOne(self::MODULE_NAME)['setup_version'];
 }
开发者ID:dotmailer,项目名称:dotmailer-magento2-extension,代码行数:9,代码来源:Data.php

示例8: getConfigVersion

 private function getConfigVersion()
 {
     return $this->moduleList->getOne(Module::IDENTIFIER)['setup_version'];
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:4,代码来源:InstallSchema.php

示例9: getVersion

 /**
  * Get Module version number
  *
  * @return string
  */
 public function getVersion()
 {
     $moduleInfo = $this->_moduleList->getOne($this->getModuleName());
     return $moduleInfo['setup_version'];
 }
开发者ID:magepal,项目名称:magento2-gmailsmtpapp,代码行数:10,代码来源:Version.php

示例10: getExtensionVersion

 public function getExtensionVersion()
 {
     $moduleCode = 'MagePsycho_Easypathhints';
     $moduleInfo = $this->_moduleList->getOne($moduleCode);
     return $moduleInfo['setup_version'];
 }
开发者ID:dineshmalekar,项目名称:magento2-easy-template-path-hints,代码行数:6,代码来源:Data.php

示例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();
        }
    }
开发者ID:BlackIkeEagle,项目名称:magento2-continuousphp,代码行数:82,代码来源:Installer.php

示例12: getConfigVersion

 private function getConfigVersion()
 {
     return $this->moduleList->getOne(\Ess\M2ePro\Helper\Module::IDENTIFIER)['setup_version'];
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:4,代码来源:UpgradeData.php

示例13: getModuleVersion

 public function getModuleVersion()
 {
     return (string) $this->_moduleList->getOne("Adyen_Payment")['setup_version'];
 }
开发者ID:Adyen,项目名称:adyen-magento2,代码行数:4,代码来源:Data.php


注:本文中的Magento\Framework\Module\ModuleListInterface::getOne方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。