Skip to content

Commit

Permalink
Added temporary exception for warning users of the change from login …
Browse files Browse the repository at this point in the history
…=> username
  • Loading branch information
lorenzo committed Nov 1, 2014
1 parent c760a0f commit b552692
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Cache/Engine/MemcachedEngine.php
Expand Up @@ -147,7 +147,7 @@ public function init(array $config = []) {
}
}

if (empty($this->_config['username']) && !empty($config['login'])) {
if (empty($this->_config['username']) && !empty($this->_config['login'])) {
throw new InvalidArgumentException(
'Please pass "username" instead of "login" for connecting to Memcached'
);
Expand Down
7 changes: 7 additions & 0 deletions src/Database/Driver/PDODriverTrait.php
Expand Up @@ -15,6 +15,7 @@
namespace Cake\Database\Driver;

use Cake\Database\Statement\PDOStatement;
use InvalidArgumentException;
use PDO;

/**
Expand All @@ -35,8 +36,14 @@ trait PDODriverTrait {
* @param string $dsn A Driver-specific PDO-DSN
* @param array $config configuration to be used for creating connection
* @return bool true on success
* @throws InvalidArgumentException
*/
protected function _connect($dsn, array $config) {
if (empty($config['username']) && !empty($config['login'])) {
throw new InvalidArgumentException(
'Please pass "username" instead of "login" for connecting to the database'
);
}
$connection = new PDO(
$dsn,
$config['username'],
Expand Down

0 comments on commit b552692

Please sign in to comment.