2017 © Pedro Peláez
 

cakephp-plugin cakephp-sybasedb

CakePHP plugin to handle PDO MSSQL Connections using dblib

image

cpierce/cakephp-sybasedb

CakePHP plugin to handle PDO MSSQL Connections using dblib

  • Friday, January 19, 2018
  • by cpierce
  • Repository
  • 1 Watchers
  • 10 Stars
  • 1,729 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 2 Open issues
  • 7 Versions
  • 6 % Grown

The README.md

SybaseDB 1.0

Creates a PDO connection to MSSql server through Sybase dblib as a plugin for CakePHP 2.x, (*1)

Background

To many people on the Internet were looking for a simple way to connect to a MSSQL db from a linux installed cakePHP app. I was one of them so after hours of research the birth of this plugin was planned. A few hours later it was completed., (*2)

Prerequisites?

  • php5-sybase package installed on your linux system (apt-get install php5-sybase)
  • enable php Sybase module in php.ini file (extension=pdo_dblib.so)
  • CakePHP 2.x app installed and baked on your server

How to use the plugin

Update your composer.json file using the following:, (*3)

composer require cpierce/cakephp-sybasedb

Enable the Plugin in your app/Config/bootstrap.php file:, (*4)

<?php
CakePlugin::load('SybaseDB');

If you are already using CakePlugin::loadAll();, then this step is not necessary., (*5)

Configure a database connection in app/Config/database.php file:, (*6)

<?php
class DATABASE_CONFIG {

    public $default = array(
        'datasource' => 'SybaseDB.Sybase',
        'host' => 'someplace\SQLEXPRESS',
        'login' => 'somelogin',
        'password' => 'Ur_P4ssw0rd#',
        'database' => 'some_database',
    );

}

You could also use another connection instead of $default and then specifying $useDbConfig in your model., (*7)

From here you can now access the data the normal cakePHP way:, (*8)

<?php
    $this->Model->find('first');

Credit where it is due

Some of the code used was taken from the CakePHP 1.x SQLServer DBO for Microsoft Windows and altered to fit the PDO DBlib. Special thanks to the people who have used this and helped me test it (Especially Jeffery Bell and Marcel Wedel), (*9)

Change Log

Version 1.0 - Updated for better and easier use of composer., (*10)

Version 0.3b * Fixed a problem with long table cell names (over 30 characters)., (*11)

Version 0.2b * New mapping protocol thanks to version of SQL working in system now * Tested (save, delete, find('count', 'list', 'all', 'first', 'contain'), paginate, hasMany, belongsTo, etc. * Must specify $primaryKey for non "id" primary keys, (*12)

The Versions

19/01 2018

dev-master

9999999-dev http://github.com/cpierce/microsoft-sql-pdo-for-cakephp-2.x

CakePHP plugin to handle PDO MSSQL Connections using dblib

  Sources   Download

MIT

The Requires

 

cakephp pdo mssql dblib sybase

19/01 2018

1.0.5

1.0.5.0 http://github.com/cpierce/microsoft-sql-pdo-for-cakephp-2.x

CakePHP plugin to handle PDO MSSQL Connections using dblib

  Sources   Download

MIT

The Requires

 

cakephp pdo mssql dblib sybase

27/02 2017

1.0.4

1.0.4.0 http://github.com/cpierce/microsoft-sql-pdo-for-cakephp-2.x

CakePHP plugin to handle PDO MSSQL Connections using dblib

  Sources   Download

MIT

The Requires

 

cakephp pdo mssql dblib sybase

27/02 2017

1.0.3

1.0.3.0 http://github.com/cpierce/microsoft-sql-pdo-for-cakephp-2.x

CakePHP plugin to handle PDO MSSQL Connections using dblib

  Sources   Download

MIT

The Requires

 

cakephp pdo mssql dblib sybase

27/02 2017

1.0.2

1.0.2.0 http://github.com/cpierce/microsoft-sql-pdo-for-cakephp-2.x

CakePHP plugin to handle PDO MSSQL Connections using dblib

  Sources   Download

MIT

The Requires

 

cakephp pdo mssql dblib sybase

27/02 2017

1.0

1.0.0.0 http://github.com/cpierce/microsoft-sql-pdo-for-cakephp-2.x

CakePHP plugin to handle PDO MSSQL Connections using dblib

  Sources   Download

MIT

The Requires

 

cakephp pdo mssql dblib sybase

27/02 2017

1.0.1

1.0.1.0 http://github.com/cpierce/microsoft-sql-pdo-for-cakephp-2.x

CakePHP plugin to handle PDO MSSQL Connections using dblib

  Sources   Download

MIT

The Requires

 

cakephp pdo mssql dblib sybase