/**
+ *
+ * THIS HAS NOT BEEN TESTED WITH PDO yet...
+ *
*
* Generate DataObjects...
*
*
*/
-require_once 'DB/DataObject/Generator.php';
+require_once 'PDO/DataObject/Generator.php';
/** basic thing now works...
-class Pman_Core_Generator extends DB_DataObject_Generator
+class Pman_Core_Generator extends PDO_DataObject_Generator
{
-
+
+ function getAuth()
+ {
+
+ die("do not use this directly.. - use Core/RunGenerator");
+
+ }
// inherrited..
// $tablekeys
$options['class_location'] = $this->rootDir .'/'.$proj.'/DataObjects';
$options['require_prefix'] = $proj . '/DataObjects/';
$options['class_prefix'] = $proj . '_DataObjects_';
+ $this->debug(print_r($options,true));
// print_r($this);exit;
$diff = System::which('diff');
// now for each of the directories copy/show diffs..
echo $cli ? '' : '<PRE>';
- $flist = explode(',', $overwrite);
+ $flist = $overwrite;
foreach($this->modtables as $m=>$ar) {
if ($options['database'] != $standard_database) {
$options['database'] = $standard_database ;
continue;
}
foreach(scandir($options['rootDir'].'/'.$m) as $f) {
+
+ echo "SCAN {$options['rootDir']} $f\n";
+
if (!strlen($f) || $f[0] == '.') {
continue;
}
if (!file_exists($tg) || !filesize($tg) ) {
- if ($cli && !filesize($tg) || in_array($f, $flist)) {
+ if ($cli && file_exists($tg) || in_array($f, $flist) || in_array('_all_', $flist )) {
echo "COPY $src $tg" . ($cli ? "\n" : "<BR>");
copy($src, $tg);
continue;
$cli = $options['cli'];
foreach($this->tables as $this->table) {
+
$this->table = trim($this->table);
$tn = strtolower($this->table);
$mod = $this->modmap[$tn];
continue;
}
+ $clean_table = preg_replace('/[^A-Z0-9]+/i','_',ucfirst(trim($this->table)));
- $this->classname = 'Pman_'.$mod . '_DataObjects_'. ucfirst($this->table); // replace odd chars?
+ $this->classname = 'Pman_'.$mod . '_DataObjects_'. $clean_table; // replace odd chars?
- $outfilename = $rd.'/'.$mod.'/'. ucfirst($this->table).'.php';
- $orig = $ff->page->rootDir .'/Pman/'.$mod.'/DataObjects/'. ucfirst($this->table).'.php';
+ $outfilename = $rd.'/'.$mod.'/'. $clean_table .'.php';
+ $orig = $ff->page->rootDir .'/Pman/'.$mod.'/DataObjects/'. $clean_table.'.php';
// file_get_contents???