當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。