wajatimur/odbc-driver 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

wajatimur/odbc-driver

Composer 安装命令:

composer require wajatimur/odbc-driver

包简介

ODBC Driver for Laravel

README 文档

README

An ODBC driver implementation, currently its support Laravel Framework only.

Requirements

  • PHP 5.3+
  • Laravel 4.1.*

Installation

L4ODBC can be install using composer by adding below line into your existing composer.json under require section and executing composer update in your Laravel project root folder.

"wajatimur/odbc-driver": "dev-master"

Then you need to bootstrap the driver by declaring the service provider registration in you app.php file under app\config path from Laravel project root folder.

'Foundation\Database\Driver\ODBCDriverServiceProvider',

Configuration

Finally be sure to add the odbc driver with connection information to the config/database.php file like so:

    'connections' => array(

        // .. Existing config here ..

        'odbc' => array(
            'driver' => 'odbc',
            'dsn' => 'Driver={iSeries Access ODBC Driver};System=my_system_name;',
            'grammar' => 'DB2',
            'username' => 'foo',
            'password' => 'bar',
            'database' => '',
        ),
    ),

Extending

To create a custom grammar just add your file to Grammars folder within the package. Below is the basic template to create a custom grammar.

namespace Foundation\Database\Driver\Grammars;

use Illuminate\Database\Query\Grammars\Grammar;

class MyCustomGrammar extends {
    // .. Add your override method here ..
}

Using Custom Grammar

To use the custom grammar, jusct change the grammar key in you database config base on you grammar file name. If you have a custom grammar with file name MyCustomGrammar.php, the grammar key should be as below.

'odbc' => array(
    'driver' => 'odbc',
    'dsn' => 'some driver',
    'grammar' => 'MyCustomGrammar',
    'username' => 'foo',
    'password' => 'bar',
    'database' => '',
),

If you would like to use a Laravel provided grammar file just add that instead. For example if you want to use SQL Server Gramamr, you can use the SqlServerGrammar as key in your database config. Others grammar provided by Laravel listed below.

  • MySqlGrammar
  • SqlServerGrammar
  • SQLiteGrammar
  • PostgresGrammar

If you would like to submit a grammar for use in the package please submit a pull request and I will get it in asap.

统计信息

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

GitHub 信息

  • Stars: 8
  • Watchers: 2
  • Forks: 46
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2014-05-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固