本文整理汇总了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);
}
示例2:
<?php
// force regeneration of cache files following #648
Piwik::setUserIsSuperUser();
$allSiteIds = Piwik_SitesManager_API::getAllSitesId();
Piwik_Common::regenerateCacheWebsiteAttributes($allSiteIds);
示例3: reloadAccessSuperUser
/**
* Reload super user access
*
* @return bool
*/
protected function reloadAccessSuperUser()
{
$this->isSuperUser = true;
$this->idsitesByAccess['superuser'] = Piwik_SitesManager_API::getAllSitesId();
return true;
}
示例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();
}
示例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);
}
示例6: getSitesIdWithAtLeastViewAccess
public static function getSitesIdWithAtLeastViewAccess()
{
if (self::$superUser) {
return Piwik_SitesManager_API::getAllSitesId();
}
return array_merge(self::$idSitesView, self::$idSitesAdmin);
}
示例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);
}
示例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();
}