• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP PluginManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: 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


示例2: instance

 public static function instance()
 {
     if (!self::$instance) {
         self::$instance = new PluginManager(PluginFactory::instance(), EventManager::instance(), new SiteCache());
     }
     return self::$instance;
 }
开发者ID:ranjanasim,项目名称:tuleap,代码行数:7,代码来源:PluginManager.class.php


示例3: __construct

 function __construct($context, &$values = array(), &$args = array(), &$errors = array())
 {
     //Notice: There's no difference in sending an empty $values array
     //or sending no value at all. Should this be detected?
     $action = $context->getAction();
     if (!isset(self::$id_count[$action])) {
         self::$id_count[$action] = 0;
     }
     $this->_id = strtolower(get_class($this) . '_' . $action . '_' . ++self::$id_count[$action]);
     $this->_raw_value = (array) $values;
     $this->_context = $context;
     $this->args = (array) $args;
     $this->load = new Loader($context);
     $this->db = new DatabaseProxy($this->load);
     $this->plugin = PluginManager::getInstance()->getPluginList();
     $this->lang = $this->load->lang();
     $this->session = new Session($context->getModule());
     $this->valid = $this->load->validator('/phaxsi/validator');
     $this->helper = new HelperLoader($this->load);
     if (empty($this->_raw_value)) {
         if ($flash = Session::getFlash($this->_id)) {
             $this->_raw_value = $flash['values'];
             $this->_errors = $flash['errors'];
         }
     }
     if ($errors) {
         $this->_errors = array_merge((array) $this->_errors, $errors);
     }
     $create_method_ptr = array(&$this, $this->_context->getAction());
     if (is_callable($create_method_ptr)) {
         call_user_func($create_method_ptr);
     } else {
         trigger_error("Form '" . $this->_context->getPath() . "' does not exist.", E_USER_ERROR);
     }
 }
开发者ID:RNKushwaha022,项目名称:orange-php,代码行数:35,代码来源:form.base.php


示例4: activatePlugins

 public function activatePlugins()
 {
     $this->activatePlugin('docman');
     PluginManager::instance()->invalidateCache();
     PluginManager::instance()->loadPlugins();
     return $this;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:TestDataBuilder.php


示例5: __construct

 public function __construct()
 {
     parent::__construct();
     $userRepository = new UserRepository();
     $this->presenter = new ManageReservationsPresenter($this, new ScheduleAdminManageReservationsService(new ReservationViewRepository(), $userRepository, new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization())), new ScheduleAdminScheduleRepository($userRepository, ServiceLocator::GetServer()->GetUserSession()), new ResourceAdminResourceRepository($userRepository, ServiceLocator::GetServer()->GetUserSession()), new AttributeService(new AttributeRepository()), new UserPreferenceRepository());
     $this->SetPageId('manage-reservations-schedule-admin');
 }
开发者ID:ksdtech,项目名称:booked,代码行数:7,代码来源:ScheduleAdminManageReservationsPage.php


示例6: __construct

 public function __construct()
 {
     if (isset($_SESSION['odinUserLogged'])) {
         Logger::getLogger('odin')->debug('User zalogowany');
     }
     $this->db = PluginManager::getInstance()->getPlugin('creole')->getC();
 }
开发者ID:BackupTheBerlios,项目名称:nodin-svn,代码行数:7,代码来源:Authentication.php


示例7: 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;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:PluginManager.class.php


示例8: __construct

 public function __construct()
 {
     parent::__construct();
     $this->presenter = new ManageReservationsPresenter($this, new GroupAdminManageReservationsService(new ReservationViewRepository(), new UserRepository(), new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization())), new ScheduleRepository(), new ResourceRepository(), new AttributeService(new AttributeRepository()), new UserPreferenceRepository());
     $this->SetCanUpdateResourceStatus(false);
     $this->SetPageId('manage-reservations-group-admin');
 }
开发者ID:ksdtech,项目名称:booked,代码行数:7,代码来源:manage_group_reservations.php


