Skip to content
Extraits de code Groupes Projets
Valider 06c6cfa7 rédigé par robocoder's avatar robocoder
Parcourir les fichiers

Use Piwik_Query() for consistency. Override listTables() for Pgsql.

git-svn-id: http://dev.piwik.org/svn/trunk@1487 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent 09cd8906
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -5,14 +5,14 @@ ...@@ -5,14 +5,14 @@
; the config.ini.php file contains information about the super user and the database access ; the config.ini.php file contains information about the super user and the database access
[superuser] [superuser]
login = yourSuLogin login = yourSuperUserLogin
password = yourSuPassword password = yourSuperUserPassword
email = hello@piwik.org email = hello@example.org
[database] [database]
host = localhost host = localhost
username = databaseLogin username = databaseLogin
password = datatabasePassword password = datatabasePassword
dbname = databaseName dbname = databaseName
adapter = PDO_MYSQL ; PDO_MYSQL or MYSQLI adapter = PDO_MYSQL ; PDO_MYSQL, MYSQLI, or PDO_PGSQL
tables_prefix = piwik_ tables_prefix = piwik_
...@@ -18,7 +18,7 @@ password = ...@@ -18,7 +18,7 @@ password =
dbname = dbname =
tables_prefix = tables_prefix =
port = 3306 port = 3306
adapter = PDO_MYSQL ; PDO_MYSQL or MYSQLI adapter = PDO_MYSQL
[database_tests] [database_tests]
host = localhost host = localhost
......
...@@ -158,4 +158,26 @@ class Piwik_Db_Pdo_Pgsql extends Zend_Db_Adapter_Pdo_Pgsql implements Piwik_Db_i ...@@ -158,4 +158,26 @@ class Piwik_Db_Pdo_Pgsql extends Zend_Db_Adapter_Pdo_Pgsql implements Piwik_Db_i
$charset = $this->fetchOne('SHOW client_encoding'); $charset = $this->fetchOne('SHOW client_encoding');
return strtolower($charset) === 'utf8'; return strtolower($charset) === 'utf8';
} }
/**
* Returns a list of the tables in the database.
*
* Replaces parent::listTables() which uses subqueries.
* @see ZF-????
*
* @return array
*/
public function listTables()
{
$sql = "SELECT c.relname AS table_name "
. "FROM pg_catalog.pg_class c "
. "JOIN pg_catalog.pg_roles r ON r.oid = c.relowner "
. "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace "
. "WHERE n.nspname <> 'pg_catalog' "
. "AND n.nspname !~ '^pg_toast' "
. "AND pg_catalog.pg_table_is_visible(c.oid) "
. "AND c.relkind = 'r' ";
return $this->fetchCol($sql);
}
} }
...@@ -126,7 +126,7 @@ class Piwik_Goals_API ...@@ -126,7 +126,7 @@ class Piwik_Goals_API
WHERE idsite = ? WHERE idsite = ?
AND idgoal = ?", AND idgoal = ?",
array($idSite, $idGoal)); array($idSite, $idGoal));
Zend_Registry::get('db')->query("DELETE FROM ".Piwik::prefixTable("log_conversion")." WHERE idgoal = ?", $idGoal); Piwik_Query("DELETE FROM ".Piwik::prefixTable("log_conversion")." WHERE idgoal = ?", $idGoal);
Piwik_Common::regenerateCacheWebsiteAttributes($idSite); Piwik_Common::regenerateCacheWebsiteAttributes($idSite);
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter