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


PHP DbHelper::createAnonymousUser方法代码示例

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


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

示例1: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     DbHelper::createAnonymousUser();
     // the api_internal_call.php uses idSite=7, so we create 7 sites
     for ($i = 0; $i != 7; ++$i) {
         Fixture::createWebsite("2011-01-01 00:00:00", $ecommerce = 1, $siteName = "Site #{$i}");
     }
     // the script uses anonymous token auth, so give the anonymous user access
     \Piwik\Plugins\UsersManager\API::getInstance()->setUserAccess('anonymous', 'view', array(7));
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:11,代码来源:ExternalScriptsTest.php

示例2: setUp

 public function setUp()
 {
     parent::setUp();
     self::updateDatabase();
     // make sure site has an early enough creation date (for period selector tests)
     Db::get()->update(Common::prefixTable("site"), array('ts_created' => '2011-01-01'), "idsite = 1");
     $this->addOverlayVisits();
     $this->addNewSitesForSiteSelector();
     DbHelper::createAnonymousUser();
     UsersManagerAPI::getInstance()->setSuperUserAccess('superUserLogin', true);
     SitesManagerAPI::getInstance()->updateSite(1, null, null, true);
 }
开发者ID:TensorWrenchOSS,项目名称:piwik,代码行数:12,代码来源:UITestFixture.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     // make sure site has an early enough creation date (for period selector tests)
     Db::get()->update(Common::prefixTable("site"), array('ts_created' => '2011-01-01'), "idsite = 1");
     $this->addOverlayVisits();
     $this->addNewSitesForSiteSelector();
     DbHelper::createAnonymousUser();
     UsersManagerAPI::getInstance()->setSuperUserAccess('superUserLogin', true);
     Option::set("Tests.forcedNowTimestamp", $this->now->getTimestamp());
     // launch archiving so tests don't run out of time
     $date = Date::factory($this->dateTime)->toString();
     VisitsSummaryAPI::getInstance()->get($this->idSite, 'year', $date);
     VisitsSummaryAPI::getInstance()->get($this->idSite, 'year', $date, urlencode($this->segment));
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:15,代码来源:UITestFixture.php

