本文整理汇总了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()
);
}
}
示例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);
}
}
示例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();
}