示例9: AdminAction

 /**
  * Constructor.
  *
  * @param actionInfo An ActionInfo object as provided by the constroller
  * @param request A valid HTTP request
  */
 function AdminAction($actionInfo, $request)
 {
     $this->Action($actionInfo, $request);
     // get information about the session
     $session = HttpVars::getSession();
     $this->_session = $session["SessionInfo"];
     $this->_config =& Config::getConfig();
     // get the information about the user and quit if we don't have it...
     $this->_getUserInfo();
     if ($this->_userInfo == "") {
         header("HTTP/1.0 403 Forbidden");
         print $this->mustAuthenticatePage();
         die;
     }
     // do the same with the information about the blog
     $this->_getBlogInfo();
     if ($this->_blogInfo == "") {
         if ($this->_actionInfo->getActionParamValue() != "blogSelect") {
             header("HTTP/1.0 403 Forbidden");
             print $this->mustAuthenticatePage();
             die;
         }
     }
     // prepare the plugin manager in case we'd like to throw events
     $this->_pm =& PluginManager::getPluginManager();
     // fetch the site locale
     $this->_locale =& $this->getLocale();
     $users =& new Users();
     $this->_userBlogs = $users->getUsersBlogs($this->_userInfo->getId(), BLOG_STATUS_ACTIVE);
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:36,代码来源:adminaction.class.php


示例10: fire

    /**
     * Execute the console command.
     *
     * @return void
     */
    public function fire()
    {
        /** @var $plugin PluginBootstrap */
        \PluginManager::sync();
        if ($collection = \PluginManager::getPluginCollection() and count($collection) > 0) {
            /** @var Table $table */
            $table = new Table($this->getOutput());
            $table->setHeaders(['name', 'version', 'description', 'active', 'installed']);
            $rows = [];
            foreach ($collection as $plugin) {
                $rows[] = [$plugin->getName(), $plugin->getVersion(), $plugin->getDescription(), $plugin->isActive() ? 'yes' : 'no', $plugin->isInstalled() ? 'yes' : 'no'];
            }
            $table->setRows($rows);
            $table->render();
        } else {
            $line = <<<EVO
<info>no plugins avalaible</info>
EVO;
            $this->line($line);
        }
        /*$this->line(<<<EOF
        The <info>%command.name%</info> command lists all commands:
        
            <info>php %command.full_name%</info>
        
        You can also display the commands for a specific namespace:
        EOF
        );*/
        //$this->line('Alle Plugins.asdkjashdkash');
    }
开发者ID:lava83,项目名称:lavaproto,代码行数:35,代码来源:PluginList.php


示例11: 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];
 }
开发者ID:nickl-,项目名称:tuleap,代码行数:14,代码来源:fulltextsearchPlugin.class.php


示例12: __construct

 /**
  *
  * @param $reservationAuthorization IReservationAuthorization
  */
 public function __construct($reservationAuthorization = null)
 {
     $this->reservationAuthorization = $reservationAuthorization;
     if (is_null($this->reservationAuthorization)) {
         $this->reservationAuthorization = new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization());
     }
 }
开发者ID:utn-frm-si,项目名称:booked,代码行数:11,代码来源:PrivacyFilter.php


示例13: 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;
 }
开发者ID:rros,项目名称:Shaarli,代码行数:12,代码来源:PluginManager.php