示例4: setUp

 public function setUp()
 {
     self::downloadGeoIpDbs();
     parent::setUp();
     self::updateDatabase();
     // make sure site has an early enough creation date (for period selector tests)
     Db::get()->update(Common::prefixTable("site"), array('ts_created' => '2011-01-01'), "idsite = 1");
     // for proper geolocation
     LocationProvider::setCurrentProvider(LocationProvider\GeoIp\Php::ID);
     IPAnonymizer::deactivate();
     $this->addOverlayVisits();
     $this->addNewSitesForSiteSelector();
     DbHelper::createAnonymousUser();
     UsersManagerAPI::getInstance()->setSuperUserAccess('superUserLogin', true);
     SitesManagerAPI::getInstance()->updateSite(1, null, null, true);
     // create non super user
     UsersManagerAPI::getInstance()->addUser('oliverqueen', 'smartypants', 'oli@queenindustries.com');
     UsersManagerAPI::getInstance()->setUserAccess('oliverqueen', 'view', array(1));
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:19,代码来源:UITestFixture.php

示例5: tablesCreation

 /**
  * Installation Step 4: Table Creation
  */
 function tablesCreation()
 {
     $this->checkPiwikIsNotInstalled();
     $view = new View('@Installation/tablesCreation', $this->getInstallationSteps(), __FUNCTION__);
     if ($this->getParam('deleteTables')) {
         Manager::getInstance()->clearPluginsInstalledConfig();
         Db::dropAllTables();
         $view->existingTablesDeleted = true;
     }
     $tablesInstalled = DbHelper::getTablesInstalled();
     $view->tablesInstalled = '';
     if (count($tablesInstalled) > 0) {
         // we have existing tables
         $view->tablesInstalled = implode(', ', $tablesInstalled);
         $view->someTablesInstalled = true;
         Access::getInstance();
         Piwik::setUserHasSuperUserAccess();
         if ($this->hasEnoughTablesToReuseDb($tablesInstalled) && count(APISitesManager::getInstance()->getAllSitesId()) > 0 && count(APIUsersManager::getInstance()->getUsers()) > 0) {
             $view->showReuseExistingTables = true;
         }
     } else {
         DbHelper::createTables();
         DbHelper::createAnonymousUser();
         $this->updateComponents();
         Updater::recordComponentSuccessfullyUpdated('core', Version::VERSION);
         $view->tablesCreated = true;
         $view->showNextStep = true;
     }
     return $view->render();
 }
开发者ID:brienomatty,项目名称:elmsln,代码行数:33,代码来源:Controller.php

示例6: testAuthenticateSuccessAnonymous

 /**
  * @group Plugins
  */
 public function testAuthenticateSuccessAnonymous()
 {
     DbHelper::createAnonymousUser();
     // valid login & token auth
     $rc = $this->authenticate($login = 'anonymous', $authToken = 'anonymous');
     $this->assertUserLogin($rc, $login = 'anonymous', $tokenLength = 9);
 }
开发者ID:TensorWrenchOSS,项目名称:piwik,代码行数:10,代码来源:LoginTest.php

示例7: tablesCreation

 /**
  * Installation Step 5: Table Creation
  */
 function tablesCreation()
 {
     $this->checkPreviousStepIsValid(__FUNCTION__);
     $view = new View('@Installation/tablesCreation', $this->getInstallationSteps(), __FUNCTION__);
     $this->skipThisStep(__FUNCTION__);
     $this->createDbFromSessionInformation();
     if (Common::getRequestVar('deleteTables', 0, 'int') == 1) {
         DbHelper::dropTables();
         $view->existingTablesDeleted = true;
         // when the user decides to drop the tables then we dont skip the next steps anymore
         // workaround ZF-1743
         $tmp = $this->session->skipThisStep;
         $tmp['firstWebsiteSetup'] = false;
         $tmp['trackingCode'] = false;
         $this->session->skipThisStep = $tmp;
     }
     $tablesInstalled = DbHelper::getTablesInstalled();
     $view->tablesInstalled = '';
     if (count($tablesInstalled) > 0) {
         // we have existing tables
         $view->tablesInstalled = implode(', ', $tablesInstalled);
         $view->someTablesInstalled = true;
         // remove monthly archive tables
         $archiveTables = ArchiveTableCreator::getTablesArchivesInstalled();
         $baseTablesInstalled = count($tablesInstalled) - count($archiveTables);
         $minimumCountPiwikTables = 17;
         Access::getInstance();
         Piwik::setUserIsSuperUser();
         if ($baseTablesInstalled >= $minimumCountPiwikTables && count(APISitesManager::getInstance()->getAllSitesId()) > 0 && count(APIUsersManager::getInstance()->getUsers()) > 0) {
             $view->showReuseExistingTables = true;
             // when the user reuses the same tables we skip the website creation step
             // workaround ZF-1743
             $tmp = $this->session->skipThisStep;
             $tmp['firstWebsiteSetup'] = true;
             $tmp['trackingCode'] = true;
             $this->session->skipThisStep = $tmp;
         }
     } else {
         DbHelper::createTables();
         DbHelper::createAnonymousUser();
         Updater::recordComponentSuccessfullyUpdated('core', Version::VERSION);
         $view->tablesCreated = true;
         $view->showNextStep = true;
     }
     $this->session->currentStepDone = __FUNCTION__;
     return $view->render();
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:50,代码来源:Controller.php

示例8: installDatabase

 /**
  * inits the Piwik DB
  * @return void
  */
 public function installDatabase()
 {
     $this->initPiwikDatabase(TRUE);
     $tablesInstalled = \Piwik\DbHelper::getTablesInstalled();
     if (count($tablesInstalled) == 0) {
         \Piwik\DbHelper::createTables();
         \Piwik\DbHelper::createAnonymousUser();
         $updater = new \Piwik\Updater();
         //set Piwikversion
         $updater->recordComponentSuccessfullyUpdated('core', \Piwik\Version::VERSION);
     }
 }
开发者ID:heiko-hardt,项目名称:TYPO3.piwikintegration,代码行数:16,代码来源:Config.php


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