本文整理汇总了PHP中Piwik::getTablesCreateSql方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik::getTablesCreateSql方法的具体用法?PHP Piwik::getTablesCreateSql怎么用?PHP Piwik::getTablesCreateSql使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik
的用法示例。
在下文中一共展示了Piwik::getTablesCreateSql方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: update
static function update()
{
$tables = Piwik::getTablesCreateSql();
Piwik_Updater::updateDatabase(__FILE__, array(
'DROP TABLE IF EXISTS `'. Piwik::prefixTable('option') .'`' => false,
$tables['option'] => false,
));
}
示例3: getTableCreateSql
/**
* Get the SQL to create a specific Piwik table
*
* @param string $tableName
* @return string SQL
*/
public function getTableCreateSql($tableName)
{
$tables = Piwik::getTablesCreateSql();
if (!isset($tables[$tableName])) {
throw new Exception("The table '{$tableName}' SQL creation code couldn't be found.");
}
return $tables[$tableName];
}
示例4: update
static function update()
{
$tables = Piwik::getTablesCreateSql();
Piwik_Updater::updateDatabase(__FILE__, array($tables['option'] => false));
$obsoleteDirectories = array('/plugins/AdminHome', '/plugins/Home', '/plugins/PluginsAdmin');
foreach ($obsoleteDirectories as $dir) {
if (file_exists(PIWIK_INCLUDE_PATH . $dir)) {
Piwik::unlinkRecursive(PIWIK_INCLUDE_PATH . $dir, true);
}
}
}
示例5: getSql
static function getSql()
{
$tables = Piwik::getTablesCreateSql();
return array($tables['option'] => false, 'ALTER IGNORE TABLE `' . Piwik::prefixTable('log_visit') . '`
CHANGE `location_provider` `location_provider` VARCHAR( 100 ) DEFAULT NULL' => '1054', 'ALTER TABLE `' . Piwik::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::prefixTable('logger_error') . '`
CHANGE `message` `message` TEXT' => false, 'ALTER TABLE `' . Piwik::prefixTable('logger_exception') . '`
CHANGE `message` `message` TEXT' => false, 'ALTER TABLE `' . Piwik::prefixTable('logger_message') . '`
CHANGE `message` `message` TEXT' => false, 'ALTER IGNORE TABLE `' . Piwik::prefixTable('site') . '`
CHANGE `feedburnerName` `feedburnerName` VARCHAR( 100 ) DEFAULT NULL' => '1054');
}
示例6: 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);
$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;
}
}
return $sqlarray;
}
示例7: update
static function update()
{
$tables = Piwik::getTablesCreateSql();
Piwik_Updater::updateDatabase(__FILE__, array(
$tables['option'] => false,
));
Piwik_Updater::updateDatabase(__FILE__, array(
// 0.1.7 [463]
'ALTER IGNORE TABLE `'. Piwik::prefixTable('log_visit') .'`
CHANGE `location_provider` `location_provider` VARCHAR( 100 ) DEFAULT NULL' => '1054',
// 0.1.7 [470]
'ALTER TABLE `'. Piwik::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::prefixTable('logger_error') .'`
CHANGE `message` `message` TEXT' => false,
'ALTER TABLE `'. Piwik::prefixTable('logger_exception') .'`
CHANGE `message` `message` TEXT' => false,
'ALTER TABLE `'. Piwik::prefixTable('logger_message') .'`
CHANGE `message` `message` TEXT' => false,
// 0.2.2 [489]
'ALTER IGNORE TABLE `'. Piwik::prefixTable('site') .'`
CHANGE `feedburnerName` `feedburnerName` VARCHAR( 100 ) DEFAULT NULL' => '1054',
));
$obsoleteFile = '/plugins/ExamplePlugin/API.php';
if(file_exists(PIWIK_INCLUDE_PATH . $obsoleteFile))
{
@unlink(PIWIK_INCLUDE_PATH . $obsoleteFile);
}
$obsoleteDirectories = array(
'/plugins/AdminHome',
'/plugins/Home',
'/plugins/PluginsAdmin',
);
foreach($obsoleteDirectories as $dir)
{
if(file_exists(PIWIK_INCLUDE_PATH . $dir))
{
Piwik::unlinkRecursive(PIWIK_INCLUDE_PATH . $dir, true);
}
}
}
示例8: getSql
static function getSql($schema = 'Myisam')
{
$tables = Piwik::getTablesCreateSql();
return array('DROP TABLE IF EXISTS `' . Piwik_Common::prefixTable('option') . '`' => false, $tables['option'] => false);
}
示例9: Piwik_Query
<?php
Piwik_Query("ALTER TABLE `" . Piwik::prefixTable('log_visit') . "` \n\t\t\tADD `visit_goal_converted` VARCHAR( 1 ) NOT NULL AFTER `visit_total_time` ;");
$tables = Piwik::getTablesCreateSql();
Piwik_Query($tables['log_conversion']);
Piwik_Query($tables['goal']);
$allTablesInstalled = Piwik::getTablesInstalled();
foreach ($allTablesInstalled as $tableName) {
if (preg_match('/archive_/', $tableName) == 1) {
Piwik_Query('CREATE INDEX index_all
ON ' . $tableName . ' (`idsite`,`date1`,`date2`,`name`,`ts_archived`)');
}
}
示例10: update
static function update()
{
$tables = Piwik::getTablesCreateSql();
Piwik_Updater::updateDatabase(__FILE__, array($tables['option'] => false));
}