summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-11-16 09:27:22 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-11-16 09:27:22 +0000
commitad6f9ba7bd9e33d88610989faecfb6f911a34a13 (patch)
tree80a4707c6c2b495091e932f99c86c0cc4df5100b /includes
parent9c6e88636803dbdd660991e2d9458be5a74dfbd2 (diff)
downloadbrdo-ad6f9ba7bd9e33d88610989faecfb6f911a34a13.tar.gz
brdo-ad6f9ba7bd9e33d88610989faecfb6f911a34a13.tar.bz2
#190899 by bjaspan: (regression) return the queries performed in drupal_install_schema() and drupal_uninstall_schema(), so module install hooks can report on creation of tables, or failures, as it was in Drupal 5
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc10
1 files changed, 10 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 5fd634aca..14b6402d1 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -3087,6 +3087,10 @@ function drupal_get_schema($name = NULL, $rebuild = FALSE) {
*
* @param $module
* The module for which the tables will be created.
+ * @return
+ * An array of arrays with the following key/value pairs:
+ * success: a boolean indicating whether the query succeeded
+ * query: the SQL query(s) executed, passed through check_plain()
*/
function drupal_install_schema($module) {
$schema = drupal_get_schema_unprocessed($module);
@@ -3096,6 +3100,7 @@ function drupal_install_schema($module) {
foreach ($schema as $name => $table) {
db_create_table($ret, $name, $table);
}
+ return $ret;
}
/**
@@ -3107,6 +3112,10 @@ function drupal_install_schema($module) {
*
* @param $module
* The module for which the tables will be removed.
+ * @return
+ * An array of arrays with the following key/value pairs:
+ * success: a boolean indicating whether the query succeeded
+ * query: the SQL query(s) executed, passed through check_plain()
*/
function drupal_uninstall_schema($module) {
$schema = drupal_get_schema_unprocessed($module);
@@ -3116,6 +3125,7 @@ function drupal_uninstall_schema($module) {
foreach ($schema as $table) {
db_drop_table($ret, $table['name']);
}
+ return $ret;
}
/**