Imports all environments from a plugin.
@param {Object} plugin The plugin object.
@param {string} pluginName The name of the plugin.
@returns {void}
345796
function(plugin, pluginName) {
			if (plugin.environments) {
				Object.keys(plugin.environments).forEach(function(envName) {
					this.define(pluginName + "/" + envName, plugin.environments[envName]);
				}, this);
			}
		}
956064
function validatePluginName(plugin, pluginList) {
    if (!plugin.name)
        throw new Error(ApiHost.ERR_PLUGIN_MISSING_NAME_PROPERTY);

    pluginList.forEach(function (collectorPlugin) {
        if (plugin.name === collectorPlugin.name) {
            var msg = util.format(ApiHost.ERR_DUPLICATE_PLUGIN_NAME, plugin.name, plugin.extends);
            throw new Error(msg);
        }
    });
}
26665
public void addPlugins(String pluginTypeNames) {
		String[] pluginTypeNameList = pluginTypeNames.split(",");
		for (String pluginTypeName : pluginTypeNameList) {
			pluginTypeName = pluginTypeName.trim();
			if (!pluginTypeName.equals("")) {
				addPlugin(pluginTypeName);
			}
		}
	}
7795
function(plugins, pluginBase){
        var _this = this;
        
        if (typeof pluginBase === 'string') {
            _pluginBase = pluginBase;
        }
        plugins.forEach(function(plugin, index){
            var name;
            var path;
            if (typeof plugin === 'string'){
                name = plugin;
            } else {
                name = plugin.name;
                path = plugin.path;
            }
            _this.register(name, plugin);
        });
    }
401682
public function plugin($plugin, array $pluginConfig = [], $init = true)
        {
            // Module plugin
            //   ex: 'Module\User'
            if (false !== strpos($plugin, 'Module\\')) {
                $sPluginClass = $plugin . '\Plugin';

            // Named plugin
            //   ex: 'Spot'
            } else {
                // Upper-case beginning of each word
                $sPlugin = str_replace(' ', '\\', ucwords(str_replace('_', ' ', $plugin)));
                $sPluginClass = 'Plugin\\' . $sPlugin . '\Plugin';
            }

            // Ensure class exists / can be loaded
            if (!class_exists($sPluginClass, (boolean) $init)) {
                if ($init) {
                    throw new \InvalidArgumentException("Unable to load plugin '" . $sPluginClass . "'. Remove from app configuration file or ensure plugin files exist in 'app' or 'Thin' load paths.");
                }

                return false;
            }

            // Instantiate plugin class with params
            return $this->factory($sPluginClass, [$this, $pluginConfig]);
        }
430234
function initPlugins() {
        var name,
            plugin,
            plugins = config.plugins || {};
        for (name in plugins) {
            plugin = scope.createComponent('plugin-' + name);
            if (plugin && util.isFn(plugin.init)) {
                plugin.init(config.plugins[name]);
            }
        }
    }
1347839
function(pluginName) {
		
		var plugin = $.tooltipster._plugin(pluginName);
		
		if (plugin) {
			
			// if there is a constructor for instances
			if (plugin.instance) {
				
				// proxy non-private methods on the instance to allow new instance methods
				$.tooltipster.__bridge(plugin.instance, this, plugin.name);
			}
		}
		else {
			throw new Error('The "'+ pluginName +'" plugin is not defined');
		}
		
		return this;
	}
227107
function (plugin) {
                this.removePluginByName(plugin.name, plugin.type);
                logger.debug("Plugin: " + plugin.name + " has been removed");
            }
1199928
function Plugin( element ) {
        this.element = element;
        this.jqElement = $(element);
        this.isScaleActive = false;

        this._defaults = defaults;
        this._name = pluginName;
    }
73418
private function installPluginIfNecessary(Plugin $plugin)
    {
        $pluginName = $plugin->getPluginName();
        $saveConfig = false;

        // is the plugin already installed or is it the first time we activate it?
        $pluginsInstalled = $this->getInstalledPluginsName();

        if (!$this->isPluginInstalled($pluginName)) {
            $this->executePluginInstall($plugin);
            $pluginsInstalled[] = $pluginName;
            $this->updatePluginsInstalledConfig($pluginsInstalled);
            $updater = new Updater();
            $updater->markComponentSuccessfullyUpdated($plugin->getPluginName(), $plugin->getVersion(), $isNew = true);
            $saveConfig = true;

            /**
             * Event triggered after a new plugin has been installed.
             *
             * Note: Might be triggered more than once if the config file is not writable
             *
             * @param string $pluginName The plugin that has been installed.
             */
            Piwik::postEvent('PluginManager.pluginInstalled', array($pluginName));
        }

        if ($saveConfig) {
            PiwikConfig::getInstance()->forceSave();
            $this->clearCache($pluginName);
        }
    }
878309
function getPluginsConfig(pluginNames) {
  var pluginConfig = {};

  pluginNames.forEach(function(pluginName) {
    var pluginNamespace = util.getNamespace(pluginName),
      pluginNameWithoutNamespace = util.removeNameSpace(pluginName),
      pluginNameWithoutPrefix = util.removePluginPrefix(pluginNameWithoutNamespace),
      plugin = {},
      rules = {};

    if (!loadedPlugins[pluginNameWithoutPrefix]) {
      try {
        plugin = require(pluginNamespace + util.PLUGIN_NAME_PREFIX + pluginNameWithoutPrefix);
        loadedPlugins[pluginNameWithoutPrefix] = plugin;
      } catch (err) {
        plugin = { rulesConfig: {}};
      }
    } else {
      plugin = loadedPlugins[pluginNameWithoutPrefix];
    }

    if (!plugin.rulesConfig) {
      plugin.rulesConfig = {};
    }

    Object.keys(plugin.rulesConfig).forEach(function(item) {
      rules[pluginNameWithoutPrefix + '/' + item] = plugin.rulesConfig[item];
    });

    pluginConfig = util.mergeConfigs(pluginConfig, rules);
  });

  return {rules: pluginConfig};
}
1374945
function withPlugins(fn) {
  return function() {
    const args = Array.from(arguments);
    let plugins = (args[1] && args[1].plugins) || [];
    if (!isArray(plugins)) {
      plugins = Object.values(plugins);
    }
    args[1] = Object.assign({}, args[1], {
      plugins: internalPlugins.concat(plugins)
    });
    return fn.apply(null, args);
  };
}
10437
function(name, plugin){
    Flotr.plugins[name] = plugin;
    Flotr.defaultOptions[name] = plugin.options || {};
  }
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;
}
49810
function (data, pluginNames) {
    logger('runPlugins input', data);
    var plugins = pluginNames.map(function (pn) { return pluginRegistry[pn]; }),
      applyPlugin = function (oldData, plugin) { return plugin(oldData); };
    // Use reduce to apply all the plugins to the data
    var output = plugins.reduce(applyPlugin, data);
    logger('runPlugins output', output);
    return output;
  }
964226
function(pluginName, moduleName, write){
            if(moduleName in buildMap){
                var content = buildMap[moduleName];
                write('define("'+ pluginName +'!'+ moduleName +'", function(){ return '+ content +';});\n');
            }
        }
1235942
function buildPluginEntry(plugins) {
    const result = {};
    plugins.forEach(
        plugin =>
            (result[path.basename(plugin, '.js')] = path.join(
                pluginSrcDir,
                plugin
            ))
    );
    return result;
}