示例#1
0
 function get($args, $opts)
 {
     print_R($opts);
     exit;
     require_once 'Pman/Builder/Generator.php';
     ini_set('pcre.backtrack_limit', 2000000);
     ini_set('pcre.recursion_limit', 2000000);
     $this->init();
     $lastarg = $this->cli ? array_pop($_SERVER['argv']) : '';
     if (preg_match('/RunGenerator/', $lastarg)) {
         $lastarg = '';
     }
     $x = new Pman_Builder_Generator();
     // $x->page = clone($this);
     $x->start($this->cli, $args, $lastarg);
     die("done!");
 }
示例#2
0
 function readerRaw($tb)
 {
     // just ouput stuff...
     require_once 'Pman/Builder/Generator.php';
     require_once 'Pman/Builder/Generator/JSON.php';
     $x = DB_DataObject::factory('Builder');
     $basedef = $x->getDatabaseConnection()->tableInfo($tb);
     $def = Pman_Builder_Generator::tableToData($tb, $basedef);
     require_once 'Pman/Builder/Generator/JSON.php';
     $j = new Pman_Builder_Generator_JSON(array('crlf' => "\n", 'tab' => '    '));
     $j2 = new Pman_Builder_Generator_JSON(array('crlf' => '', 'tab' => ''));
     $x = 'new Roo.data.JsonReader(' . $j->encodeUnsafe($def['args']);
     $ret = trim(substr($x, 0, -1)) . ",\n";
     // strip of trailing ;};
     $ret .= $j->tab . "fields : [\n" . $j->tab . $j->tab;
     $ar = array();
     foreach ($def['readers'] as $xr) {
         $ar[] = $j2->encodeUnsafe($xr);
     }
     $ret .= implode(",\n" . $j->tab . $j->tab, $ar);
     $ret .= "\n" . $j->tab . "]\n})\n";
     return $ret;
 }