當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。