Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/ZF2-242' of https://github.com/mwillbanks/zf2 in…
Browse files Browse the repository at this point in the history
…to hotfix/zf2-242
  • Loading branch information
weierophinney committed Mar 29, 2012
2 parents a23af8b + 2cee9d4 commit 099e77b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
10 changes: 5 additions & 5 deletions library/Zend/Session/Configuration.php
Expand Up @@ -39,7 +39,7 @@ public function hasOption($option);
public function getOption($option);
public function toArray();

public function setSavePath($path);
public function setSavePath($savePath);
public function getSavePath();

public function setName($name);
Expand All @@ -53,10 +53,10 @@ public function setCookieDomain($cookieDomain);
public function getCookieDomain();
public function setCookieSecure($cookieSecure);
public function getCookieSecure();
public function setCookieHttponly($cookieHTTPOnly);
public function getCookieHTTPOnly();
public function setUseCookies($flag);
public function setCookieHttpOnly($cookieHTTPOnly);
public function getCookieHttpOnly();
public function setUseCookies($useCookies);
public function getUseCookies();
public function setRememberMeSeconds($seconds);
public function setRememberMeSeconds($rememberMeSeconds);
public function getRememberMeSeconds();
}
20 changes: 10 additions & 10 deletions library/Zend/Session/Configuration/SessionConfiguration.php
Expand Up @@ -89,41 +89,41 @@ class SessionConfiguration extends StandardConfiguration
* Does nothing in this implementation; others might use it to set things
* such as INI settings.
*
* @param string $name
* @param mixed $value
* @param string $storageName
* @param mixed $storageValue
* @return Zend\Session\Configuration\StandardConfiguration
*/
public function setStorageOption($name, $value)
public function setStorageOption($storageName, $storageValue)
{
$key = false;
switch ($name) {
switch ($storageName) {
case 'remember_me_seconds':
// do nothing; not an INI option
return;
case 'url_rewriter_tags':
$key = 'url_rewriter.tags';
break;
default:
$key = 'session.' . $name;
$key = 'session.' . $storageName;
break;
}

ini_set($key, $value);
ini_set($key, $storageValue);
}

/**
* Retrieve a storage option from a backend configuration store
*
* Used to retrieve default values from a backend configuration store.
*
* @param string $name
* @param string $storageOption
* @return mixed
*/
public function getStorageOption($name)
public function getStorageOption($storageOption)
{
$key = false;
$transform = false;
switch ($name) {
switch ($storageOption) {
case 'remember_me_seconds':
// No remote storage option; just return the current value
return $this->rememberMeSeconds;
Expand All @@ -139,7 +139,7 @@ public function getStorageOption($name)
return (bool) $value;
};
default:
$key = 'session.' . $name;
$key = 'session.' . $storageOption;
break;
}

Expand Down
36 changes: 18 additions & 18 deletions library/Zend/Session/Configuration/StandardConfiguration.php
Expand Up @@ -100,11 +100,11 @@ class StandardConfiguration implements Configurable
* Does nothing in this implementation; others might use it to set things
* such as INI settings.
*
* @param string $name
* @param mixed $value
* @param string $storageName
* @param mixed $storageValue
* @return Zend\Session\Configuration\StandardConfiguration
*/
public function setStorageOption($name, $value)
public function setStorageOption($storageName, $storageValue)
{
}

Expand All @@ -113,28 +113,28 @@ public function setStorageOption($name, $value)
*
* Used to retrieve default values from a backend configuration store.
*
* @param string $name
* @param string $storageOption
* @return mixed
*/
public function getStorageOption($name)
public function getStorageOption($storageOption)
{
return null;
}

/**
* Set session.save_path
*
* @param string $path
* @param string $savePath
* @return StandardConfiguration
* @throws SessionException on invalid path
*/
public function setSavePath($path)
public function setSavePath($savePath)
{
if (!is_dir($path)) {
if (!is_dir($savePath)) {
throw new Exception\InvalidArgumentException('Invalid save_path provided');
}
$this->savePath = $path;
$this->setStorageOption('save_path', $path);
$this->savePath = $savePath;
$this->setStorageOption('save_path', $savePath);
return $this;
}

Expand Down Expand Up @@ -409,12 +409,12 @@ public function getCookieHTTPOnly()
/**
* Set session.use_cookies
*
* @param bool $flag
* @param bool $useCookies
* @return StandardConfiguration
*/
public function setUseCookies($flag)
public function setUseCookies($useCookies)
{
$this->useCookies = (bool) $flag;
$this->useCookies = (bool) $useCookies;
$this->setStorageOption('use_cookies', $this->useCookies);
return $this;
}
Expand All @@ -435,17 +435,17 @@ public function getUseCookies()
/**
* Set session.entropy_file
*
* @param string $path
* @param string $entropyFile
* @return StandardConfiguration
* @throws SessionException
*/
public function setEntropyFile($path)
public function setEntropyFile($entropyFile)
{
if (!file_exists($path) || is_dir($path) || !is_readable($path)) {
if (is_dir($entropyFile) || !is_readable($entropyFile)) {
throw new Exception\InvalidArgumentException('Invalid entropy_file provided');
}
$this->setOption('entropy_file', $path);
$this->setStorageOption('entropy_file', $path);
$this->setOption('entropy_file', $entropyFile);
$this->setStorageOption('entropy_file', $entropyFile);
return $this;
}

Expand Down

0 comments on commit 099e77b

Please sign in to comment.