Puli\Manager\Json\JsonStorage::saveRootModuleFile PHP Méthode

saveRootModuleFile() public méthode

The module file is saved to the same path that it was read from.
public saveRootModuleFile ( RootModuleFile $moduleFile )
$moduleFile Puli\Manager\Api\Module\RootModuleFile The module file to save.
    public function saveRootModuleFile(RootModuleFile $moduleFile)
    {
        $this->saveFile($moduleFile, $moduleFile->getPath(), array('targetVersion' => $moduleFile->getVersion()));
        if ($this->factoryManager) {
            $this->factoryManager->autoGenerateFactoryClass();
        }
    }

Usage Example

Exemple #1
0
 private function renameNonRootModule(Module $module, $newName)
 {
     $previousInstallInfo = $module->getInstallInfo();
     $installInfo = new InstallInfo($newName, $previousInstallInfo->getInstallPath());
     $installInfo->setInstallerName($previousInstallInfo->getInstallerName());
     foreach ($previousInstallInfo->getDisabledBindingUuids() as $uuid) {
         $installInfo->addDisabledBindingUuid($uuid);
     }
     $this->rootModuleFile->removeInstallInfo($module->getName());
     $this->rootModuleFile->addInstallInfo($installInfo);
     try {
         $this->jsonStorage->saveRootModuleFile($this->rootModuleFile);
     } catch (Exception $e) {
         $this->rootModuleFile->removeInstallInfo($newName);
         $this->rootModuleFile->addInstallInfo($previousInstallInfo);
         throw $e;
     }
     $this->modules->remove($module->getName());
     $this->modules->add(new Module($module->getModuleFile(), $module->getInstallPath(), $installInfo, $module->getLoadErrors()));
 }
All Usage Examples Of Puli\Manager\Json\JsonStorage::saveRootModuleFile