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)',
42 $ff = HTML_FlexyFramework::get();
43 if (!empty($ff->cli)) {
48 parent::getAuth(); // load company!
49 $au = $this->getAuthUser();
50 if (!$au || $au->company()->comptype != 'OWNER') {
51 $this->jerr("Not authenticated", array('authFailure' => true));
53 $this->authUser = $au;
57 function get($args, $opts)
59 //print_r($opts);exit;
61 HTML_FlexyFramework::run('Core/UpdateDatabase');
65 require_once 'Pman/Core/Generator.php';
66 ini_set('pcre.backtrack_limit', 2000000);
67 ini_set('pcre.recursion_limit', 2000000);
70 $x = new Pman_Core_Generator();
71 // $x->page = clone($this);
74 $modules = $opts['module'];
75 // overwrite can be multiple
76 $overwrite = is_string($opts['overwrite']) ? array($opts['overwrite']) : $opts['overwrite'];
78 $x->start($this->cli, $modules, $overwrite);
80 // technically it would be good to trash the cached ini files here..
81 // however we can not really do that, as the ownships are off..
82 //we can however regen our own files..
83 HTML_FlexyFramework::get()->generateDataobjectsCache(true);