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


PHP ObjectManagerProvider::reset方法代码示例

本文整理汇总了PHP中Magento\Setup\Model\ObjectManagerProvider::reset方法的典型用法代码示例。如果您正苦于以下问题:PHP ObjectManagerProvider::reset方法的具体用法?PHP ObjectManagerProvider::reset怎么用?PHP ObjectManagerProvider::reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Setup\Model\ObjectManagerProvider的用法示例。


在下文中一共展示了ObjectManagerProvider::reset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: installSampleData

 /**
  * Run installation process for Sample Data
  *
  * @param array $request
  * @return void
  * @throws \Magento\Setup\SampleDataException
  *
  * @SuppressWarnings(PHPMD.UnusedPrivateMethod) Called by install() via callback.
  */
 private function installSampleData($request)
 {
     try {
         $userName = isset($request[AdminAccount::KEY_USER]) ? $request[AdminAccount::KEY_USER] : '';
         $this->objectManagerProvider->reset();
         $this->sampleData->install($this->objectManagerProvider->get(), $this->log, $userName);
     } catch (\Exception $e) {
         throw new \Magento\Setup\SampleDataException(
             "Error during sample data installation: {$e->getMessage()}",
             $e->getCode()
         );
     }
 }
开发者ID:vasiljok,项目名称:magento2,代码行数:22,代码来源:Installer.php

示例2: cleanupGeneratedFiles

    /**
     * Clear var/generation and reset object manager
     *
     * @return void
     */
    private function cleanupGeneratedFiles()
    {
        $this->log->log('File system cleanup:');
        $messages = $this->cleanupFiles->clearCodeGeneratedFiles();

        // unload Magento autoloader because it may be using compiled definition
        foreach (spl_autoload_functions() as $autoloader) {
            if ($autoloader[0] instanceof \Magento\Framework\Code\Generator\Autoloader) {
                spl_autoload_unregister([$autoloader[0], $autoloader[1]]);
                break;
            }
        }

        // Corrected Magento autoloader will be loaded upon next get() call on $this->objectManagerProvider
        $this->objectManagerProvider->reset();

        foreach ($messages as $message) {
            $this->log->log($message);
        }
    }
开发者ID:BlackIkeEagle,项目名称:magento2-continuousphp,代码行数:25,代码来源:Installer.php

示例3: installDeploymentConfig

 /**
  * Installs deployment configuration
  *
  * @param \ArrayObject|array $data
  * @return void
  */
 public function installDeploymentConfig($data)
 {
     $this->checkInstallationFilePermissions();
     $userData = is_array($data) ? $data : $data->getArrayCopy();
     $this->setupConfigModel->process($userData);
     if ($this->deploymentConfig->isAvailable()) {
         $deploymentConfigData = $this->deploymentConfig->get(ConfigOptionsList::CONFIG_PATH_CRYPT_KEY);
         if (isset($deploymentConfigData)) {
             $this->installInfo[ConfigOptionsList::KEY_ENCRYPTION_KEY] = $deploymentConfigData;
         }
     }
     // reset object manager now that there is a deployment config
     $this->objectManagerProvider->reset();
 }
开发者ID:opexsw,项目名称:magento2,代码行数:20,代码来源:Installer.php


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