5 * this is technically a cli wrapper for the generator..
7 * we will test it on the web initially..
11 require_once 'Pman.php';
12 class Pman_Core_RunGenerator extends Pman
14 static $cli_desc = "Generate DataObjects (runs updatedatabase first)
15 does not change files, just shows you want would happen";
18 static $cli_opts = array(
20 'desc' => 'Module (if new tables are found, they will be put in the modules database directory',
28 'desc' => 'Files to Overwrite (use _all_ to create everything)',
36 'desc' => 'Do not update the database using sql',
50 $ff = HTML_FlexyFramework::get();
51 if (!empty($ff->cli)) {
56 parent::getAuth(); // load company!
57 $au = $this->getAuthUser();
58 if (!$au || $au->company()->comptype != 'OWNER') {
59 $this->jerr("Not authenticated", array('authFailure' => true));
61 $this->authUser = $au;
65 function get($args, $opts)
67 //print_r($opts);exit;
68 if (empty($opts['noupdate'])) {
69 HTML_FlexyFramework::run('Core/UpdateDatabase');
75 require_once 'Pman/Core/Generator.php';
76 ini_set('pcre.backtrack_limit', 2000000);
77 ini_set('pcre.recursion_limit', 2000000);
80 $x = new Pman_Core_Generator();
81 // $x->page = clone($this);
84 $modules = $opts['module'];
85 // overwrite can be multiple
86 $overwrite = is_string($opts['overwrite']) ? array($opts['overwrite']) : $opts['overwrite'];
88 $x->start($this->cli, $modules, $overwrite);
90 // technically it would be good to trash the cached ini files here..
91 // however we can not really do that, as the ownships are off..
92 //we can however regen our own files..
93 HTML_FlexyFramework::get()->generateDataobjectsCache(true);