Manages the plugins that are used by a {@link JsonSchemaLib} instance.

@param {object[]} [plugins] - The initial plugins to load

@class
@extends Array
764033
function PluginManager (plugins) {
  validatePlugins(plugins);
  plugins = plugins || PluginManager.defaults;

  // Clone the plugins, so that multiple JsonSchemaLib instances can safely use the same plugins
  var pluginManager = plugins.map(clonePlugin);

  // Return an array that "inherits" from PluginManager
  return assign(pluginManager, PluginManager.prototype);
}
1215578
def register_plugins(cls, plugins):
        '''
        
        '''
        for model in plugins:
            cls.register_plugin(model, plugins[model])
407551
protected function setActivePlugins(array $plugins): void
    {
        $plugins = array_unique($plugins, SORT_REGULAR);

        update_option('active_mu_plugins', $plugins);

        $this->activePlugins = $plugins;
    }
1309513
function PluginHelper (plugins, schema) {
  validatePlugins(plugins);
  plugins = plugins || [];

  // Clone the array of plugins, and sort by priority
  var pluginHelper = plugins.slice().sort(sortByPriority);

  /**
   * Internal stuff. Use at your own risk!
   *
   * @private
   */
  pluginHelper[__internal] = {
    /**
     * A reference to the {@link Schema} object
     */
    schema: schema,
  };

  // Return an array that "inherits" from PluginHelper
  return assign(pluginHelper, PluginHelper.prototype);
}
1352034
function usePlugins(core) {
  var installedPlugins = [];
  
  /**
   * @desc Register iro.js plugin
   * @param {Function} plugin = plugin constructor
   * @param {Object} pluginOptions = plugin options passed to constructor
   */
  core.use = function(plugin, pluginOptions) {
    if ( pluginOptions === void 0 ) pluginOptions = {};

    // Check that the plugin hasn't already been registered
    if (!(installedPlugins.indexOf(plugin) > -1)) {
      // Init plugin
      // TODO: consider collection of plugin utils, which are passed as a thrid param
      plugin(core, pluginOptions);
      // Register plugin
      installedPlugins.push(plugin);
    }
  };

  core.installedPlugins = installedPlugins;

  return core;
}
457148
function plugin(plugins) {
      var z, method, conf;
      for(z in plugins) {
        if(typeof plugins[z] === 'function') {
          method = plugins[z];
        }else{
          method = plugins[z].plugin;
          conf = plugins[z].conf;
        }
        if(opts.field && typeof method[opts.field] === 'function') {
          method = method[opts.field];
        }
        method.call(proto, conf);
      }
      return main;
    }
614888
public function activatePlugins(): void
    {
        foreach (array_keys($this->getPlugins()) as $plugin) {
            if (!$this->isPluginActive($plugin)) {
                $this->activatePlugin($plugin);
            }
        }
    }
514327
function listFilters(plugins) {
    return plugins
        .reverse()
        .reduce(function(result, plugin) {
            return result.merge(plugin.getFilters());
        }, Immutable.Map());
}
1289049
protected function processPlugins(array $plugins, array $processors, \SplObjectStorage $processedPlugins = null)
    {
        // Initialise store of already-processed plugins, to prevent container-based endless recursion
        if ($processedPlugins === null) {
            $processedPlugins = new \SplObjectStorage;
        }
        foreach ($plugins as $plugin) {
            if ($processedPlugins->contains($plugin)) {
                continue;
            }
            $processedPlugins->attach($plugin);
            foreach ($processors as $processor) {
                $processor->process($plugin, $this);
            }
            if ($plugin instanceof PluginContainerInterface) {
                $this->processPlugins($plugin->getPlugins(), $processors, $processedPlugins);
            }
        }
    }
1235648
function loadModulePlugins(modulePlugins) {
        var serverModules = {};
        var me = this;

        // add modules from each plugin to the serverModules map
        _.each(modulePlugins, function (modulePlugin) {
            _.extend(serverModules, me.loadModules(modulePlugin.rootDir, modulePlugin.serverModuleDirs));
        });

        return serverModules;
    }
1029091
function (ui, done) {
        Object.keys(ui.defaultPlugins).forEach(function (key) {
            ui.pluginManager.get(key)(ui, ui.bs);
        });
        done();
    }
990300
function (methods) {
    this.lazyLoaders();
    var loaders = this.loaders;
    var self = this;

    utils.arrayify(methods).forEach(function (method) {
      self.define(method, function() {
        return loaders[method].apply(loaders, arguments);
      });
    });
  }
1130486
function loadPlugin(id) {
    var plugin = PLUGINS[id];
    plugin.exec.load(plugin.id, {
        id: plugin.id
    });
}
102187
function registerFilters (filters) {
  if (isArray(filters)) {
    lazyStringFilters = lazyStringFilters.concat(filters)
  } else if (isObject(filters)) {
    Object.keys(filters).forEach(name => {
      addFilter(name, filters[name])
    })
  }
}
1177133
function JSONSchema () {
  var self = this;

  self.klass = JSONSchema;
  self.klass.super_.apply(self, arguments);

  self.engine = require('json-schema');
}
779688
public function load($plugins)
    {
        if (!is_array($plugins)) {
            $plugins = (array) $plugins;
        }

        foreach ($plugins as $plugin) {
            if (!isset($this->plugins[$plugin])) {
                trigger_error(sprintf('Attempted to load non-existing plugin %s', $plugin));
                return false;
            }

            if (isset($this->plugins[$plugin]['scripts'])) {
                $this->appendScripts($this->plugins[$plugin]['scripts']);
            }

            if (isset($this->plugins[$plugin]['stylesheets'])) {
                $this->appendStylesheets($this->plugins[$plugin]['stylesheets']);
            }
        }

        return $this;
    }
1278154
function _withPlugins(fn) {
  return function() {
    const args = Array.from(arguments);
    const opts = args[1] || {};
    args[1] = Object.assign({}, opts, {
      plugins: loadPlugins(opts.plugins, opts.pluginSearchDirs)
    });
    return fn.apply(null, args);
  };
}