本文整理匯總了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();
}