Skip to content

Commit

Permalink
Update headers & doc blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Mar 5, 2013
1 parent 3462539 commit 812a060
Show file tree
Hide file tree
Showing 29 changed files with 395 additions and 220 deletions.
17 changes: 16 additions & 1 deletion lib/Cake/Model/Datasource/Database/Connection.php
@@ -1,5 +1,20 @@
<?php

/**
* PHP Version 5.4
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package Cake.Model
* @since CakePHP(tm) v 3.0.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace Cake\Model\Datasource\Database;

use Cake\Model\Datasource\Database\Exception\MissingConnectionException;
Expand Down
16 changes: 8 additions & 8 deletions lib/Cake/Model/Datasource/Database/Dialect/PostgresDialect.php
@@ -1,18 +1,18 @@
<?php
/**
*
* PHP Version 5.4
*
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The Open Group Test Suite License
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2013, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests
* @package Cake.Test.Case.Model.Datasource.Database
* @since CakePHP(tm) v 3.0
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package Cake.Model
* @since CakePHP(tm) v 3.0.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace Cake\Model\Datasource\Database\Dialect;
Expand Down
17 changes: 16 additions & 1 deletion lib/Cake/Model/Datasource/Database/Driver.php
@@ -1,5 +1,20 @@
<?php

/**
* PHP Version 5.4
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package Cake.Model
* @since CakePHP(tm) v 3.0.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace Cake\Model\Datasource\Database;

use \Cake\Model\Datasource\Database\SqlDialect;
Expand Down
21 changes: 18 additions & 3 deletions lib/Cake/Model/Datasource/Database/Driver/Mysql.php
@@ -1,5 +1,20 @@
<?php

/**
* PHP Version 5.4
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package Cake.Model
* @since CakePHP(tm) v 3.0.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace Cake\Model\Datasource\Database\Driver;

use PDO;
Expand Down Expand Up @@ -30,7 +45,7 @@ class Mysql extends \Cake\Model\Datasource\Database\Driver {
*
* @param array $config configuration to be used for creating connection
* @return boolean true on success
**/
*/
public function connect(array $config) {
$config += $this->_baseConfig;
$config['flags'] += [
Expand All @@ -54,7 +69,7 @@ public function connect(array $config) {
* Returns whether php is able to use this driver for connecting to database
*
* @return boolean true if it is valid to use this driver
**/
*/

public function enabled() {
return in_array('mysql', PDO::getAvailableDrivers());
Expand Down
37 changes: 26 additions & 11 deletions lib/Cake/Model/Datasource/Database/Driver/PDODriver.php
@@ -1,5 +1,20 @@
<?php

/**
* PHP Version 5.4
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package Cake.Model
* @since CakePHP(tm) v 3.0.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace Cake\Model\Datasource\Database\Driver;

use Cake\Model\Datasource\Database\Statement;
Expand All @@ -12,7 +27,7 @@ trait PDODriver {
*
* @param array $config configuration to be used for creating connection
* @return boolean true on success
**/
*/
public function connect(array $config) {
$connection = new PDO(
$config['dsn'],
Expand All @@ -30,7 +45,7 @@ public function connect(array $config) {
* result to the value passed
*
* @return mixed connection object used internally
**/
*/
public function connection($connection = null) {
if ($connection !== null) {
$this->_connection = $connection;
Expand All @@ -42,7 +57,7 @@ public function connection($connection = null) {
* Disconnects from database server
*
* @return void
**/
*/
public function disconnect() {
$this->_connection = null;
}
Expand All @@ -52,7 +67,7 @@ public function disconnect() {
*
* @param string $sql
* @return Cake\Model\Datasource\Database\Statement
**/
*/
public function prepare($sql) {
$statement = $this->connection()->prepare($sql);
return new Statement($statement, $this);
Expand All @@ -62,7 +77,7 @@ public function prepare($sql) {
* Starts a transaction
*
* @return boolean true on success, false otherwise
**/
*/
public function beginTransaction() {
return $this->connection()->beginTransaction();
}
Expand All @@ -71,7 +86,7 @@ public function beginTransaction() {
* Commits a transaction
*
* @return boolean true on success, false otherwise
**/
*/
public function commitTransaction() {
return $this->connection()->commit();
}
Expand All @@ -80,7 +95,7 @@ public function commitTransaction() {
* Rollsback a transaction
*
* @return boolean true on success, false otherwise
**/
*/
public function rollbackTransaction() {
return $this->connection()->rollback();
}
Expand All @@ -89,7 +104,7 @@ public function rollbackTransaction() {
* Returns a value in a safe representation to be used in a query string
*
* @return string
**/
*/
public function quote($value, $type) {
return $this->connection()->quote($value, $type);
}
Expand All @@ -99,7 +114,7 @@ public function quote($value, $type) {
*
* @param string $table table name or sequence to get last insert value from
* @return string|integer
**/
*/
public function lastInsertId($table = null) {
return $this->connection()->lastInsertId();
}
Expand All @@ -108,7 +123,7 @@ public function lastInsertId($table = null) {
* Checks if the driver supports quoting, as PDO_ODBC does not support it.
*
* @return boolean
**/
*/
public function supportsQuoting() {
return $this->connection()->getAttribute(PDO::ATTR_DRIVER_NAME) !== 'odbc';
}
Expand Down
26 changes: 13 additions & 13 deletions lib/Cake/Model/Datasource/Database/Driver/Postgres.php
@@ -1,18 +1,18 @@
<?php
/**
*
* PHP Version 5.4
*
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The Open Group Test Suite License
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2013, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests
* @package Cake.Test.Case.Model.Datasource.Database
* @since CakePHP(tm) v 3.0
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package Cake.Model
* @since CakePHP(tm) v 3.0.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace Cake\Model\Datasource\Database\Driver;
Expand Down Expand Up @@ -49,7 +49,7 @@ class Postgres extends \Cake\Model\Datasource\Database\Driver {
*
* @param array $config configuration to be used for creating connection
* @return boolean true on success
**/
*/
public function connect(array $config) {
$config += $this->_baseConfig;
$config['flags'] += [
Expand All @@ -75,7 +75,7 @@ public function connect(array $config) {
* Returns whether php is able to use this driver for connecting to database
*
* @return boolean true if it is valid to use this driver
**/
*/

public function enabled() {
return in_array('pgsql', PDO::getAvailableDrivers());
Expand All @@ -86,7 +86,7 @@ public function enabled() {
*
* @param string $sql
* @return Cake\Model\Datasource\Database\Statement
**/
*/
public function prepare($sql) {
$statement = $this->connection()->prepare($sql);
return new Statement($statement, $this);
Expand All @@ -96,7 +96,7 @@ public function prepare($sql) {
* Sets connection encoding
*
* @return void
**/
*/
public function setEncoding($encoding) {
$this->_connection->exec('SET NAMES ' . $this->_connection->quote($encoding));
}
Expand All @@ -106,7 +106,7 @@ public function setEncoding($encoding) {
* postgres will fallback to looking the relation into defined default schema
*
* @return void
**/
*/
public function setSchema($schema) {
$this->_connection->exec('SET search_path TO ' . $this->_connection->quote($schema));
}
Expand Down
23 changes: 19 additions & 4 deletions lib/Cake/Model/Datasource/Database/Driver/Sqlite.php
@@ -1,5 +1,20 @@
<?php

/**
* PHP Version 5.4
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package Cake.Model
* @since CakePHP(tm) v 3.0.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace Cake\Model\Datasource\Database\Driver;

use Cake\Model\Datasource\Database\Statement\BufferedStatement;
Expand Down Expand Up @@ -27,7 +42,7 @@ class Sqlite extends \Cake\Model\Datasource\Database\Driver {
*
* @param array $config configuration to be used for creating connection
* @return boolean true on success
**/
*/
public function connect(array $config) {
$config += $this->_baseConfig + ['login' => null, 'password' => null];
$config['flags'] += [
Expand All @@ -46,7 +61,7 @@ public function connect(array $config) {
* Returns whether php is able to use this driver for connecting to database
*
* @return boolean true if it is valid to use this driver
**/
*/

public function enabled() {
return in_array('sqlite', PDO::getAvailableDrivers());
Expand All @@ -57,7 +72,7 @@ public function enabled() {
*
* @param string $sql
* @return Cake\Model\Datasource\Database\Statement
**/
*/
public function prepare($sql) {
$statement = $this->connection()->prepare($sql);
return new BufferedStatement($statement, $this);
Expand Down
@@ -1,26 +1,24 @@
<?php
/**
*
* PHP Version 5.x
* PHP Version 5.4
*
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The Open Group Test Suite License
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests
* @package Cake.Model.Datasource.Database.Exception
* @since CakePHP(tm) v 3.0
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package Cake.Model
* @since CakePHP(tm) v 3.0.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace Cake\Model\Datasource\Database\Exception;


class MissingConnectionException extends \Cake\Error\Exception {

protected $_messageTemplate = 'Connection to database could not be established: %s';

}

0 comments on commit 812a060

Please sign in to comment.