Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merged branch drak/nativestorage (PR #4899)
Commits ------- a351362 [HttpFoundation] Add NativeSessionHandler tests 653821a [HttpFoundation] Remove FileSessionHandler 3456787 Partially revert "[HttpFoundation][Sessions] Refactored tests" 39813a0 Revert "[FrameworkBundle] Refactor session file handler service name and update changelogs" fbee4cf Restore NativeFileSessionHandler Discussion ---------- [Session] Restore NativeFileSessionStorage Bug fix: no Feature addition: yes Backwards compatibility break: no Symfony2 tests pass: yes Fixes the following tickets: #4668 Todo: - License of the code: MIT This reverts the removal of the native file handler.
- Loading branch information
Showing
12 changed files
with
200 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 0 additions & 116 deletions
116
src/Symfony/Component/HttpFoundation/Session/Storage/Handler/FileSessionHandler.php
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; | ||
|
||
/** | ||
* NativeFileSessionHandler. | ||
* | ||
* Native session handler using PHP's built in file storage. | ||
* | ||
* @author Drak <drak@zikula.org> | ||
*/ | ||
class NativeFileSessionHandler extends NativeSessionHandler | ||
{ | ||
/** | ||
* Constructor. | ||
* | ||
* @param string $savePath Path of directory to save session files. Default null will leave setting as defined by PHP. | ||
*/ | ||
public function __construct($savePath = null) | ||
{ | ||
if (null === $savePath) { | ||
$savePath = ini_get('session.save_path'); | ||
} | ||
|
||
if ($savePath && !is_dir($savePath)) { | ||
mkdir($savePath, 0777, true); | ||
} | ||
|
||
ini_set('session.save_handler', 'files'); | ||
ini_set('session.save_path', $savePath); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; | ||
|
||
/** | ||
* Adds SessionHandler functionality if available. | ||
* | ||
* @see http://php.net/sessionhandler | ||
*/ | ||
|
||
if (version_compare(phpversion(), '5.4.0', '>=')) { | ||
class NativeSessionHandler extends \SessionHandler {} | ||
} else { | ||
class NativeSessionHandler {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.