Download the PHP package tekintian/mydb without Composer

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

支持主从,分库分表的高效安全的mysql/mysqli数据库驱动封装

使用方法

composer require tekintian\mydb

// 使用自动加载
require_once __DIR__ . '/vendor/autoload.php';
// 利用类继承给类起个简短的别名
class DB extends tekintian\mydb\MyDb {}

// 获取MyDb中的 $db 对象并引用赋值给 $db
$db = & DB::object();
$dbversion = $db->version(); // 使用 $db对象获取mysql版本

// DB静态方法查询数据
// 使用 DB::table('common_district') 来自动加上配置的数据库表前缀
$list = DB::fetch_all("select * from " . DB::table('common_district') . " limit 100");

print_r($list);

使用示例

pp($list);

// 使用 DB::table('common_district') 来自动加上配置的数据库表前缀
$list = DB::fetch_all("select * from " . DB::table('common_district') . " limit 100");

pp($list);

// 复杂查询示例
// $query = DB::query("SELECT me.id, me.uid, me.medalid, me.dateline, me.expiration, mf.medals
//                  FROM " . DB::table('forum_medallog') . " me
//                  LEFT JOIN " . DB::table('common_member_field_forum') . " mf USING (uid)
//                  WHERE id IN ($ids)");
// while ($vv = DB::fetch($query)) {

// }

// 更多的查询方法,可参考 dz的源码

配置示例


/**
 * 数据库配置文件
 * @Author: tekin
 * @Date:   2020-06-12 12:13:29
 * @Last Modified 2020-06-13
 * @Last Modified time: 2020-06-13 14:00:21
 */
$_config = array();

// ----------------------------  CONFIG DB  ----------------------------- //
$_config['db']['1']['dbhost'] = 'localhost';
$_config['db']['1']['dbuser'] = 'ultrax';
$_config['db']['1']['dbpw'] = 'ultraxultrax';
$_config['db']['1']['dbcharset'] = 'utf8';
$_config['db']['1']['pconnect'] = '0';
$_config['db']['1']['dbname'] = 'ultrax';
$_config['db']['1']['tablepre'] = 'pre_';
$_config['db']['slave'] = '';
$_config['db']['common']['slave_except_table'] = '';

// -------------  CONFIG SECURITY  ------------ //
$_config['security']['querysafe']['status'] = 1;
$_config['security']['querysafe']['dfunction']['0'] = 'load_file';
$_config['security']['querysafe']['dfunction']['1'] = 'hex';
$_config['security']['querysafe']['dfunction']['2'] = 'substring';
$_config['security']['querysafe']['dfunction']['3'] = 'if';
$_config['security']['querysafe']['dfunction']['4'] = 'ord';
$_config['security']['querysafe']['dfunction']['5'] = 'char';
$_config['security']['querysafe']['daction']['0'] = '@';
$_config['security']['querysafe']['daction']['1'] = 'intooutfile';
$_config['security']['querysafe']['daction']['2'] = 'intodumpfile';
$_config['security']['querysafe']['daction']['3'] = 'unionselect';
$_config['security']['querysafe']['daction']['4'] = '(select';
$_config['security']['querysafe']['daction']['5'] = 'unionall';
$_config['security']['querysafe']['daction']['6'] = 'uniondistinct';
$_config['security']['querysafe']['dnote']['0'] = '/*';
$_config['security']['querysafe']['dnote']['1'] = '*/';
$_config['security']['querysafe']['dnote']['2'] = '#';
$_config['security']['querysafe']['dnote']['3'] = '--';
$_config['security']['querysafe']['dnote']['4'] = '"';
$_config['security']['querysafe']['dlikehex'] = 1;
$_config['security']['querysafe']['afullnote'] = '0';

for($i = 1; $i <= 100; $i++) { if(isset($this->map['forum_thread'])) { $this->map['forumthread'.$i] = $this->map['forum_thread']; } if(isset($this->map['forum_post'])) { $this->map['forumpost'.$i] = $this->map['forum_post']; } if(isset($this->map['forum_attachment']) && $i <= 10) { $this->map['forumattachment'.($i-1)] = $this->map['forum_attachment']; } } if(isset($this->map['common_member'])) { $this->map['common_member_archive'] = $this->map['common_member_count'] = $this->map['common_member_count_archive'] = $this->map['common_member_status'] = $this->map['common_member_status_archive'] = $this->map['common_member_profile'] = $this->map['common_member_profile_archive'] = $this->map['common_member_field_forum'] = $this->map['common_member_field_forum_archive'] = $this->map['common_member_field_home'] = $this->map['common_member_field_home_archive'] = $this->map['common_member_validate'] = $this->map['common_member_verify'] = $this->map['common_member_verify_info'] = $this->map['common_member']; }


All versions of mydb with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
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 tekintian/mydb contains the following files

Loading the files please wait ....