View Source

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{composition-setup}{composition-setup}]]></ac:plain-text-body></ac:macro>
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFPROP:Proposal Zone Template}

{zone-data:component-name}
Zend_Db_Adapter_Sqlsrv
{zone-data}

{zone-data:proposer-list}
[Juozas Kaziukenas|mailto:juozas@juokaz.com]
[Rob Allen|mailto:rob@akrabat.com]
{zone-data}

{zone-data:liaison}
Ralph Schindler
{zone-data}

{zone-data:revision}
0.1 - 23 June 2009: Creation of page.
{zone-data}

{zone-data:overview}
Zend_Db_Adapter_Sqlsrv provides a Zend_Db_Adapter that interfaces with the [Microsoft SQL Server Driver for PHP|http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx]
{zone-data}

{zone-data:references}
* [Microsoft SQL Server Driver for PHP|http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx]
* [Zend Framework Db adapter for Microsoft SQL native client on codeplex|http://zfmssql.codeplex.com/]
* [zfmssql source code|https://zfmssql.svn.codeplex.com/svn/]
{zone-data}

{zone-data:requirements}
* This component *will* require Sqlsrv PHP extension ([Microsoft SQL Server Driver for PHP|http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx])

{zone-data}

{zone-data:dependencies}
* Zend_Db_Adapter_Exception
* Zend_Db_Adapter_Abstract
* Zend_Db_Statement_Exception
* Zend_Db_Statement
{zone-data}

{zone-data:operation}
The component works just like every Zend_Db_Adapter and is instantiated using Zend_db::factory().
{zone-data}

{zone-data:milestones}
* Milestone 1: Complete proposal
* Milestone 2: Working prototype checked into the incubator
* Milestone 3: Unit tests completed
* Milestone 4: Initial documentation completed
{zone-data}

{zone-data:class-list}
* Zend_Db_Adapter_Sqlsrv_Exception
* Zend_Db_Adapter_Sqlsrv
* Zend_Db_Statement_Sqlsrv_Exception
* Zend_Db_Statement_Sqlsrv
{zone-data}

{zone-data:use-cases}

{deck:id=Use Cases}
{card:label=Ini file}
{code:ini}
;application.ini
resources.db.adapter = Sqlsrv
resources.db.params.host = "localhost\SQLEXPRESS"
resources.db.params.username = sa
resources.db.params.password = password
resources.db.params.dbname = database
{code}
{card}
{card:label=Factory method}
{code:php}
$db = Zend_Db::factory('Sqlsrv', $db_params);
{code}
{card}
{deck}
{zone-data}

{zone-data:skeletons}
{code}
class Zend_Db_Adapter_Sqlsrv_Exception extends Zend_Db_Adapter_Exception {}

class Zend_Db_Statement_Sqlsrv_Exception extends Zend_Db_Statement_Exception {}

class Zend_Db_Adapter_Sqlsrv extends Zend_Db_Adapter_Abstract
{
public function isConnected() {}
public function closeConnection()
public function prepare($sql) {}
public function lastInsertId($tableName = null, $primaryKey = null) {}
public function insert($table, array $bind) {}
public function listTables() {}
public function describeTable($tableName, $schemaName = null) {}
public function setFetchMode($mode) {}
public function limit($sql, $count, $offset = 0) {}
public function supportsParameters($type) {}
public function getServerVersion() {}
}

class Zend_Db_Statement_Sqlsrv extends Zend_Db_Statement
{
public function closeCursor() {}
public function columnCount() {}
public function errorCode() {}
public function errorInfo() {}
public function _execute(array $params = null) {} /* every other adapter has this public... */
public function fetch($style = null, $cursor = null, $offset = null) {}
public function fetchColumn($col = 0) {}
public function fetchObject($class = 'stdClass', array $config = array()) {}
public function nextRowset() {}
public function rowCount() {}
}
{code}
{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>