Skip to content

Commit

Permalink
Moved default values for auth to server list to avoid notices
Browse files Browse the repository at this point in the history
  • Loading branch information
kalaspuff committed Jul 7, 2017
1 parent 5668904 commit f26a5e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Extended/Cache/Backend/Redis.php
@@ -1,7 +1,7 @@
<?php

/**
* Copyright (c) 2011-2013, Carl Oscar Aaro
* Copyright (c) 2011-2017, Carl Oscar Aaro
* All rights reserved.
*
* New BSD License
Expand Down Expand Up @@ -71,11 +71,11 @@ class Extended_Cache_Backend_Redis extends Zend_Cache_Backend implements Zend_Ca
'port' => self::DEFAULT_PORT,
'persistent' => self::DEFAULT_PERSISTENT,
'dbindex' => self::DEFAULT_DBINDEX,
'auth' => self::DEFAULT_AUTH,
'password' => self::DEFAULT_AUTH_PASSWORD,
),
),
'key_prefix' => '',
'auth' => self::DEFAULT_AUTH,
'password' => self::DEFAULT_AUTH_PASSWORD,
);

/**
Expand Down Expand Up @@ -117,7 +117,7 @@ public function __construct(array $options = array())
$result = $this->_redis->connect($server['host'], $server['port']);
}

if ($this->_redis && $server['auth']) {
if ($this->_redis && array_key_exists('auth', $server) && $server['auth']) {
$this->_redis->auth($server['password']);
}

Expand Down
5 changes: 2 additions & 3 deletions LICENSE
@@ -1,7 +1,7 @@
Copyright (c) 2011-2013, Carl Oscar Aaro
Copyright (c) 2011-2017, Carl Oscar Aaro
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
Expand All @@ -25,4 +25,3 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 comments on commit f26a5e8

Please sign in to comment.