Quote from: Bruno17 at Sep 20, 2010, 11:23 AM
after running this code...
That’s great but....run it how? Paste it as a snippet and then put the snippet on a resource page? Seems a bit of a hack. Run it from the command line? Will need to include modx in that case. What’s the recommended and/or fastest way to do this? Could there be a utility CMP made for this kind of thing? (Excuse my ignorance I’m on day 3 of using MODx)
Also, it seems to me, this would be a common enough use case that there might be justification for adding a convenience method to Generator e.g.
$generator->writeAndParseSchema($packageName, $prefix, $restrictPrefix);
The path(s) can default to e.g.:
$modx->getOption('core_path') . 'components/'.$packageName.'/model
The writeAndParseSchema convenience method can also create the necessary folders if they don’t already exist. Of course this is MODx specific so it perhaps shouldn’t go on the Generator class as that I presume is part of xPDO. So, instead, could this convenience wrapper be put on MODx somewhere?
[OT] In fact, could there be a developer-oriented CMP that creates the standard folder layout for new components and other common setup for custom component development? Just thinking aloud here.