本文整理汇总了PHP中Gdn::Statistics方法的典型用法代码示例。如果您正苦于以下问题:PHP Gdn::Statistics方法的具体用法?PHP Gdn::Statistics怎么用?PHP Gdn::Statistics使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdn
的用法示例。
在下文中一共展示了Gdn::Statistics方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Statistics setup & configuration.
*
* @since 2.0.17
* @access public
*/
public function index()
{
$this->permission('Garden.Settings.Manage');
$this->addSideMenu('dashboard/statistics');
//$this->addJsFile('statistics.js');
$this->title(t('Vanilla Statistics'));
$this->enableSlicing($this);
if ($this->Form->authenticatedPostBack()) {
$Flow = true;
if ($Flow && $this->Form->getFormValue('Reregister')) {
$id = Gdn::installationID();
$secret = Gdn::installationSecret();
Gdn::installationID(false);
Gdn::installationSecret(false);
Gdn::Statistics()->register();
if (!Gdn::installationID()) {
Gdn::installationID($id);
Gdn::installationSecret($secret);
}
$this->Form->setFormValue('InstallationID', Gdn::installationID());
$this->Form->setFormValue('InstallationSecret', Gdn::installationSecret());
}
if ($Flow && $this->Form->getFormValue('Save')) {
Gdn::installationID($this->Form->getFormValue('InstallationID'));
Gdn::installationSecret($this->Form->getFormValue('InstallationSecret'));
$this->informMessage(t("Your settings have been saved."));
}
if ($Flow && $this->Form->getFormValue('AllowLocal')) {
saveToConfig('Garden.Analytics.AllowLocal', true);
}
if ($Flow && $this->Form->getFormValue('Allow')) {
saveToConfig('Garden.Analytics.Enabled', true);
}
if ($Flow && $this->Form->getFormValue('ClearCredentials')) {
Gdn::installationID(false);
Gdn::installationSecret(false);
Gdn::statistics()->Tick();
$Flow = false;
}
} else {
$this->Form->setValue('InstallationID', Gdn::installationID());
$this->Form->setValue('InstallationSecret', Gdn::installationSecret());
}
$AnalyticsEnabled = Gdn_Statistics::checkIsEnabled();
if ($AnalyticsEnabled) {
$ConfFile = Gdn::config()->defaultPath();
$this->setData('ConfWritable', $ConfWritable = is_writable($ConfFile));
if (!$ConfWritable) {
$AnalyticsEnabled = false;
}
}
$this->setData('AnalyticsEnabled', $AnalyticsEnabled);
$NotifyMessage = Gdn::get('Garden.Analytics.Notify', false);
$this->setData('NotifyMessage', $NotifyMessage);
if ($NotifyMessage !== false) {
Gdn::set('Garden.Analytics.Notify', null);
}
$this->render();
}
示例2: SecurityToken
protected function SecurityToken($SetSecurityToken = NULL)
{
static $SecurityToken = NULL;
if (!is_null($SetSecurityToken)) {
$SecurityToken = $SetSecurityToken;
}
if (is_null($SecurityToken)) {
$Request = array('VanillaID' => $this->VanillaID);
Gdn::Statistics()->BasicParameters($Request);
$Response = Gdn::Statistics()->Analytics('graph/getsecuritytoken.json', $Request, array('Success' => array($this, 'SecurityTokenCallback')));
}
return $SecurityToken;
}
示例3: SettingsController_AnalyticsTick_Create
public function SettingsController_AnalyticsTick_Create($Sender)
{
Gdn::Statistics()->Tick();
$Sender->DeliveryType(DELIVERY_TYPE_VIEW);
$Sender->DeliveryMethod(DELIVERY_METHOD_JSON);
$Sender->Render('tick', 'statistics', 'dashboard');
}
示例4:
Gdn::FactoryInstall('Form', 'Gdn_Form', NULL, Gdn::FactoryInstance);
// Identity, Authenticator & Session.
Gdn::FactoryInstall('Identity', 'Gdn_CookieIdentity');
Gdn::FactoryInstall(Gdn::AliasSession, 'Gdn_Session');
Gdn::FactoryInstall(Gdn::AliasAuthenticator, 'Gdn_Auth');
// Dispatcher.
Gdn::FactoryInstall(Gdn::AliasRouter, 'Gdn_Router');
Gdn::FactoryInstall(Gdn::AliasDispatcher, 'Gdn_Dispatcher');
// Smarty Templating Engine
Gdn::FactoryInstall('Smarty', 'Smarty', PATH_LIBRARY . '/vendors/Smarty-2.6.25/libs/Smarty.class.php');
Gdn::FactoryInstall('ViewHandler.tpl', 'Gdn_Smarty');
// Slice handler
Gdn::FactoryInstall(Gdn::AliasSlice, 'Gdn_Slice');
// Remote Statistics
Gdn::FactoryInstall('Statistics', 'Gdn_Statistics', NULL, Gdn::FactorySingleton);
Gdn::Statistics();
// Regarding
Gdn::FactoryInstall('Regarding', 'Gdn_Regarding', NULL, Gdn::FactorySingleton);
Gdn::Regarding();
// Other objects.
Gdn::FactoryInstall('Dummy', 'Gdn_Dummy');
/**
* Extension Startup
*
* Allow installed Extensions (Applications, Themes, Plugins) to execute startup
* and bootstrap procedures that they may have, here.
*/
// Applications startup
foreach (Gdn::ApplicationManager()->EnabledApplicationFolders() as $ApplicationName => $ApplicationFolder) {
// Include the application's bootstrap.
$Gdn_Path = PATH_APPLICATIONS . "/{$ApplicationFolder}/settings/bootstrap.php";
示例5: Verify
/**
* Verify connection credentials.
*
* @since 2.0.17
* @access public
*/
public function Verify()
{
$CredentialsValid = Gdn::Statistics()->ValidateCredentials();
$this->SetData('StatisticsVerified', $CredentialsValid);
$this->Render();
}
示例6: SettingsController_AnalyticsTick_Create
/**
*
* @param Gdn_Controller $Sender
*/
public function SettingsController_AnalyticsTick_Create($Sender)
{
$Sender->DeliveryMethod(DELIVERY_METHOD_JSON);
$Sender->DeliveryType(DELIVERY_TYPE_DATA);
Gdn::Statistics()->Tick();
$this->FireEvent("AnalyticsTick");
$Sender->Render();
}