-
-
Save totten/4473975264fc2a788391d3c5ef5bf18b to your computer and use it in GitHub Desktop.
Dump all metadata from DAOs. (Note: Old DAOs have buggy caching in import()/export(). To get different cases, we use separate scripts to get exercise different cases even while the bug is present.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
echo "==Default==" | |
cv scr tmp/read-all-daos.php > dao/throwaway.data | |
colordiff -u dao/orig.data dao/throwaway.data | |
echo | |
echo "==Prefix==" | |
cv scr tmp/read-all-daos-prefix.php > dao/throwaway.data-prefix | |
colordiff -u dao/orig.data-prefix dao/throwaway.data-prefix | |
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$rows = array(); | |
foreach (CRM_Core_DAO_AllCoreTables::get() as $class => $entityType) { | |
$row = array( | |
'fields()' => $class::fields(), | |
'fieldKeys()' => $class::fieldKeys(), | |
'getTableName()' => $class::getTableName(), | |
'import(1)' => $class::import(TRUE), | |
'export(1)' => $class::export(TRUE), | |
'getReferenceColumns()' => $class::getReferenceColumns(), | |
); | |
$rows[$class] = $row; | |
} | |
CRM_Utils_Array::flatten($rows, $flat, '', '::'); | |
ksort($rows); | |
var_export($flat); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$rows = array(); | |
foreach (CRM_Core_DAO_AllCoreTables::get() as $class => $entityType) { | |
$row = array( | |
'fields()' => $class::fields(), | |
'fieldKeys()' => $class::fieldKeys(), | |
'getTableName()' => $class::getTableName(), | |
'import()' => $class::import(), | |
'export()' => $class::export(), | |
'getReferenceColumns()' => $class::getReferenceColumns(), | |
); | |
$rows[$class] = $row; | |
} | |
CRM_Utils_Array::flatten($rows, $flat, '', '::'); | |
ksort($rows); | |
var_export($flat); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment