Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
6becbaba
Commit
6becbaba
authored
Sep 15, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more session refactoring.
parent
ae5393f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
18 deletions
+18
-18
database.php
application/config/database.php
+2
-2
driver.php
laravel/session/drivers/driver.php
+13
-13
manager.php
laravel/session/manager.php
+3
-3
No files found.
application/config/database.php
View file @
6becbaba
...
...
@@ -47,12 +47,12 @@ return array(
'mysql'
=>
function
(
$config
)
{
return
new
PDO
(
'mysql:host=localhost;dbname=database'
,
'
username
'
,
'password'
,
$config
[
'options'
]);
return
new
PDO
(
'mysql:host=localhost;dbname=database'
,
'
root
'
,
'password'
,
$config
[
'options'
]);
},
'pgsql'
=>
function
(
$config
)
{
return
new
PDO
(
'pgsql:host=localhost;dbname=database'
,
'
username
'
,
'password'
,
$config
[
'options'
]);
return
new
PDO
(
'pgsql:host=localhost;dbname=database'
,
'
root
'
,
'password'
,
$config
[
'options'
]);
},
),
...
...
laravel/session/drivers/driver.php
View file @
6becbaba
...
...
@@ -210,6 +210,19 @@ abstract class Driver {
$this
->
session
[
'id'
]
=
Str
::
random
(
40
);
}
/**
* Readdress the session data by performing a string replacement on the keys.
*
* @param string $search
* @param string $replace
* @param array $keys
* @return void
*/
private
function
readdress
(
$search
,
$replace
,
$keys
)
{
$this
->
session
[
'data'
]
=
array_combine
(
str_replace
(
$search
,
$replace
,
$keys
),
array_values
(
$this
->
session
[
'data'
]));
}
/**
* Close the session and store the session payload in persistant storage.
*
...
...
@@ -256,19 +269,6 @@ abstract class Driver {
$this
->
readdress
(
':new:'
,
':old:'
,
array_keys
(
$this
->
session
[
'data'
]));
}
/**
* Readdress the session data by performing a string replacement on the keys.
*
* @param string $search
* @param string $replace
* @param array $keys
* @return void
*/
private
function
readdress
(
$search
,
$replace
,
$keys
)
{
$this
->
session
[
'data'
]
=
array_combine
(
str_replace
(
$search
,
$replace
,
$keys
),
array_values
(
$this
->
session
[
'data'
]));
}
/**
* Write the session cookie.
*
...
...
laravel/session/manager.php
View file @
6becbaba
...
...
@@ -34,12 +34,12 @@ class Manager {
*/
public
function
driver
(
$driver
)
{
if
(
!
$this
->
container
->
registered
(
'laravel.session.'
.
$driver
))
if
(
$this
->
container
->
registered
(
'laravel.session.'
.
$driver
))
{
throw
new
\Exception
(
"Session driver [
$driver
] is not supported."
);
return
$this
->
container
->
resolve
(
'laravel.session.'
.
$driver
);
}
return
$this
->
container
->
resolve
(
'laravel.session.'
.
$driver
);
throw
new
\Exception
(
"Session driver [
$driver
] is not supported."
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment