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
5c275db6
Commit
5c275db6
authored
Jun 17, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweaking has methods.
parent
73d8e2f2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
38 deletions
+23
-38
config.php
system/config.php
+3
-0
cookie.php
system/cookie.php
+2
-2
input.php
system/input.php
+12
-23
session.php
system/session.php
+6
-13
No files found.
system/config.php
View file @
5c275db6
...
...
@@ -24,10 +24,12 @@ class Config {
if
(
strpos
(
$key
,
'.'
)
===
false
)
{
static
::
load
(
$key
);
return
static
::
$items
[
$key
];
}
list
(
$file
,
$key
)
=
static
::
parse
(
$key
);
static
::
load
(
$file
);
if
(
array_key_exists
(
$key
,
static
::
$items
[
$file
]))
...
...
@@ -48,6 +50,7 @@ class Config {
public
static
function
set
(
$key
,
$value
)
{
list
(
$file
,
$key
)
=
static
::
parse
(
$key
);
static
::
load
(
$file
);
static
::
$items
[
$file
][
$key
]
=
$value
;
...
...
system/cookie.php
View file @
5c275db6
...
...
@@ -95,7 +95,7 @@ class Cookie {
*/
public
static
function
has
(
$name
)
{
return
!
is_null
(
static
::
get
(
$
key
));
return
!
is_null
(
static
::
get
(
$
name
));
}
/**
...
...
@@ -107,7 +107,7 @@ class Cookie {
*/
public
static
function
get
(
$name
,
$default
=
null
)
{
return
(
array_key_exists
(
$name
,
$_COOKIE
))
?
$_COOKIE
[
$name
]
:
$default
;
return
Arr
::
get
(
$_COOKIE
,
$name
,
$default
)
;
}
/**
...
...
system/input.php
View file @
5c275db6
...
...
@@ -10,21 +10,14 @@ class Input {
public
static
$input
;
/**
* Determine if the input data contains an item
or set of items that are
not empty.
* Determine if the input data contains an item
that is
not empty.
*
* @param string $key
* @return bool
*/
public
static
function
has
()
public
static
function
has
(
$key
)
{
foreach
(
func_get_args
()
as
$key
)
{
if
(
is_null
(
static
::
get
(
$key
))
or
trim
((
string
)
static
::
get
(
$key
))
==
''
)
{
return
false
;
}
}
return
true
;
return
(
!
is_null
(
static
::
get
(
$key
))
and
trim
((
string
)
static
::
get
(
$key
))
!=
''
);
}
/**
...
...
@@ -45,22 +38,14 @@ class Input {
}
/**
* Determine if the old input data contains an item or set of
* items that are not empty.
* Determine if the old input data contains an item that is not empty.
*
* @param string $key
* @return bool
*/
public
static
function
had
()
public
static
function
had
(
$key
)
{
foreach
(
func_get_args
()
as
$key
)
{
if
(
is_null
(
static
::
old
(
$key
))
or
trim
((
string
)
static
::
old
(
$key
))
==
''
)
{
return
false
;
}
}
return
true
;
return
(
!
is_null
(
static
::
old
(
$key
))
and
trim
((
string
)
static
::
old
(
$key
))
!=
''
);
}
/**
...
...
@@ -72,6 +57,10 @@ class Input {
*/
public
static
function
old
(
$key
=
null
,
$default
=
null
)
{
// ----------------------------------------------------------
// Since old input data is flashed to the session, we need
// to make sure a session driver has been specified.
// ----------------------------------------------------------
if
(
Config
::
get
(
'session.driver'
)
==
''
)
{
throw
new
\Exception
(
"Sessions must be enabled to retrieve old input data."
);
...
...
system/session.php
View file @
5c275db6
...
...
@@ -68,23 +68,16 @@ class Session {
}
/**
* Determine if the session or flash data contains an item
or set of items
.
* Determine if the session or flash data contains an item.
*
* @param string $key
* @return bool
*/
public
static
function
has
()
public
static
function
has
(
$key
)
{
foreach
(
func_get_args
()
as
$key
)
{
if
(
!
array_key_exists
(
$key
,
static
::
$session
[
'data'
])
and
!
array_key_exists
(
':old:'
.
$key
,
static
::
$session
[
'data'
])
and
!
array_key_exists
(
':new:'
.
$key
,
static
::
$session
[
'data'
]))
{
return
false
;
}
}
return
true
;
return
(
array_key_exists
(
$key
,
static
::
$session
[
'data'
])
or
array_key_exists
(
':old:'
.
$key
,
static
::
$session
[
'data'
])
or
array_key_exists
(
':new:'
.
$key
,
static
::
$session
[
'data'
]));
}
/**
...
...
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