承接 programster/orm-generator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

programster/orm-generator

Composer 安装命令:

composer require programster/orm-generator

包简介

This package automates the creation of the table and object files for each of your database tables when you are using the irap/mysql-objects or programster/pgsql-objects package.

关键字:

README 文档

README

This package is here to take the tediousness out of having to create a table and object file for each of your database tables when you are using the programster/mysql-objects or programster/pgsql-objects packages for interfacing with your database.

Install

composer require programster/orm-generator

Usage

Write a small script to load the database setings and specify where the generated files should be put. For example, if you are using MySQL:

$db = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
$generator = new \Programster\OrmGenerator\MySqlGenerator($db, __DIR__ . '/output');
$generator->run();

Alternatively, if you are using PostgreSQL:

$connString =
    "host=" . DB_HOST
    . " dbname=" . DB_NAME
    . " user=" . DB_USER
    . " password=" . DB_PASSWORD
    . " port=" . DB_PORT
    . " options='--client_encoding=UTF8'";

$db = pg_connect($connString);

if ($db == false)
{
    throw new Exception("Failed to initialize database connection.");
}

$generator = new \Programster\OrmGenerator\PgSqlGenerator($db, __DIR__ . '/output');
$generator->run();

After you execute the script, navigate to that folder and you should see a table and object file for each of your database's tables.

统计信息

  • 总下载量: 1.33k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-12-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固