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


PHP PluginRegistrarWebapp::getInstance方法代码示例

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


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

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     $webapp_plugin_registrar->registerPlugin('googleplus', 'GooglePlusPlugin');
     $_SERVER['SERVER_NAME'] = 'test';
 }
开发者ID:dgw,项目名称:ThinkUp,代码行数:7,代码来源:TestOfGooglePlusPluginConfigurationController.php

示例2: adminControl

 public function adminControl()
 {
     if (!$this->is_missing_param) {
         // verify CSRF token
         $this->validateCSRFToken();
         $is_active = $_GET["a"] != 1 ? false : true;
         $plugin_dao = DAOFactory::getDAO('PluginDAO');
         $result = $plugin_dao->setActive($_GET["pid"], $is_active);
         if ($result > 0) {
             $plugin_folder = $plugin_dao->getPluginFolder($_GET["pid"]);
             $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
             try {
                 $plugin_class_name = $webapp_plugin_registrar->getPluginObject($plugin_folder);
                 $p = new $plugin_class_name();
                 if ($is_active) {
                     $p->activate();
                 } else {
                     $p->deactivate();
                 }
             } catch (Exception $e) {
                 //plugin object isn't registered, do nothing
                 //echo $e->getMessage();
             }
         }
         $this->addToView('result', $result);
         $this->view_mgr->clear_all_cache();
     }
     return $this->generateView();
 }
开发者ID:JWFoxJr,项目名称:ThinkUp,代码行数:29,代码来源:class.ToggleActivePluginController.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     $webapp_plugin_registrar->registerPlugin('youtube', 'YouTubePlugin');
     $webapp_plugin_registrar->setActivePlugin('youtube');
 }
开发者ID:dgw,项目名称:ThinkUp,代码行数:7,代码来源:TestOfYouTubePlugin.php

