After about 6 total hours of lost-in-the-wilderness debugging, I’ve finally figured out the problems:
1. My revo database was called "modx-production". The xPDO generator was choking on this (the dash), because it wasn’t surrounding the database name with backticks. I’ve filed a bug:
http://bugs.modx.com/issues/2788
2. The CreateXpdoClasses snippet also has a bug: when no prefix is specified, the argument that gets passed to writeSchema() for $prefixRequired should be ’false’ rather than true.
/* table prefix; must match the prefix of the tables you want to process */
$myPrefix = empty ($myPrefix)? '' : $myPrefix;
$prefixRequired = ($myPrefix === '') ? false : true;
....
$xml= $generator->writeSchema($file,
$myPackage, '',$myPrefix,$prefixRequired,$myTables);
This is because of the way the ’getTableName’ function is written (in xpdogenerator.class.php) - it will return an empty string if the prefix is empty but prefixRequired is set to ’true’:
public function getTableName($string, $prefix= '', $prefixRequired= false) {
if (!empty($prefix) && strpos($string, $prefix) === 0) {
$string= substr($string, strlen($prefix));
}
elseif ($prefixRequired) {
$string= '';
}
return $string;
}
That could arguably be considered a bug itself -- I’d probably make the case that an empty prefix + "prefixRequired=true" really ought to just be treated the same as "prefixRequired=false" -- but I’m not sure and my brain hurts.
At any rate, I’ve got my schema and class files now