setPluginClasses() public method

The plugin classes must be fully-qualified class names that implement {@link Puli\Manager\Api\PuliPlugin}. If a class is not found or does not implement that interface, an exception is thrown. The plugin classes must not have required parameters in their constructor so that they can be successfully instantiated. If a constructor has required parameters, an exception is thrown. Leading backslashes are removed from the fully-qualified class names.
public setPluginClasses ( array $pluginClasses )
$pluginClasses array The fully qualified plugin class names.
Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function removePluginClasses(Expression $expr)
 {
     $save = false;
     $previousClasses = $this->rootModuleFile->getPluginClasses();
     foreach ($previousClasses as $pluginClass) {
         if ($expr->evaluate($pluginClass)) {
             $this->rootModuleFile->removePluginClass($pluginClass);
             $save = true;
         }
     }
     if (!$save) {
         return;
     }
     try {
         $this->jsonStorage->saveRootModuleFile($this->rootModuleFile);
     } catch (Exception $e) {
         $this->rootModuleFile->setPluginClasses($previousClasses);
         throw $e;
     }
 }
Ejemplo n.º 2
0
 protected function addJsonToRootModuleFile(stdClass $jsonData, RootModuleFile $moduleFile)
 {
     if (isset($jsonData->order)) {
         $moduleFile->setModuleOrder((array) $jsonData->order);
     }
     if (isset($jsonData->plugins)) {
         $moduleFile->setPluginClasses($jsonData->plugins);
     }
     if (isset($jsonData->config)) {
         $config = $moduleFile->getConfig();
         foreach ($this->objectsToArrays($jsonData->config) as $key => $value) {
             $config->set($key, $value);
         }
     }
     if (isset($jsonData->modules)) {
         foreach ($jsonData->modules as $moduleName => $moduleData) {
             $installInfo = new InstallInfo($moduleName, $moduleData->{'install-path'});
             if (isset($moduleData->env)) {
                 $installInfo->setEnvironment($moduleData->env);
             }
             if (isset($moduleData->installer)) {
                 $installInfo->setInstallerName($moduleData->installer);
             }
             if (isset($moduleData->{'disabled-bindings'})) {
                 foreach ($moduleData->{'disabled-bindings'} as $uuid) {
                     $installInfo->addDisabledBindingUuid(Uuid::fromString($uuid));
                 }
             }
             $moduleFile->addInstallInfo($installInfo);
         }
     }
 }