示例14: perform

 /**
  * Performs the action.
  */
 function perform()
 {
     // fetch the articles for the given blog
     $articles = new Articles();
     $blogSettings = $this->_blogInfo->getSettings();
     $localeCode = $blogSettings->getValue("locale");
     // fetch the default profile as chosen by the administrator
     $defaultProfile = $this->_config->getValue("default_rss_profile");
     if ($defaultProfile == "" || $defaultProfile == null) {
         $defaultProfile = DEFAULT_PROFILE;
     }
     // fetch the profile
     // if the profile specified by the user is not valid, then we will
     // use the default profile as configured
     $profile = $this->_request->getValue("profile");
     if ($profile == "") {
         $profile = $defaultProfile;
     }
     // fetch the category, or set it to '0' otherwise, which will mean
     // fetch all the most recent posts from any category
     $categoryId = $this->_request->getValue("categoryId");
     if (!is_numeric($categoryId)) {
         $categoryId = 0;
     }
     // check if the template is available
     $this->_view = new RssView($this->_blogInfo, $profile, array("profile" => $profile, "categoryId" => $categoryId));
     // do nothing if the view was already cached
     if ($this->_view->isCached()) {
         return true;
     }
     // create an instance of a locale object
     $locale = Locales::getLocale($localeCode);
     // fetch the posts, though we are going to fetch the same amount in both branches
     $amount = $blogSettings->getValue("recent_posts_max", 15);
     $t = new Timestamp();
     if ($blogSettings->getValue('show_future_posts_in_calendar')) {
         $blogArticles = $articles->getBlogArticles($this->_blogInfo->getId(), -1, $amount, $categoryId, POST_STATUS_PUBLISHED, 0);
     } else {
         $today = $t->getTimestamp();
         $blogArticles = $articles->getBlogArticles($this->_blogInfo->getId(), -1, $amount, $categoryId, POST_STATUS_PUBLISHED, 0, $today);
     }
     $pm =& PluginManager::getPluginManager();
     $pm->setBlogInfo($this->_blogInfo);
     $pm->setUserInfo($this->_userInfo);
     $result = $pm->notifyEvent(EVENT_POSTS_LOADED, array('articles' => &$blogArticles));
     $articles = array();
     foreach ($blogArticles as $article) {
         $postText = $article->getIntroText();
         $postExtendedText = $article->getExtendedText();
         $pm->notifyEvent(EVENT_TEXT_FILTER, array("text" => &$postText));
         $pm->notifyEvent(EVENT_TEXT_FILTER, array("text" => &$postExtendedText));
         $article->setIntroText($postText);
         $article->setExtendedText($postExtendedText);
         array_push($articles, $article);
     }
     $this->_view->setValue("locale", $locale);
     $this->_view->setValue("posts", $articles);
     $this->setCommonData();
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:63,代码来源:rssaction.class.php


示例15: __construct

 /**
  * @param IReservationViewRepository $reservationViewRepository
  * @param IReservationAuthorization $authorization
  * @param IReservationHandler $reservationHandler
  * @param IUpdateReservationPersistenceService $persistenceService
  */
 public function __construct(IReservationViewRepository $reservationViewRepository, $authorization = null, $reservationHandler = null, $persistenceService = null)
 {
     $this->reservationViewRepository = $reservationViewRepository;
     $this->reservationAuthorization = $authorization == null ? new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization()) : $authorization;
     $this->persistenceService = $persistenceService == null ? new UpdateReservationPersistenceService(new ReservationRepository()) : $persistenceService;
     $this->reservationHandler = $reservationHandler == null ? ReservationHandler::Create(ReservationAction::Update, $this->persistenceService, ServiceLocator::GetServer()->GetUserSession()) : $reservationHandler;
 }
开发者ID:hugutux,项目名称:booked,代码行数:13,代码来源:ManageReservationsService.php


示例16: trigger_automaticupdate_action

 public function trigger_automaticupdate_action($class)
 {
     $output = array();
     if (Request::isPost()) {
         $plugin = PluginManager::getInstance()->getPluginInfo($class);
         $low_cost_secret = md5($GLOBALS['STUDIP_INSTALLATION_ID'] . $plugin['id']);
         if ($plugin['automatic_update_url'] && $low_cost_secret === \Request::option("s")) {
             if ($plugin['automatic_update_secret'] && !$this->verify_secret($plugin['automatic_update_secret'])) {
                 $output['error'] = "Incorrect payload.";
             } else {
                 //everything fine, we can download and install the plugin
                 $update_url = $plugin['automatic_update_url'];
                 require_once 'app/models/plugin_administration.php';
                 $plugin_admin = new PluginAdministration();
                 try {
                     $plugin_admin->installPluginFromURL($update_url);
                 } catch (Exception $e) {
                     $output['exception'] = $e->getMessage();
                 }
             }
         } else {
             $output['error'] = "Wrong URL.";
         }
         if (!count($output)) {
             $output['message'] = "ok";
         }
     } else {
         $output['error'] = "Only POST requests allowed.";
     }
     $this->render_json($output);
 }
开发者ID:ratbird,项目名称:hope,代码行数:31,代码来源:plugins.php


