Download the PHP package fanqingxuan/gen-models without Composer

On this page you can find all versions of the php package fanqingxuan/gen-models. 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 gen-models

Gen Models

background

这个项目的目的是自动生成model类。一般的开源框架都有自己的orm,比如laravel,yii等,并且他们都有自己的命令行,所以不需要自己生成。但是也有一些高性能框架没有封装db层,比如yaf,phpslim,这个时候需要我们手动创建model,或者dao去操作数据库。

我们一般创建一个model基类,封装基本的增删改查方法,然后实体model去继承基类,像下面这样

这个时候我们发现,如果数据库中表比较多,我们就需要手动创建类似的代码,容易产出错误,另外每个表都有自己的主键,都有自己的表名称,需要在实体model中去声明的。

上面基本上是自己封装model的设计思路

Project goal

我们希望手动写更少的代码,减少错误,自动根据表生成model

Usage

  1. tbl_user_address表生成文件名是TblUserAddress.php,类名是TblUserAddress的驼峰类
  2. tbl_user_address表如果命令行使用了--ignore-prefix,则生成文件名UserAddress.php,类名是UserAddress的驼峰类
  3. tbl_user_address如果使用了--suffix,并且选择了Model,没有使用--ignore-prefix命令,生成文件名是TblUserAddressModel.php的TblUserAddressModel类
  4. tbl_user_address如果使用了--suffix,并且选择了Dao,使用--ignore-prefix命令,生成文件名是UserAddressDao.php的UserAddressDao类

其它

如果您电脑没有安装composer,可以使用gen-models,然后执行如下命令都可以


All versions of gen-models with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
symfony/console Version ^5.0
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 fanqingxuan/gen-models contains the following files

Loading the files please wait ....