本文整理汇总了PHP中PluginManager::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginManager::instance方法的具体用法?PHP PluginManager::instance怎么用?PHP PluginManager::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginManager
的用法示例。
在下文中一共展示了PluginManager::instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstance
/**
* Singleton
* @static
*/
public static function getInstance()
{
if (self::$instance == null) {
self::$instance = new self();
}
return self::$instance;
}
示例2: getInstance
/**
* Return existing instance of PluginManager, or create it.
*
* @return PluginManager instance.
*/
public static function getInstance()
{
if (!self::$instance instanceof self) {
self::$instance = new self();
}
return self::$instance;
}
示例3: isAllowed
/**
* Return true if given project has the right to use this plugin.
*
* @param string $group_id
*
* @return bool
*/
function isAllowed($group_id)
{
if (!isset($this->allowedForProject[$group_id])) {
$this->allowed_for_project[$group_id] = PluginManager::instance()->isPluginAllowedForProject($this, $group_id);
}
return $this->allowed_for_project[$group_id];
}
示例4: getInstance
/**
* The singleton pattern
* @static
* @return IssueCache
*/
public static function getInstance()
{
if (NULL == self::$instance) {
self::$instance = new PluginManager();
}
return self::$instance;
}
示例5: activatePlugins
public function activatePlugins()
{
$this->activatePlugin('docman');
PluginManager::instance()->invalidateCache();
PluginManager::instance()->loadPlugins();
return $this;
}
示例6: PluginsAdministrationViews
function PluginsAdministrationViews(&$controler, $view = null)
{
$this->View($controler, $view);
$this->plugin_manager = PluginManager::instance();
$this->dependency_solver = new PluginDependencySolver($this->plugin_manager);
$this->renderer = TemplateRendererFactory::build()->getRenderer(PLUGINSADMINISTRATION_TEMPLATE_DIR);
}
示例7: instance
public static function instance()
{
if (!self::$instance) {
self::$instance = new PluginManager(PluginFactory::instance(), EventManager::instance(), new SiteCache());
}
return self::$instance;
}
示例8: __construct
public function __construct(EventManager $event_manager)
{
$this->event_manager = $event_manager;
$this->renderer = TemplateRendererFactory::build()->getRenderer(array(ForgeConfig::get('codendi_dir') . '/src/templates/search'));
$this->search_types = array(Search_SearchTrackerV3::NAME => new Search_SearchTrackerV3(new ArtifactDao()), Search_SearchProject::NAME => new Search_SearchProject(new ProjectDao()), Search_SearchPeople::NAME => new Search_SearchPeople(UserManager::instance()), Search_SearchForum::NAME => new Search_SearchForum(new ForumDao()), Search_SearchSnippet::NAME => new Search_SearchSnippet(new SnippetDao()), Search_SearchWiki::NAME => new Search_SearchWiki(new WikiDao()));
$this->plugin_manager = PluginManager::instance();
}
示例9: instance
public static function instance()
{
if (!self::$instance) {
self::$instance = new PluginManager(PluginFactory::instance(), EventManager::instance(), new SiteCache(), new ForgeUpgradeConfig(new System_Command()));
}
return self::$instance;
}
示例10: container
public function container()
{
$id = URI::instance()->segment(3, false);
$p = ORM::factory('plugin_instance', $id);
if ($p->loaded) {
echo PluginManager::instance()->get_plugin($p)->render();
}
}
示例11: instance
public static function instance($dir = false)
{
//var_dump(self::$instance);
if (self::$instance == false) {
self::$instance = new PluginManager($dir);
}
return self::$instance;
}
示例12: getInstance
static function getInstance()
{
if (!self::$instance) {
$plugin = self::$instance = new PluginManager();
$plugin->loadPlugins();
}
return self::$instance;
}
示例13: instance
/**
* @return GitConfig
*/
public static function instance()
{
if (!isset(self::$_instance)) {
$plugin = PluginManager::instance()->getPluginByName('git');
$driver = new GitDriver();
self::$_instance = new GitConfig($plugin, $driver);
}
return self::$_instance;
}
示例14: process
public function process(HTTPRequest $request)
{
if (!PluginManager::instance()->isPluginAllowedForProject($this, $request->getProject()->getId())) {
$GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_svn_manage_repository', 'plugin_not_activated'));
$GLOBALS['Response']->redirect('/projects/' . $request->getProject()->getUnixNameMixedCase() . '/');
} else {
$this->getRouter()->route($request);
}
}
示例15: isRestricted
/**
* Say if the service is restricted
*
* @param Project $project
*
* @return bool
*/
public function isRestricted()
{
$plugin_manager = PluginManager::instance();
$p = $plugin_manager->getPluginByName('tracker');
if ($p && $plugin_manager->isProjectPluginRestricted($p)) {
return true;
}
return false;
}