本文整理汇总了PHP中Piwik_Common::prefixTable方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik_Common::prefixTable方法的具体用法?PHP Piwik_Common::prefixTable怎么用?PHP Piwik_Common::prefixTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik_Common
的用法示例。
在下文中一共展示了Piwik_Common::prefixTable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSql
static function getSql($schema = 'Myisam')
{
return array(
'ALTER TABLE `'. Piwik_Common::prefixTable('user_dashboard') .'`
CHANGE `layout` `layout` TEXT NOT NULL' => false,
);
}
示例2: getSql
static function getSql($schema = 'Myisam')
{
return array(
'ALTER TABLE `'. Piwik_Common::prefixTable('log_visit') .'`
ADD INDEX index_idsite_idvisitor (idsite, idvisitor)' => false,
);
}
示例3: authenticate
/**
* Authenticates user
*
* @return Piwik_Auth_Result
*/
public function authenticate()
{
$rootLogin = Piwik_Config::getInstance()->superuser['login'];
$rootPassword = Piwik_Config::getInstance()->superuser['password'];
$rootToken = Piwik_UsersManager_API::getInstance()->getTokenAuth($rootLogin, $rootPassword);
if (is_null($this->login)) {
if ($this->token_auth === $rootToken) {
return new Piwik_Auth_Result(Piwik_Auth_Result::SUCCESS_SUPERUSER_AUTH_CODE, $rootLogin, $this->token_auth);
}
$login = Piwik_FetchOne('SELECT login
FROM ' . Piwik_Common::prefixTable('user') . '
WHERE token_auth = ?', array($this->token_auth));
if (!empty($login)) {
return new Piwik_Auth_Result(Piwik_Auth_Result::SUCCESS, $login, $this->token_auth);
}
} else {
if (!empty($this->login)) {
if ($this->login === $rootLogin && $this->getHashTokenAuth($rootLogin, $rootToken) === $this->token_auth || $rootToken === $this->token_auth) {
$this->setTokenAuth($rootToken);
return new Piwik_Auth_Result(Piwik_Auth_Result::SUCCESS_SUPERUSER_AUTH_CODE, $rootLogin, $this->token_auth);
}
$login = $this->login;
$userToken = Piwik_FetchOne('SELECT token_auth
FROM ' . Piwik_Common::prefixTable('user') . '
WHERE login = ?', array($login));
if (!empty($userToken) && ($this->getHashTokenAuth($login, $userToken) === $this->token_auth || $userToken === $this->token_auth)) {
$this->setTokenAuth($userToken);
return new Piwik_Auth_Result(Piwik_Auth_Result::SUCCESS, $login, $userToken);
}
}
}
return new Piwik_Auth_Result(Piwik_Auth_Result::FAILURE, $this->login, $this->token_auth);
}
示例4: getSql
static function getSql($schema = 'Myisam')
{
return array('ALTER TABLE `' . Piwik_Common::prefixTable('log_visit') . '`
CHANGE custom_var_k1 custom_var_k1 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_v1 custom_var_v1 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_k2 custom_var_k2 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_v2 custom_var_v2 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_k3 custom_var_k3 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_v3 custom_var_v3 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_k4 custom_var_k4 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_v4 custom_var_v4 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_k5 custom_var_k5 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_v5 custom_var_v5 VARCHAR(100) DEFAULT NULL' => false, 'ALTER TABLE `' . Piwik_Common::prefixTable('log_conversion') . '`
CHANGE custom_var_k1 custom_var_k1 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_v1 custom_var_v1 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_k2 custom_var_k2 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_v2 custom_var_v2 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_k3 custom_var_k3 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_v3 custom_var_v3 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_k4 custom_var_k4 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_v4 custom_var_v4 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_k5 custom_var_k5 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_v5 custom_var_v5 VARCHAR(100) DEFAULT NULL' => false, 'ALTER TABLE `' . Piwik_Common::prefixTable('log_link_visit_action') . '`
CHANGE custom_var_k1 custom_var_k1 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_v1 custom_var_v1 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_k2 custom_var_k2 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_v2 custom_var_v2 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_k3 custom_var_k3 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_v3 custom_var_v3 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_k4 custom_var_k4 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_v4 custom_var_v4 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_k5 custom_var_k5 VARCHAR(100) DEFAULT NULL,
CHANGE custom_var_v5 custom_var_v5 VARCHAR(100) DEFAULT NULL' => false);
}
示例5: getSql
static function getSql($schema = 'Myisam')
{
return array(
'ALTER TABLE `'. Piwik_Common::prefixTable('site') .'`
ADD ecommerce TINYINT DEFAULT 0' => false,
);
}
示例6: getSql
static function getSql($schema = 'Myisam')
{
if(!Piwik::isTimezoneSupportEnabled())
{
return array();
}
// @see http://bugs.php.net/46111
$timezones = timezone_identifiers_list();
$brokenTZ = array();
foreach ($timezones as $timezone) {
$testDate = "2008-08-19 13:00:00 " . $timezone;
if (!strtotime($testDate)) {
$brokenTZ[] = $timezone;
}
}
$timezoneList = '"'. implode('","', $brokenTZ) . '"';
return array(
'UPDATE '. Piwik_Common::prefixTable('site') .'
SET timezone = "UTC"
WHERE timezone IN ('. $timezoneList .')' => false,
'UPDATE `'. Piwik_Common::prefixTable('option') .'`
SET option_value = "UTC"
WHERE option_name = "SitesManager_DefaultTimezone"
AND option_value IN ('. $timezoneList .')' => false,
);
}
示例7: getSql
static function getSql($schema = 'Myisam')
{
return array(
'CREATE TABLE `'. Piwik_Common::prefixTable('option') .'` (
idoption BIGINT NOT NULL AUTO_INCREMENT ,
option_name VARCHAR( 64 ) NOT NULL ,
option_value LONGTEXT NOT NULL ,
PRIMARY KEY ( idoption , option_name )
)' => false,
// 0.1.7 [463]
'ALTER IGNORE TABLE `'. Piwik_Common::prefixTable('log_visit') .'`
CHANGE `location_provider` `location_provider` VARCHAR( 100 ) DEFAULT NULL' => '1054',
// 0.1.7 [470]
'ALTER TABLE `'. Piwik_Common::prefixTable('logger_api_call') .'`
CHANGE `parameter_names_default_values` `parameter_names_default_values` TEXT,
CHANGE `parameter_values` `parameter_values` TEXT,
CHANGE `returned_value` `returned_value` TEXT' => false,
'ALTER TABLE `'. Piwik_Common::prefixTable('logger_error') .'`
CHANGE `message` `message` TEXT' => false,
'ALTER TABLE `'. Piwik_Common::prefixTable('logger_exception') .'`
CHANGE `message` `message` TEXT' => false,
'ALTER TABLE `'. Piwik_Common::prefixTable('logger_message') .'`
CHANGE `message` `message` TEXT' => false,
// 0.2.2 [489]
'ALTER IGNORE TABLE `'. Piwik_Common::prefixTable('site') .'`
CHANGE `feedburnerName` `feedburnerName` VARCHAR( 100 ) DEFAULT NULL' => '1054',
);
}
示例8: getIdActionFromSegment
/**
* Convert segment expression to an action ID or an SQL expression.
*
* This method is used as a sqlFilter-callback for the segments of this plugin.
* Usually, these callbacks only return a value that should be compared to the
* column in the database. In this case, that doesn't work since multiple IDs
* can match an expression (e.g. "pageUrl=@foo").
*/
function getIdActionFromSegment($string, $sqlField, $matchType = '==')
{
// Field is visit_*_idaction_url or visit_*_idaction_name
$actionType = strpos($sqlField, '_name') === false ? Piwik_Tracker_Action::TYPE_ACTION_URL : Piwik_Tracker_Action::TYPE_ACTION_NAME;
// exact matches work by returning the id directly
if ($matchType == Piwik_SegmentExpression::MATCH_EQUAL || $matchType == Piwik_SegmentExpression::MATCH_NOT_EQUAL) {
$sql = Piwik_Tracker_Action::getSqlSelectActionId();
$bind = array($string, $string, $actionType);
$idAction = Piwik_FetchOne($sql, $bind);
// if the action is not found, we hack -100 to ensure it tries to match against an integer
// otherwise binding idaction_name to "false" returns some rows for some reasons (in case &segment=pageTitle==Větrnásssssss)
if (empty($idAction)) {
$idAction = -100;
}
return $idAction;
}
// now, we handle the cases =@ (contains) and !@ (does not contain)
// build the expression based on the match type
$sql = 'SELECT idaction FROM ' . Piwik_Common::prefixTable('log_action') . ' WHERE ';
switch ($matchType) {
case '=@':
// use concat to make sure, no %s occurs because some plugins use %s in their sql
$sql .= '( name LIKE CONCAT("%", ?, "%") AND type = ' . $actionType . ' )';
break;
case '!@':
$sql .= '( name NOT LIKE CONCAT("%", ?, "%") AND type = ' . $actionType . ' )';
break;
default:
throw new Exception("This match type is not available for action-segments.");
break;
}
return array('SQL' => $sql, 'bind' => $string);
}
示例9: getSql
static function getSql($schema = 'Myisam')
{
return array('CREATE TABLE `' . Piwik_Common::prefixTable('log_conversion_item') . '` (
idsite int(10) UNSIGNED NOT NULL,
idvisitor BINARY(8) NOT NULL,
server_time DATETIME NOT NULL,
idvisit INTEGER(10) UNSIGNED NOT NULL,
idorder varchar(100) NOT NULL,
idaction_sku INTEGER(10) UNSIGNED NOT NULL,
idaction_name INTEGER(10) UNSIGNED NOT NULL,
idaction_category INTEGER(10) UNSIGNED NOT NULL,
price FLOAT NOT NULL,
quantity INTEGER(10) UNSIGNED NOT NULL,
deleted TINYINT(1) UNSIGNED NOT NULL,
PRIMARY KEY(idvisit, idorder, idaction_sku),
INDEX index_idsite_servertime ( idsite, server_time )
) DEFAULT CHARSET=utf8 ' => false, 'ALTER IGNORE TABLE `' . Piwik_Common::prefixTable('log_visit') . '`
ADD visitor_days_since_order SMALLINT(5) UNSIGNED NOT NULL AFTER visitor_days_since_last,
ADD visit_goal_buyer TINYINT(1) NOT NULL AFTER visit_goal_converted' => false, 'ALTER IGNORE TABLE `' . Piwik_Common::prefixTable('log_conversion') . '`
ADD visitor_days_since_order SMALLINT(5) UNSIGNED NOT NULL AFTER visitor_days_since_first,
ADD idorder varchar(100) default NULL AFTER buster,
ADD items SMALLINT UNSIGNED DEFAULT NULL,
ADD revenue_subtotal float default NULL,
ADD revenue_tax float default NULL,
ADD revenue_shipping float default NULL,
ADD revenue_discount float default NULL,
ADD UNIQUE KEY unique_idsite_idorder (idsite, idorder),
MODIFY idgoal int(10) NOT NULL' => false);
}
示例10: getSql
static function getSql($schema = 'Myisam')
{
return array(
'ALTER TABLE `'. Piwik_Common::prefixTable('option') .'`
CHANGE `option_name` `option_name` VARCHAR(255) NOT NULL' => false,
);
}
示例11: getSql
static function getSql($schema = 'Myisam')
{
return array(
'ALTER TABLE `'. Piwik_Common::prefixTable('log_action') .'`
CHANGE `name` `name` TEXT' => false,
);
}
示例12: getSql
static function getSql($schema = 'Myisam')
{
$logVisit = Piwik_Common::prefixTable('log_visit');
$logConversion = Piwik_Common::prefixTable('log_conversion');
$addColumns = "DROP `location_continent`,\n\t\t\t\t\t ADD `location_region` CHAR(2) NULL AFTER `location_country`,\n\t\t\t\t\t ADD `location_city` VARCHAR(255) NULL AFTER `location_region`,\n\t\t\t\t\t ADD `location_latitude` FLOAT(10, 6) NULL AFTER `location_city`,\n\t\t\t ADD `location_longitude` FLOAT(10, 6) NULL AFTER `location_latitude`";
return array("ALTER TABLE `{$logVisit}` {$addColumns}" => 1091, "ALTER TABLE `{$logConversion}` {$addColumns}" => 1091);
}
示例13: getSql
static function getSql($schema = 'Myisam')
{
$sqlarray = array('ALTER TABLE `' . Piwik_Common::prefixTable('log_visit') . '`
ADD `visit_goal_converted` VARCHAR( 1 ) NOT NULL AFTER `visit_total_time`' => false, 'ALTER IGNORE TABLE `' . Piwik_Common::prefixTable('log_visit') . '`
CHANGE `visit_goal_converted` `visit_goal_converted` TINYINT(1) NOT NULL' => false, 'CREATE TABLE `' . Piwik_Common::prefixTable('goal') . "` (\n\t\t\t\t`idsite` int(11) NOT NULL,\n\t\t\t\t`idgoal` int(11) NOT NULL,\n\t\t\t\t`name` varchar(50) NOT NULL,\n\t\t\t\t`match_attribute` varchar(20) NOT NULL,\n\t\t\t\t`pattern` varchar(255) NOT NULL,\n\t\t\t\t`pattern_type` varchar(10) NOT NULL,\n\t\t\t\t`case_sensitive` tinyint(4) NOT NULL,\n\t\t\t\t`revenue` float NOT NULL,\n\t\t\t\t`deleted` tinyint(4) NOT NULL default '0',\n\t\t\t\tPRIMARY KEY (`idsite`,`idgoal`)\n\t\t\t)" => false, 'CREATE TABLE `' . Piwik_Common::prefixTable('log_conversion') . '` (
`idvisit` int(10) unsigned NOT NULL,
`idsite` int(10) unsigned NOT NULL,
`visitor_idcookie` char(32) NOT NULL,
`server_time` datetime NOT NULL,
`visit_server_date` date NOT NULL,
`idaction` int(11) NOT NULL,
`idlink_va` int(11) NOT NULL,
`referer_idvisit` int(10) unsigned default NULL,
`referer_visit_server_date` date default NULL,
`referer_type` int(10) unsigned default NULL,
`referer_name` varchar(70) default NULL,
`referer_keyword` varchar(255) default NULL,
`visitor_returning` tinyint(1) NOT NULL,
`location_country` char(3) NOT NULL,
`location_continent` char(3) NOT NULL,
`url` text NOT NULL,
`idgoal` int(10) unsigned NOT NULL,
`revenue` float default NULL,
PRIMARY KEY (`idvisit`,`idgoal`),
KEY `index_idsite_date` (`idsite`,`visit_server_date`)
)' => 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;
}
}
return $sqlarray;
}
示例14: getSql
static function getSql($schema = 'Myisam')
{
return array('UPDATE `' . Piwik_Common::prefixTable('log_visit') . '`
SET location_ip=location_ip+CAST(POW(2,32) AS UNSIGNED) WHERE location_ip < 0' => false, 'ALTER TABLE `' . Piwik_Common::prefixTable('log_visit') . '`
CHANGE `location_ip` `location_ip` BIGINT UNSIGNED NOT NULL' => false, 'UPDATE `' . Piwik_Common::prefixTable('logger_api_call') . '`
SET caller_ip=caller_ip+CAST(POW(2,32) AS UNSIGNED) WHERE caller_ip < 0' => false, 'ALTER TABLE `' . Piwik_Common::prefixTable('logger_api_call') . '`
CHANGE `caller_ip` `caller_ip` BIGINT UNSIGNED' => false);
}
示例15: getSql
static function getSql($schema = 'Myisam')
{
return array('ALTER TABLE `' . Piwik_Common::prefixTable('access') . '`
CHANGE `login` `login` VARCHAR( 100 ) NOT NULL' => false, 'ALTER TABLE `' . Piwik_Common::prefixTable('user') . '`
CHANGE `login` `login` VARCHAR( 100 ) NOT NULL' => false, 'ALTER TABLE `' . Piwik_Common::prefixTable('user_dashboard') . '`
CHANGE `login` `login` VARCHAR( 100 ) NOT NULL' => '1146', 'ALTER TABLE `' . Piwik_Common::prefixTable('user_language') . '`
CHANGE `login` `login` VARCHAR( 100 ) NOT NULL' => '1146');
}