本文整理汇总了PHP中AJXP_Plugin::getDependencies方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_Plugin::getDependencies方法的具体用法?PHP AJXP_Plugin::getDependencies怎么用?PHP AJXP_Plugin::getDependencies使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AJXP_Plugin
的用法示例。
在下文中一共展示了AJXP_Plugin::getDependencies方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: recursiveLoadPlugin
/**
* Load plugin class with dependencies first
*
* @param AJXP_Plugin $plugin
* @param array $pluginsPool
*/
private function recursiveLoadPlugin($plugin, $pluginsPool)
{
if ($plugin->loadingState != "") {
return;
}
$dependencies = $plugin->getDependencies();
$plugin->loadingState = "lock";
foreach ($dependencies as $dependencyId) {
if (isset($pluginsPool[$dependencyId])) {
$this->recursiveLoadPlugin($pluginsPool[$dependencyId], $pluginsPool);
}
}
$plugType = $plugin->getType();
if (!isset($this->registry[$plugType])) {
$this->registry[$plugType] = array();
}
$plugin = $this->instanciatePluginClass($plugin);
$options = $this->confStorage->loadPluginConfig($plugType, $plugin->getName());
$plugin->loadConfigs($options);
$this->registry[$plugType][$plugin->getName()] = $plugin;
$plugin->loadingState = "loaded";
}
示例2: recursiveLoadPlugin
/**
* Load plugin class with dependencies first
*
* @param AJXP_Plugin $plugin
* @param array $pluginsPool
*/
private function recursiveLoadPlugin($plugin, $pluginsPool)
{
if ($plugin->loadingState != "") {
return;
}
$dependencies = $plugin->getDependencies();
$plugin->loadingState = "lock";
foreach ($dependencies as $dependencyId) {
if (isset($pluginsPool[$dependencyId])) {
$this->recursiveLoadPlugin($pluginsPool[$dependencyId], $pluginsPool);
} else {
if (strpos($dependencyId, "+") !== false) {
foreach (array_keys($pluginsPool) as $pId) {
if (strpos($pId, str_replace("+", "", $dependencyId)) === 0) {
$this->recursiveLoadPlugin($pluginsPool[$pId], $pluginsPool);
}
}
}
}
}
$plugType = $plugin->getType();
if (!isset($this->registry[$plugType])) {
$this->registry[$plugType] = array();
}
$options = $this->confStorage->loadPluginConfig($plugType, $plugin->getName());
if ($plugin->isEnabled() || isset($options["AJXP_PLUGIN_ENABLED"]) && $options["AJXP_PLUGIN_ENABLED"] === true) {
$plugin = $this->instanciatePluginClass($plugin);
}
$plugin->loadConfigs($options);
$this->registry[$plugType][$plugin->getName()] = $plugin;
$plugin->loadingState = "loaded";
}
示例3: recursiveLoadPlugin
/**
* Load plugin class with dependencies first
*
* @param AJXP_Plugin $plugin
*/
private function recursiveLoadPlugin($plugin, $pluginsPool)
{
if ($plugin->loadingState != "") {
//print("<div style='padding-left:30px;'>--- Pluging ".$plugin->getId()." already loaded</div>");
return;
}
//print("<div style='padding-left:30px;'>--- Loading ".$plugin->getId());
$dependencies = $plugin->getDependencies();
$plugin->loadingState = "lock";
foreach ($dependencies as $dependencyId) {
if (isset($pluginsPool[$dependencyId])) {
$this->recursiveLoadPlugin($pluginsPool[$dependencyId], $pluginsPool);
}
}
$plugType = $plugin->getType();
if (!isset($this->registry[$plugType])) {
$this->registry[$plugType] = array();
}
$plugin = $this->instanciatePluginClass($plugin);
if (is_file($this->confFolder . "/conf." . $plugin->getId() . ".inc")) {
$plugin->loadConfig($this->confFolder . "/conf." . $plugin->getId() . ".inc", "inc");
}
$this->registry[$plugType][$plugin->getName()] = $plugin;
$plugin->loadingState = "loaded";
//print("</div>");
}