示例4: loadView

 /**
  * Load the view with required variables
  */
 private function loadView()
 {
     $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     if ($this->view_name == 'default') {
         $this->loadDefaultDashboard();
     } else {
         $menu_item = $webapp_plugin_registrar->getDashboardMenuItem($this->view_name, $this->instance);
         if (isset($menu_item)) {
             $this->addToView('data_template', $menu_item->view_template);
             $this->addToView('display', $this->view_name);
             $this->addToView('header', $menu_item->name);
             $this->addToView('description', $menu_item->description);
             $this->addToView('parent', $menu_item->parent);
             $this->setPageTitle($this->instance->network_username . ' on ' . ucfirst($this->instance->network));
             $page = isset($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : 1;
             foreach ($menu_item->datasets as $dataset) {
                 if (array_search('#page_number#', $dataset->method_params) !== false) {
                     //there's paging
                     $this->addToView('next_page', $page + 1);
                     $this->addToView('last_page', $page - 1);
                 }
                 $this->addToView($dataset->name, $dataset->retrieveDataset($page));
                 if (Session::isLoggedIn() && $dataset->isSearchable()) {
                     $view_name = 'is_searchable';
                     $this->addToView($view_name, true);
                 }
                 $this->view_mgr->addHelp($this->view_name, $dataset->getHelp());
             }
         } else {
             $this->loadDefaultDashboard();
         }
     }
 }
开发者ID:JWFoxJr,项目名称:ThinkUp,代码行数:36,代码来源:class.DashboardController.php

示例5: setUp

 public function setUp()
 {
     parent::setUp();
     $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     $webapp_plugin_registrar->registerPlugin('twitter', 'TwitterPlugin');
     $this->builders = self::buildData();
 }
开发者ID:pepeleproso,项目名称:ThinkUp,代码行数:7,代码来源:TestOfTwitterPluginConfigurationController.php

示例6: setUp

 public function setUp()
 {
     parent::setUp();
     $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     $webapp_plugin_registrar->registerPlugin('twitter', 'TwitterPlugin');
     $this->config = Config::getInstance();
 }
开发者ID:73sl4,项目名称:ThinkUp,代码行数:7,代码来源:TestOfPostController.php

示例7: setUp

 public function setUp()
 {
     parent::setUp();
     $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     $webapp_plugin_registrar->registerPlugin('twitter', 'TwitterPlugin');
     $webapp_plugin_registrar->registerPlugin('facebook', 'FacebookPlugin');
     $webapp_plugin_registrar->registerPlugin('google+', 'GooglePlusPlugin');
 }
开发者ID:JWFoxJr,项目名称:ThinkUp,代码行数:8,代码来源:TestOfDashboardController.php

示例8: setUp

 public function setUp()
 {
     parent::setUp();
     $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     $webapp_plugin_registrar->registerPlugin('geoencoder', 'GeoEncoderPlugin');
     $_SERVER['SERVER_NAME'] = 'dev.thinkup.com';
     $_SERVER['HTTP_HOST'] = 'dev.thinkup.com';
 }
开发者ID:dgw,项目名称:ThinkUp,代码行数:8,代码来源:TestOfGeoEncoderPluginConfigurationController.php

示例9: setUp

 public function setUp()
 {
     parent::setUp();
     $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     $webapp_plugin_registrar->registerPlugin('twitter', 'TwitterPlugin');
     $this->builders = self::buildData();
     $_SERVER['HTTP_HOST'] = "mytesthost";
     $_SERVER['SERVER_NAME'] = 'dev.thinkup.com';
 }
开发者ID:pepeleproso,项目名称:ThinkUp,代码行数:9,代码来源:TestOfAccountConfigurationController.php

示例10: testWebappGetSetActivePlugin

 /**
  * Test activePlugin getter/setter
  */
 public function testWebappGetSetActivePlugin()
 {
     $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     $this->assertEqual($webapp_plugin_registrar->getActivePlugin(), "twitter");
     $webapp_plugin_registrar->setActivePlugin('facebook');
     $this->assertEqual($webapp_plugin_registrar->getActivePlugin(), "facebook");
     //make sure another instance reports back the same values
     $webapp_plugin_registrar_two = PluginRegistrarWebapp::getInstance();
     $this->assertEqual($webapp_plugin_registrar_two->getActivePlugin(), "facebook");
 }
开发者ID:ngugijames,项目名称:ThinkUp,代码行数:13,代码来源:TestOfWebapp.php

示例11: setUp

 public function setUp()
 {
     parent::setUp();
     $this->webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     $this->webapp_plugin_registrar->registerPlugin('geoencoder', 'GeoEncoderPlugin');
     $this->webapp_plugin_registrar->registerPlugin('twitter', 'TwitterPlugin');
     $crawler_plugin_registrar = PluginRegistrarCrawler::getInstance();
     $crawler_plugin_registrar->registerCrawlerPlugin('GeoEncoderPlugin');
     $this->builders = self::buildData();
 }
开发者ID:dgw,项目名称:ThinkUp,代码行数:10,代码来源:TestOfGeoEncoderPlugin.php

示例12: setUp

 public function setUp()
 {
     parent::setUp();
     $this->webapp = PluginRegistrarWebapp::getInstance();
     $this->crawler = PluginRegistrarCrawler::getInstance();
     $this->webapp->registerPlugin('twitter', 'TwitterPlugin');
     $this->crawler->registerCrawlerPlugin('TwitterPlugin');
     $this->webapp->setActivePlugin('twitter');
     $this->logger = Logger::getInstance();
 }
开发者ID:ngugijames,项目名称:ThinkUp,代码行数:10,代码来源:TestOfTwitterPlugin.php

示例13: setUp

 public function setUp()
 {
     parent::setUp();
     $this->builders = array();
     $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     $webapp_plugin_registrar->registerPlugin('facebook', 'FacebookPlugin');
     $_SERVER['SERVER_NAME'] = 'dev.thinkup.com';
     $_SERVER['HTTP_HOST'] = 'dev.thinkup.com';
     $_SERVER['REQUEST_URI'] = '';
     //Add owners
     $owner_builder = FixtureBuilder::build('owners', array('id' => 1, 'full_name' => 'ThinkUp J. User', 'email' => 'me@example.com', 'is_activated' => 1));
     array_push($this->builders, $owner_builder);
     //Add second owner
     $owner2_builder = FixtureBuilder::build('owners', array('id' => 2, 'full_name' => 'ThinkUp J. User 2', 'email' => 'me2@example.com', 'is_activated' => 1));
     array_push($this->builders, $owner2_builder);
 }
开发者ID:pepeleproso,项目名称:ThinkUp,代码行数:16,代码来源:TestOfFacebookPluginConfigurationController.php

示例14: setUp

 /**
  * Initialize Config and Webapp objects, clear $_SESSION, $_POST, $_GET, $_REQUEST
  */
 public function setUp()
 {
     parent::setUp();
     Loader::register(array(THINKUP_ROOT_PATH . 'tests/', THINKUP_ROOT_PATH . 'tests/classes/', THINKUP_ROOT_PATH . 'tests/fixtures/'));
     $config = Config::getInstance();
     //disable caching for tests
     $config->setValue('cache_pages', false);
     //tests assume profiling is off
     $config->setValue('enable_profiler', false);
     if ($config->getValue('timezone')) {
         date_default_timezone_set($config->getValue('timezone'));
     }
     $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     $crawler_plugin_registrar = PluginRegistrarCrawler::getInstance();
     $this->DEBUG = getenv('TEST_DEBUG') !== false ? true : false;
     self::isTestEnvironmentReady();
 }
开发者ID:73sl4,项目名称:ThinkUp,代码行数:20,代码来源:class.ThinkUpBasicUnitTestCase.php

示例15: testMenuItemRegistration

 public function testMenuItemRegistration()
 {
     $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     $instance = new Instance();
     $instance->network_user_id = 1;
     $menus = $webapp_plugin_registrar->getDashboardMenu($instance);
     // We only have one menu so far, the checkins
     $this->assertEqual(sizeof($menus), 1);
     $post_tab = $menus['posts'];
     $this->assertEqual($post_tab->name, "Checkins");
     $this->assertEqual($post_tab->description, "Your checkins");
     $post_tab_datasets = $post_tab->getDatasets();
     $this->assertEqual(count($post_tab_datasets), 1);
     $post_tab_dataset = $post_tab_datasets[0];
     $this->assertEqual($post_tab_dataset->name, "all_checkins");
     $this->assertEqual($post_tab_dataset->dao_name, 'PostDAO');
     $this->assertEqual($post_tab_dataset->dao_method_name, "getAllCheckins");
 }
开发者ID:73sl4,项目名称:ThinkUp,代码行数:18,代码来源:TestOfFoursquarePlugin.php


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