本文整理汇总了PHP中Piwik::prefixTable方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik::prefixTable方法的具体用法?PHP Piwik::prefixTable怎么用?PHP Piwik::prefixTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik
的用法示例。
在下文中一共展示了Piwik::prefixTable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: authenticate
public function authenticate()
{
// we first try if the user is the super user
$rootLogin = Zend_Registry::get('config')->superuser->login;
$rootPassword = Zend_Registry::get('config')->superuser->password;
$rootToken = Piwik_UsersManager_API::getTokenAuth($rootLogin, $rootPassword);
// echo $rootToken;
// echo "<br>". $this->_credential;exit;
if ($this->_identity == $rootLogin && $this->_credential == $rootToken) {
return new Piwik_Auth_Result(Piwik_Auth::SUCCESS_SUPERUSER_AUTH_CODE, $this->_identity, array());
}
// we then look if the user is API authenticated
// API authentication works without login name, but only with the token
// TODO the logic (sql select) should be in the Login plugin, not here
// this class should stay simple. Another Login plugin should only have to create an auth entry
// of this class in the zend_registry and it should work
if (is_null($this->_identity)) {
$authenticated = false;
if ($this->_credential === $rootToken) {
return new Piwik_Auth_Result(Piwik_Auth::SUCCESS_SUPERUSER_AUTH_CODE, $rootLogin, array());
}
$login = Zend_Registry::get('db')->fetchOne('SELECT login FROM ' . Piwik::prefixTable('user') . ' WHERE token_auth = ?', array($this->_credential));
if ($login !== false) {
return new Piwik_Auth_Result(Zend_Auth_Result::SUCCESS, $login, array());
} else {
return new Piwik_Auth_Result(Zend_Auth_Result::FAILURE, $this->_identity, array());
}
}
// if not then we return the result of the database authentification provided by zend
return parent::authenticate();
}
示例2: deleteGoal
public function deleteGoal($idSite, $idGoal)
{
Piwik::checkUserHasAdminAccess($idSite);
Piwik_Query("UPDATE " . Piwik::prefixTable('goal') . "\n\t\t\t\t\t\t\t\t\t\tSET deleted = 1\n\t\t\t\t\t\t\t\t\t\tWHERE idsite = ? \n\t\t\t\t\t\t\t\t\t\t\tAND idgoal = ?", array($idSite, $idGoal));
Zend_Registry::get('db')->query("DELETE FROM " . Piwik::prefixTable("log_conversion") . " WHERE idgoal = ?", $idGoal);
Piwik_Common::regenerateCacheWebsiteAttributes($idSite);
}
示例3: authenticate
public function authenticate()
{
$rootLogin = Zend_Registry::get('config')->superuser->login;
$rootPassword = Zend_Registry::get('config')->superuser->password;
$rootToken = Piwik_UsersManager_API::getTokenAuth($rootLogin, $rootPassword);
if($this->login == $rootLogin
&& $this->token_auth == $rootToken)
{
return new Piwik_Auth_Result(Piwik_Auth_Result::SUCCESS_SUPERUSER_AUTH_CODE, $this->login, $this->token_auth );
}
if($this->token_auth === $rootToken)
{
return new Piwik_Auth_Result(Piwik_Auth_Result::SUCCESS_SUPERUSER_AUTH_CODE, $rootLogin, $rootToken );
}
$login = Piwik_FetchOne(
'SELECT login FROM '.Piwik::prefixTable('user').' WHERE token_auth = ?',
array($this->token_auth)
);
if($login !== false)
{
if(is_null($this->login)
|| $this->login == $login)
{
return new Piwik_Auth_Result(Piwik_Auth_Result::SUCCESS, $login, $this->token_auth );
}
}
return new Piwik_Auth_Result( Piwik_Auth_Result::FAILURE, $this->login, $this->token_auth );
}
示例4: update
static function update()
{
Piwik_Updater::updateDatabase(__FILE__, array(
'ALTER TABLE `'. Piwik::prefixTable('user_dashboard') .'`
CHANGE `layout` `layout` TEXT NOT NULL' => false,
));
}
示例5: update
static function update()
{
$sqlarray = array(
'ALTER TABLE `'. Piwik::prefixTable('log_visit') .'`
ADD `visit_goal_converted` VARCHAR( 1 ) NOT NULL AFTER `visit_total_time`' => false,
// 0.2.27 [826]
'ALTER IGNORE TABLE `'. Piwik::prefixTable('log_visit') .'`
CHANGE `visit_goal_converted` `visit_goal_converted` TINYINT(1) NOT NULL' => false,
);
$tables = Piwik::getTablesCreateSql();
$sqlarray[ $tables['log_conversion'] ] = false;
$sqlarray[ $tables['goal'] ] = false;
$tables = Piwik::getTablesInstalled();
foreach($tables as $tableName)
{
if(preg_match('/archive_/', $tableName) == 1)
{
$sqlarray[ 'CREATE INDEX index_all ON '. $tableName .' (`idsite`,`date1`,`date2`,`name`,`ts_archived`)' ] = false;
}
}
Piwik_Updater::updateDatabase(__FILE__, $sqlarray);
}
示例6: update
static function update()
{
Piwik_Updater::updateDatabase(__FILE__, array('UPDATE `' . Piwik::prefixTable('log_visit') . '`
SET location_ip=location_ip+CAST(POW(2,32) AS UNSIGNED) WHERE location_ip < 0' => false, 'ALTER TABLE `' . Piwik::prefixTable('log_visit') . '`
CHANGE `location_ip` `location_ip` BIGINT UNSIGNED NOT NULL' => false, 'UPDATE `' . Piwik::prefixTable('logger_api_call') . '`
SET caller_ip=caller_ip+CAST(POW(2,32) AS UNSIGNED) WHERE caller_ip < 0' => false, 'ALTER TABLE `' . Piwik::prefixTable('logger_api_call') . '`
CHANGE `caller_ip` `caller_ip` BIGINT UNSIGNED' => false));
}
示例7: saveFeedburnerName
/**
* Function called to save the Feedburner ID entered in the form
*
*/
function saveFeedburnerName()
{
// we save the value in the DB for an authenticated user
if (Piwik::getCurrentUserLogin() != 'anonymous') {
Piwik_Query('UPDATE ' . Piwik::prefixTable('site') . '
SET feedburnerName = ? WHERE idsite = ?', array(Piwik_Common::getRequestVar('name', '', 'string'), Piwik_Common::getRequestVar('idSite', 1, 'int')));
}
}
示例8: update
static function update()
{
$tables = Piwik::getTablesCreateSql();
Piwik_Updater::updateDatabase(__FILE__, array(
'DROP TABLE IF EXISTS `'. Piwik::prefixTable('option') .'`' => false,
$tables['option'] => false,
));
}
示例9: getSql
static function getSql()
{
return array('ALTER TABLE `' . Piwik::prefixTable('log_visit') . '`
ADD `config_java` TINYINT(1) NOT NULL AFTER `config_flash`' => '1060', 'ALTER TABLE `' . Piwik::prefixTable('log_visit') . '`
ADD `config_quicktime` TINYINT(1) NOT NULL AFTER `config_director`' => '1060', 'ALTER TABLE `' . Piwik::prefixTable('log_visit') . '`
ADD `config_gears` TINYINT(1) NOT NULL AFTER `config_windowsmedia`,
ADD `config_silverlight` TINYINT(1) NOT NULL AFTER `config_gears`' => false);
}
示例10: update
static function update()
{
Piwik_Updater::updateDatabase(__FILE__, array('ALTER TABLE `' . Piwik::prefixTable('log_visit') . '`
ADD `config_java` TINYINT(1) NOT NULL AFTER `config_flash`' => '/1060/', 'ALTER TABLE `' . Piwik::prefixTable('log_visit') . '`
ADD `config_quicktime` TINYINT(1) NOT NULL AFTER `config_director`' => '/1060/', 'ALTER TABLE `' . Piwik::prefixTable('log_visit') . '`
ADD `config_gears` TINYINT(1) NOT NULL AFTER `config_windowsmedia`,
ADD `config_silverlight` TINYINT(1) NOT NULL AFTER `config_gears`' => false));
}
示例11: update
static function update()
{
Piwik_Updater::updateDatabase(__FILE__, array(
'DELETE FROM `'. Piwik::prefixTable('user_dashboard') ."`
WHERE layout LIKE '%.getLastVisitsGraph%'
OR layout LIKE '%.getLastVisitsReturningGraph%'" => false,
));
}
示例12: getSql
static function getSql()
{
return array('ALTER TABLE `' . Piwik::prefixTable('access') . '`
CHANGE `login` `login` VARCHAR( 100 ) NOT NULL' => false, 'ALTER TABLE `' . Piwik::prefixTable('user') . '`
CHANGE `login` `login` VARCHAR( 100 ) NOT NULL' => false, 'ALTER TABLE `' . Piwik::prefixTable('user_dashboard') . '`
CHANGE `login` `login` VARCHAR( 100 ) NOT NULL' => '1146', 'ALTER TABLE `' . Piwik::prefixTable('user_language') . '`
CHANGE `login` `login` VARCHAR( 100 ) NOT NULL' => '1146');
}
示例13: update
static function update()
{
Piwik_Updater::updateDatabase(__FILE__, array(
'ALTER TABLE `'. Piwik::prefixTable('log_conversion') .'`
CHANGE `idlink_va` `idlink_va` INT(11) DEFAULT NULL' => false,
'ALTER TABLE `'. Piwik::prefixTable('log_conversion') .'`
CHANGE `idaction` `idaction` INT(11) DEFAULT NULL' => false,
));
}
示例14: __construct
function __construct($logToFileFilename, $fileFormatter, $screenFormatter, $logToDatabaseTableName, $logToDatabaseColumnMapping)
{
parent::__construct();
$this->logToFileFilename = PIWIK_INCLUDE_PATH . '/' . Zend_Registry::get('config')->log->logger_file_path . $logToFileFilename;
$this->fileFormatter = $fileFormatter;
$this->screenFormatter = $screenFormatter;
$this->logToDatabaseTableName = Piwik::prefixTable($logToDatabaseTableName);
$this->logToDatabaseColumnMapping = $logToDatabaseColumnMapping;
}
示例15: getLayoutForUser
/**
* Returns the layout in the DB for the given user, or false if the layout has not been set yet.
* Parameters must be checked BEFORE this function call
*
* @param string $login
* @param int $idDashboard
* @param string|false $layout
*/
protected function getLayoutForUser($login, $idDashboard)
{
$paramsBind = array($login, $idDashboard);
$return = Piwik_FetchAll('SELECT layout FROM ' . Piwik::prefixTable('user_dashboard') . ' WHERE login = ? AND iddashboard = ?', $paramsBind);
if (count($return) == 0) {
return false;
}
return $return[0]['layout'];
}