'min' => 1,
'max' => 1,
),
+ 'procedures-only' => array(
+ 'desc' => 'Only import procedures (not supported by most modules yet) - ignores sql directory',
+ 'default' => '',
+ 'min' => 1,
+ 'max' => 1,
+ ),
+
'json-person' => array(
'desc' => 'Person JSON file',
function get($args, $opts)
{
-
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
(!empty($dburl['pass']) ? ' -p' . escapeshellarg($dburl['pass']) : '') .
' ' . basename($dburl['path']);
//echo $mysql_cmd . "\n" ;
+
+ $files = glob($dir.'/*.sql');
+ uksort($files, 'strcasecmp');
+
-
- foreach(glob($dir.'/*.sql') as $fn) {
+ foreach($files as $fn) {
if (preg_match('/migrate/i', basename($fn))) { // skip migration scripts at present..
echo $psql_cmd . "\n" ;
echo "scan : $dir\n";
- foreach(glob($dir.'/*.sql') as $bfn) {
+
+ $files = glob($dir.'/*.sql');
+ uksort($files, 'strcasecmp');
+ //$lsort = create_function('$a,$b','return strlen($a) > strlen($b) ? 1 : -1;');
+ //usort($files, $lsort);
+
+
+
+ foreach($files as $bfn) {
if (preg_match('/migrate/i', basename($bfn))) { // skip migration scripts at present..
if (!preg_match('/^json-/', $o) || empty($v)) {
continue;
}
- $type = str_replace('_', '-', substr($o,6));
- $data= json_decode(file_get_contents($file),true);
- DB_DataObject::factory($type)->importFromArray($this,$data,$opts);
+ $type = str_replace('_', '-', substr($o,5));
+
+ $data= json_decode(file_get_contents($v),true);
+ $pg = HTML_FlexyFramework::get()->page;
+ DB_DataObject::factory($type)->importFromArray($pg ,$data,$opts);
}
{
$enum = DB_DataObject::Factory('core_enum');
- DB_DAtaObject::debugLevel(1);
+ //DB_DAtaObject::debugLevel(1);
$enum->initEnums(
array(
array(
'name' => 'bcc-email', // group who are bcc'ed on all requests.
'type' => 0, // system
),
-
+ array(
+ 'name' => 'system-email-from',
+ 'type' => 0, // system
+ ),
));
}
$c->query("
UPDATE Companies
SET
- comptype_id = (SELECT id FROM core_enum where etype='comptype' and name=Companies.comptype)
+ comptype_id = (SELECT id FROM core_enum where etype='comptype' and name=Companies.comptype LIMIT 1)
WHERE
comptype_id = 0
AND