定制 thecsea/mysqltcs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

thecsea/mysqltcs

最新稳定版本:v3.1.0

Composer 安装命令:

composer require thecsea/mysqltcs

包简介

The simplest and the most powerful library to access to a mysql database, optimizing the connections and allowing you to perform common database actions immediately and efficiently

README 文档

README

Build status: Build Status Scrutinizer Code Quality Code Coverage Build Status Latest Stable Version Total Downloads Latest Unstable Version License

The simplest and the most powerful library for mysql written in php:

  • You can use the same db connection in more than one instances (optimizing mysql physical connections)
  • This library allow you to make common database operations immediately and efficiently, returning simple data structures
  • Log all actions performed on db
  • All mysql error as exception
  • Clone support
  • Transactions support

Download, install and use

Download

via git

Clone repository

git clone https://github.com/thecsea/mysqltcs.git

via composer

download composer here https://getcomposer.org/

add the following dependence in composer.json

"thecsea/mysqltcs": "3.0.*"

or type

php composer.phar require thecsea/mysqltcs

##Install/Update Update composer (download composer here https://getcomposer.org/)

php composer.phar self-update

Followings commands must be executed in project root directory

###Install mysqltcs

php composer.phar install

###Update mysqltcs

You can perform an updated if you have added mysqltcs as composer dependency

php composer.phar update

You have to perform an update when a new version is released

##How to use

When composer installation is finished you will see vendor/autoload.php that is the auload generated by composer. If you have set mysqltcs as composer dependence the autoload loads both mysqltcs and other dependecies. So you just have to include autload in each file where you want use mysqltcs and create the mysqtcs object in the following way:

$connection = new it\thecsea\mysqltcs\Mysqltcs(...);

or

use it\thecsea\mysqltcs\Mysqltcs; and $connection = new Mysqltcs(...);

You can see examples to understand how to use library

You can also take a look to wiki to see the detailed description or go to generated phpdoc documents (documentations of all classes)

Tests

Mysqltcs is tested with automatic test: phpunit test. So we have a good chance of not having errors, but not the certainty. But we have covered the following percentage of statements with tests: Code Coverage

  • Change db data in tests/config.php
  • Import tests/mysqltcs.sql
  • Execute the unit tests:
  1. Go in the root directory
  2. Type phpunit or if you have downloaded the phar php phpunit-xxx.phar

In fact phpunit.xml contains the correct test configuration

CAUTION: each time tests are executed, the database must be in the initial state, like the import has just been executed (you should have a empty table, only the db structure)

#Examples You can find some examples under examples to run it:

  • Change db data in examples/config.php
  • Import examples/mysqltcs.sql

There is a simple example simpleExample.php that shows you how to use the library in the simplest way

There are not examples about transactions yet (you have to remember to set autocommit to true after using transactions)

N.B. if you have added mysqltcs as composer dependency you will find example under vendor/thecsea/mysqltcs/examples

By thecsea.it

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2015-06-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固