Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
hf
9 years ago
Commit
4f4b4321b3fd7c6bcb2cedcad63154650f9afc78
1 parent
5036538e
to control develop env do not use session
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
library/Action/AbstractAction.php
library/Action/AbstractAction.php
View file @
4f4b432
...
...
@@ -34,6 +34,7 @@ class AbstractAction extends Controller_Abstract
protected
$_uid
=
0
;
protected
$_uname
=
''
;
protected
$_vip
;
protected
$_useSession
=
true
;
/**
* 存放模板数据
...
...
@@ -53,16 +54,20 @@ class AbstractAction extends Controller_Abstract
switch
(
APPLICATION_ENV
)
{
case
'production'
:
// 生产
$this
->
_view
->
assign
(
'rlsEnv'
,
true
);
$this
->
_useSession
=
true
;
break
;
case
'preview'
:
// 预览
$this
->
_view
->
assign
(
'preEnv'
,
true
);
$this
->
_useSession
=
true
;
break
;
case
'testing'
:
// 测试
$this
->
_view
->
assign
(
'testEnv'
,
true
);
$this
->
_useSession
=
true
;
break
;
case
'develop'
:
// 开发
default
:
$this
->
_view
->
assign
(
'devEnv'
,
true
);
$this
->
_useSession
=
false
;
break
;
}
}
...
...
@@ -261,7 +266,9 @@ class AbstractAction extends Controller_Abstract
*/
public
function
setSession
(
$name
,
$value
)
{
Session
::
start
(
'yohobuy_session'
,
null
,
'yohobuy.com'
)
->
__set
(
$name
,
$value
);
if
(
$this
->
_useSession
)
{
Session
::
start
(
'yohobuy_session'
,
null
,
'yohobuy.com'
)
->
__set
(
$name
,
$value
);
}
}
/**
...
...
@@ -272,7 +279,11 @@ class AbstractAction extends Controller_Abstract
*/
public
function
getSession
(
$name
)
{
return
Session
::
start
(
'yohobuy_session'
,
null
,
'yohobuy.com'
)
->
__get
(
$name
);
if
(
$this
->
_useSession
)
{
return
Session
::
start
(
'yohobuy_session'
,
null
,
'yohobuy.com'
)
->
__get
(
$name
);
}
else
{
return
''
;
}
}
/**
...
...
@@ -283,9 +294,11 @@ class AbstractAction extends Controller_Abstract
*/
protected
function
getUid
(
$useSession
=
false
)
{
// @todo
// $useSession = false;
// 控制是否启用SESSION
if
(
!
$this
->
_useSession
)
{
$useSession
=
false
;
}
if
(
!
$this
->
_uid
)
{
$cookie
=
$this
->
getCookie
(
'_UID'
);
if
(
!
empty
(
$cookie
))
{
...
...
Please
register
or
login
to post a comment