1. This addresses the error [PHP Fatal error: Call to undefined function db_query() in /opt/buildkit/build/mytestbuild/sites/all/modules/civicrm/CRM/Utils/System/DrupalBase.php](http://civicrm.stackexchange.com/questions/11972/regen-sh-call-to-undefined-function-db-query/11986#11986).
2. Generally, the goal here is to produce `civicrm_generated.mysql`, which
is used on any/all CMS's to initialize the Civi database. If the generation
were really dependent on Drupal 7, then we wouldn't be able to use that
output on other CMS's, right? Thus I'm hopeful that we can generate
`civicrm_generated.mysql` with any `CIVICRM_UF`. And the `UnitTests` UF has
fewer dependencies/interactions.
3. Since `GenerateData.php` is running in a dummy CMS, we can remove
these weird mock-drupal-functions.
4. To test, I ran `regen.sh` and compared the output with the old one.
All the changes looked like random-data (`civicrm_contact`, etal) and
not structural data (`civicrm_option_value`, etal).
$MYSQLCMD < civicrm_sample.mysql
echo "DROP TABLE IF EXISTS zipcodes" | $MYSQLCMD
$MYSQLCMD < zipcodes.mysql
-php GenerateData.php
+env CIVICRM_UF=UnitTests php GenerateData.php
# run the cli script to build the menu and the triggers
cd $CIVISOURCEDIR
}
-/**
- * @param null $str
- *
- * @return bool
- */
-function user_access($str = NULL) {
- return TRUE;
-}
-
-/**
- * @return array
- */
-function module_list() {
- return array();
-}
-
echo ("Starting data generation on " . date("F dS h:i:s A") . "\n");
$gcd = new CRM_GCD();
$gcd->initID();