示例17: perform

 /**
  * Carries out the specified action
  */
 function perform()
 {
     // get the parameters, which have already been validated
     $this->_userName = Textfilter::filterAllHTML($this->_request->getValue("userName"));
     $this->_userPassword = $this->_request->getValue("userPassword");
     $this->_op = Textfilter::filterAllHTML($this->_request->getValue("op"));
     // create a plugin manager
     $pm =& PluginManager::getPluginManager();
     // try to authenticate the user
     $users = new Users();
     if (!$users->authenticateUser($this->_userName, $this->_userPassword)) {
         $this->_view = new AdminDefaultView();
         $this->_view->setErrorMessage($this->_locale->tr("error_incorrect_username_or_password"));
         $this->setCommonData();
         $pm->notifyEvent(EVENT_LOGIN_FAILURE, array("user" => $this->_userName));
         return false;
     }
     // if the user is correct, get and put his or her information in the session
     $userInfo = $users->getUserInfo($this->_userName, $this->_userPassword);
     if (!$userInfo) {
         $this->_view = new AdminDefaultView();
         $this->_view->setErrorMessage($this->_locale->tr("error_incorrect_username_or_password"));
         $this->setCommonData();
         $pm->notifyEvent(EVENT_LOGIN_FAILURE, array("user" => $this->_userName));
         return false;
     }
     $pm->notifyEvent(EVENT_USER_LOADED, array("user" => &$userInfo, "from" => "Login"));
     //$sessionInfo = $_SESSION["SessionInfo"];
     $session = HttpVars::getSession();
     $sessionInfo = $session["SessionInfo"];
     $sessionInfo->setValue("userInfo", $userInfo);
     $session["SessionInfo"] = $sessionInfo;
     HttpVars::setSession($session);
     // get the list of blogs to which the user belongs
     $userBlogs = $users->getUsersBlogs($userInfo->getId(), BLOG_STATUS_ACTIVE);
     // but if he or she does not belong to any yet, we quit
     if (empty($userBlogs)) {
         $this->_view = new AdminDefaultView();
         $this->_view->setErrorMessage($this->_locale->tr("error_dont_belong_to_any_blog"));
         $this->setCommonData();
         return false;
     }
     $pm->notifyEvent(EVENT_BLOGS_LOADED, array("blogs" => &$userBlogs, "from" => "Login"));
     // check if we are skipping the dashboard
     if ($this->_config->getValue("skip_dashboard")) {
         // get the first blog that came
         $this->_blogInfo = end($userBlogs);
         // set it in the session
         $session = HttpVars::getSession();
         $session["SessionInfo"]->setValue("blogInfo", $this->_blogInfo);
         HttpVars::setSession($session);
         // and then continue...
         AdminController::setForwardAction("newPost");
     } else {
         $this->_view = new AdminDashboardView($userInfo, $userBlogs);
     }
     // better to return true if everything's fine
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:62,代码来源:adminloginaction.class.php


示例18: __construct

 public function __construct()
 {
     $authorization = new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization());
     $service = new CalendarSubscriptionService(new UserRepository(), new ResourceRepository(), new ScheduleRepository());
     $subscriptionValidator = new CalendarSubscriptionValidator($this, $service);
     $this->presenter = new CalendarSubscriptionPresenter($this, new ReservationViewRepository(), $subscriptionValidator, $service, new PrivacyFilter($authorization));
     parent::__construct('', 1);
 }
开发者ID:hugutux,项目名称:booked,代码行数:8,代码来源:AtomSubscriptionPage.php


示例19: _render

 protected function _render()
 {
     $manager = PluginManager::getInstance();
     $manager->renderStart($this->context);
     $html = $this->view->render();
     $manager->renderEnd($this->context);
     return $html;
 }
开发者ID:RNKushwaha022,项目名称:orange-php,代码行数:8,代码来源:abstract_controller.class.php


示例20: SetAuthentication

 /**
  * @param IWebAuthentication $authentication
  */
 private function SetAuthentication($authentication)
 {
     if (is_null($authentication)) {
         $this->authentication = new WebAuthentication(PluginManager::Instance()->LoadAuthentication(), ServiceLocator::GetServer());
     } else {
         $this->authentication = $authentication;
     }
 }
开发者ID:Trideon,项目名称:gigolo,代码行数:11,代码来源:LoginPresenter.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP PluginMonitoringProfile类代码示例发布时间:2022-05-23
下一篇:
PHP PluginHost类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap