当前位置: 首页>>代码示例>>PHP>>正文


PHP PluginManager::installPlugin方法代码示例

本文整理汇总了PHP中PluginManager::installPlugin方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginManager::installPlugin方法的具体用法?PHP PluginManager::installPlugin怎么用?PHP PluginManager::installPlugin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PluginManager的用法示例。


在下文中一共展示了PluginManager::installPlugin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: install

 function install()
 {
     $request =& HTTPRequest::instance();
     $name = $request->get('name');
     if ($name) {
         $this->plugin_manager->installPlugin($name);
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:PluginsAdministrationActions.class.php

示例2: activatePlugin

function activatePlugin($name) {
    $plugin_factory = PluginFactory::instance();
    $plugin = $plugin_factory->getPluginByName($name);
    if (! $plugin) {
        echo "Install plugin\n";
        $plugin_manager = new PluginManager();
        $plugin = $plugin_manager->installPlugin($name);
    }
    if (! $plugin_factory->isPluginAvailable($plugin)) {
        echo "Activate plugin\n";
        $plugin_factory->availablePlugin($plugin);
    }
}
开发者ID:rinodung,项目名称:tuleap,代码行数:13,代码来源:activate_plugin.php

示例3: dirname

 */
require_once dirname(__FILE__) . '/../../includes/core/init.php';
$self = array_shift($argv);
$action = array_shift($argv);
$target = array_shift($argv);
if (!in_array($action, array('install', 'update', 'uninstall'))) {
    die('Unknown action "' . $action . '", see "help"' . "\n");
}
if ($action == 'help') {
    echo 'Usage : ' . $self . ' <action> <target>' . "\n";
    echo "\n";
    echo "\t" . 'action must be "install", "update" or "uninstall"' . "\n";
    echo "\t" . 'target is the name of th plugin to act upon' . "\n";
    exit(0);
}
try {
    switch ($action) {
        case 'install':
            PluginManager::installPlugin($target);
            break;
        case 'update':
            PluginManager::updatePlugin($target);
            break;
        case 'uninstall':
            PluginManager::uninstallPlugin($target);
            break;
    }
} catch (Exception $e) {
    die('Exception : ' . $e->getMessage() . "\n");
}
exit(0);
开发者ID:eheb,项目名称:renater-decide,代码行数:31,代码来源:plugin.php

示例4: testInstallPlugin

 function testInstallPlugin()
 {
     $GLOBALS['sys_pluginsroot'] = dirname(__FILE__) . '/test/custom/';
     $GLOBALS['sys_custompluginsroot'] = dirname(__FILE__) . '/test/custom/';
     $GLOBALS['sys_pluginsroot'] = dirname(__FILE__) . '/test/custom/';
     mkdir(dirname(__FILE__) . '/test');
     mkdir(dirname(__FILE__) . '/test/custom');
     //The plugins
     $plugin = new MockPlugin($this);
     //The plugin factory
     $plugin_factory = new MockPluginFactory($this);
     $plugin_factory->expectOnce('createPlugin', array('New_Plugin'));
     $plugin_factory->setReturnReference('createPlugin', $plugin);
     stub($plugin_factory)->getAllPossiblePluginsDir()->returns(array(dirname(__FILE__) . '/test'));
     $forgeupgrade_config = mock('ForgeUpgradeConfig');
     expect($forgeupgrade_config)->addPath($GLOBALS['sys_pluginsroot'] . 'New_Plugin')->once();
     expect($forgeupgrade_config)->recordOnlyPath($GLOBALS['sys_pluginsroot'] . 'New_Plugin')->once();
     //The plugins manager
     $pm = new PluginManager($plugin_factory, mock('EventManager'), mock('SiteCache'), $forgeupgrade_config);
     $this->assertReference($pm->installPlugin('New_Plugin'), $plugin);
     // plugin manager must call postInstall 1 time on plugin after its creation
     $plugin->expectCallCount('postInstall', 1);
     // Plugin dir was created in "/etc"
     $this->assertTrue(is_dir(dirname(__FILE__) . '/test/custom/New_Plugin'));
     $this->_remove_directory(dirname(__FILE__) . '/test');
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:26,代码来源:PluginManagerTest.php


注:本文中的PluginManager::installPlugin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。