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


PHP Piwik_SitesManager_API::getAllSitesId方法代码示例

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


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

示例1: update

 static function update()
 {
     // force regeneration of cache files following #648
     Piwik::setUserIsSuperUser();
     $allSiteIds = Piwik_SitesManager_API::getAllSitesId();
     Piwik_Common::regenerateCacheWebsiteAttributes($allSiteIds);
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:7,代码来源:0.2.34.php

示例2:

<?php

// force regeneration of cache files following #648
Piwik::setUserIsSuperUser();
$allSiteIds = Piwik_SitesManager_API::getAllSitesId();
Piwik_Common::regenerateCacheWebsiteAttributes($allSiteIds);
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:6,代码来源:0.2.34.php

示例3: reloadAccessSuperUser

	/**
	 * Reload super user access
	 *
	 * @return bool
	 */	
	protected function reloadAccessSuperUser()
	{
		$this->isSuperUser = true;
		$this->idsitesByAccess['superuser'] = Piwik_SitesManager_API::getAllSitesId();
		return true;
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:11,代码来源:Access.php

示例4: tablesCreation

	function tablesCreation()
	{
		$this->checkPreviousStepIsValid( __FUNCTION__ );

		$view = new Piwik_Installation_View(
						$this->pathView . 'tablesCreation.tpl',
						$this->getInstallationSteps(),
						__FUNCTION__
					);
		$this->skipThisStep( __FUNCTION__ );
		$this->createDbFromSessionInformation();

		if(Piwik_Common::getRequestVar('deleteTables', 0, 'int') == 1)
		{
			Piwik::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['displayJavascriptCode'] = false;
			$this->session->skipThisStep = $tmp;
		}

		$tablesInstalled = Piwik::getTablesInstalled();
		$tablesToInstall = Piwik::getTablesNames();
		$view->tablesInstalled = '';
		if(count($tablesInstalled) > 0)
		{
			$view->tablesInstalled = implode(', ', $tablesInstalled);
			$view->someTablesInstalled = true;

			$minimumCountPiwikTables = 12;
			$baseTablesInstalled = preg_grep('/archive_numeric|archive_blob/', $tablesInstalled, PREG_GREP_INVERT);

			Piwik::createAccessObject();
			Piwik::setUserIsSuperUser();

			if(count($baseTablesInstalled) >= $minimumCountPiwikTables &&
				count(Piwik_SitesManager_API::getAllSitesId()) > 0 &&
				count(Piwik_UsersManager_API::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['displayJavascriptCode'] = true;
				$this->session->skipThisStep = $tmp;
			}
		}
		else
		{
			Piwik::createTables();
			Piwik::createAnonymousUser();

			$updater = new Piwik_Updater();
			$updater->recordComponentSuccessfullyUpdated('core', Piwik_Version::VERSION);
			$view->tablesCreated = true;
			$view->showNextStep = true;
		}

		$this->session->currentStepDone = __FUNCTION__;
		echo $view->render();
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:66,代码来源:Controller.php

示例5: deleteSite

 /**
  * Delete a website from the database, given its Id.
  * 
  * Requires Super User access. 
  *
  * @param int $idSite
  */
 public static function deleteSite($idSite)
 {
     Piwik::checkUserIsSuperUser();
     $idSites = Piwik_SitesManager_API::getAllSitesId();
     if (!in_array($idSite, $idSites)) {
         throw new Exception("website id = {$idSite} not found");
     }
     $nbSites = count($idSites);
     if ($nbSites == 1) {
         throw new Exception(Piwik_TranslateException("SitesManager_ExceptionDeleteSite"));
     }
     $db = Zend_Registry::get('db');
     $db->query("DELETE FROM " . Piwik::prefixTable("site") . " \n\t\t\t\t\tWHERE idsite = ?", $idSite);
     $db->query("DELETE FROM " . Piwik::prefixTable("site_url") . " \n\t\t\t\t\tWHERE idsite = ?", $idSite);
     $db->query("DELETE FROM " . Piwik::prefixTable("access") . " \n\t\t\t\t\tWHERE idsite = ?", $idSite);
     Piwik_Common::deleteCacheWebsiteAttributes($idSite);
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:24,代码来源:API.php

示例6: getSitesIdWithAtLeastViewAccess

 public static function getSitesIdWithAtLeastViewAccess()
 {
     if (self::$superUser) {
         return Piwik_SitesManager_API::getAllSitesId();
     }
     return array_merge(self::$idSitesView, self::$idSitesAdmin);
 }
开发者ID:klando,项目名称:pgpiwik,代码行数:7,代码来源:Database.test.php

示例7: test_getAllSitesId_severalId

 /**
  * several Id -> normal array
  */
 function test_getAllSitesId_severalId()
 {
     $name = "tetq";
     $idsites = array(Piwik_SitesManager_API::addSite($name, array("http://piwik.net", "http://piwik.com/test/")), Piwik_SitesManager_API::addSite($name, array("http://piwik.net", "http://piwik.com/test/")), Piwik_SitesManager_API::addSite($name, array("http://piwik.net", "http://piwik.com/test/")), Piwik_SitesManager_API::addSite($name, array("http://piwik.net", "http://piwik.com/test/")), Piwik_SitesManager_API::addSite($name, array("http://piwik.net", "http://piwik.com/test/")));
     $ids = Piwik_SitesManager_API::getAllSitesId();
     $this->assertEqual($idsites, $ids);
 }
开发者ID:klando,项目名称:pgpiwik,代码行数:10,代码来源:SitesManager.test.php

示例8: setSuperUser

 /**
  * We bypass the normal auth method and give the current user Super User rights.
  * This should be very carefully used.
  * 
  * @return void
  */
 public function setSuperUser()
 {
     $this->isSuperUser = true;
     $this->idsitesByAccess['superuser'] = Piwik_SitesManager_API::getAllSitesId();
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:11,代码来源:Access.php


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