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)";
16 static $cli_opts = array(
26 'desc' => 'Files to Overwrite',
40 $ff = HTML_FlexyFramework::get();
41 if (!empty($ff->cli)) {
46 parent::getAuth(); // load company!
47 $au = $this->getAuthUser();
48 if (!$au || $au->company()->comptype != 'OWNER') {
49 $this->jerr("Not authenticated", array('authFailure' => true));
51 $this->authUser = $au;
55 function get($args, $opts)
59 HTML_FlexyFramework::run('Core/UpdateDatabase');
63 require_once 'Pman/Core/Generator.php';
64 ini_set('pcre.backtrack_limit', 2000000);
65 ini_set('pcre.recursion_limit', 2000000);
68 $lastarg = $this->cli ? array_pop($_SERVER['argv']) : '';
69 if (preg_match('/RunGenerator/', $lastarg)) {
72 $x = new Pman_Core_Generator();
73 // $x->page = clone($this);
76 $modules = is_string($opts['modules']) ? array($opts['modules']) : $opts['modules'];
77 $overwrite = is_string($opts['overwrite']) ? array($opts['overwrite']) : $opts['overwrite'];
79 $x->start($this->cli, $modules, overwrite);
81 // technically it would be good to trash the cached ini files here..
82 // however we can not really do that, as the ownships are off..
83 //we can however regen our own files..
84 HTML_FlexyFramework::get()->generateDataobjectsCache(true);