Download the PHP package hectorqin/think-generate without Composer

On this page you can find all versions of the php package hectorqin/think-generate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package think-generate

thinkphp-generator

命令行自动生成数据表模型、校验器、控制器等

框架要求

ThinkPHP5.1+ 及 ThinkPHP6

安装

composer require hectorqin/think-generate

配置

修改项目根目录下config/generator.php中对应的参数

自动生成控制器需要的类

BusinessException 业务异常类

errorCode 错误常量类

使用

# 帮助
$ php think generate --help
Usage:
  generate [options]

Options:
  -c, --config[=CONFIG]              配置名称,默认为 generator [default: "generator"]
  -t, --table[=TABLE]                要生成的table,多个用,隔开, 默认为所有table
  -p, --tablePrefix[=TABLEPREFIX]    table前缀,多个用,隔开
  -i, --ignoreFields[=IGNOREFIELDS]  忽略的字段,不生成搜索器
  -e, --except[=EXCEPT]              要排除的table,多个用,隔开
      --type[=TYPE]                  要生成的类型,多个用,隔开,如 m,v,c,p,s,d
                                            m -- model, v -- validate, c -- controller, p -- postmanJson, s -- searchAttr, d -- model doc
      --templateDir[=TEMPLATEDIR]    自定义模板文件夹路径,必须有 model.tpl,
                                     controller.tpl, validate.tpl等文件,使用tp模板语法
      --mModule[=MMODULE]            模型模块名
      --vModule[=VMODULE]            校验器模块名
      --cModule[=CMODULE]            控制器模块名
      --mLayer[=MLAYER]              模型分层
      --vLayer[=VLAYER]              校验器分层
      --cLayer[=CLAYER]              控制器分层
      --mBase[=MBASE]                模型继承类,如 app\common\model\EventModel
      --vBase[=VBASE]                校验器继承
      --cBase[=CBASE]                控制器继承类
      --db[=DB]                      数据库配置文件名
      --dryRun[=DRYRUN]              只执行,不保存 [default: false]
  -f, --force[=FORCE]                覆盖已存在文件 [default: false]
      --pName[=PNAME]                PostMan 项目名称,默认使用 数据库名
      --pHost[=PHOST]                PostMan API请求前缀,默认使用 api_prefix 环境变量
  -h, --help                         Display this help message
  -V, --version                      Display this console version
  -q, --quiet                        Do not output any message
      --ansi                         Force ANSI output
      --no-ansi                      Disable ANSI output
  -n, --no-interaction               Do not ask any interactive question
  -v|vv|vvv, --verbose               Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

# 生成 user 表模型、校验器、控制器
php think generate -t user --type=m,v,c

# 生成数据库全部数据表的模型、校验器、控制器
php think generate --type=m,v,c

# 不生成,预览操作
php think generate --type=m,v,c -d

License

Apache-2.0


All versions of think-generate with dependencies

PHP Build Version
Package Version
Requires topthink/framework Version >= 5.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hectorqin/think-generate contains the following files

Loading the files please wait ....