Esempio n. 1
0
 static function generate($argv)
 {
     $dir = array_shift($argv);
     $appid = array_shift($argv);
     dump($appid, '$appid');
     if (empty($dir) || empty($appid)) {
         return self::help();
     }
     $tpl = array_shift($argv);
     $generator = new QGenerator_Application();
     return $generator->generate($appid, $dir, $tpl);
 }
Esempio n. 2
0
    }
    $parent_dir = trim($_POST['parent_dir']);
    $p = realpath($parent_dir);
    if (!$parent_dir || $p == dirname(__FILE__) || !is_dir($p)) {
        $error[] = sprintf('设置的目录名 "%s" 无效.', $parent_dir);
    } else {
        $parent_dir = $p;
    }
    $tpl_name = trim($_POST['tpl_name']);
    if (empty($error)) {
        // 创建应用程序
        require dirname(dirname(__FILE__)) . '/library/q.php';
        Q::import(dirname(dirname(__FILE__)) . '/extended');
        ob_start();
        $generator = new QGenerator_Application();
        $generator->generate($appid, $parent_dir, $tpl_name);
        $output = ob_get_clean();
        $appid = $parent_dir = '';
    }
} else {
    $error = array();
    $appid = '';
    $parent_dir = '';
    $output = '';
}
$tpl_list = (require dirname(dirname(__FILE__)) . '/extended/qgenerator/_templates/apps/apptpl_list.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />