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
a7e98e8e
Commit
a7e98e8e
authored
Oct 16, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing bugs and refactoring.
parent
b40e69c4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
56 additions
and
33 deletions
+56
-33
config.php
laravel/config.php
+14
-9
cookie.php
laravel/cookie.php
+3
-3
form.php
laravel/form.php
+14
-4
input.php
laravel/input.php
+1
-12
lang.php
laravel/lang.php
+1
-1
laravel.php
laravel/laravel.php
+2
-2
str.php
laravel/str.php
+21
-2
No files found.
laravel/config.php
View file @
a7e98e8e
...
...
@@ -3,20 +3,20 @@
class
Config
{
/**
* The paths to the configuration files.
* All of the loaded configuration items.
*
* The configuration arrays are keyed by their owning file name.
*
* @var array
*/
public
static
$
paths
=
array
(
SYS_CONFIG_PATH
,
CONFIG_PATH
);
public
static
$
items
=
array
(
);
/**
* All of the loaded configuration items.
*
* The configuration arrays are keyed by their owning file name.
* The paths to the configuration files.
*
* @var array
*/
public
static
$
items
=
array
(
);
public
static
$
paths
=
array
(
SYS_CONFIG_PATH
,
CONFIG_PATH
);
/**
* Determine if a configuration item or file exists.
...
...
@@ -114,9 +114,14 @@ class Config {
{
$segments
=
explode
(
'.'
,
$key
);
$key
=
(
count
(
$segments
)
>
1
)
?
implode
(
'.'
,
array_slice
(
$segments
,
1
))
:
null
;
return
array
(
$segments
[
0
],
$key
);
if
(
count
(
$segments
)
>=
2
)
{
return
array
(
$segments
[
0
],
implode
(
'.'
,
array_slice
(
$segments
,
1
)));
}
else
{
return
array
(
$segments
[
0
],
null
);
}
}
/**
...
...
laravel/cookie.php
View file @
a7e98e8e
...
...
@@ -71,9 +71,9 @@ class Cookie {
*
* If a negative number of minutes is specified, the cookie will be deleted.
*
*
Note:
This method's signature is very similar to the PHP setcookie method.
*
However, you simply need to pass the number of minutes for which you
*
wish the cookie to be valid. No funky time calculation is required.
* This method's signature is very similar to the PHP setcookie method.
* However, you simply need to pass the number of minutes for which you
* wish the cookie to be valid. No funky time calculation is required.
*
* @param string $name
* @param string $value
...
...
laravel/form.php
View file @
a7e98e8e
...
...
@@ -43,7 +43,9 @@ class Form {
*/
public
static
function
open
(
$action
=
null
,
$method
=
'POST'
,
$attributes
=
array
(),
$https
=
false
)
{
list
(
$attributes
[
'action'
],
$attributes
[
'method'
])
=
array
(
static
::
action
(
$action
,
$https
),
static
::
method
(
$method
));
$attributes
[
'action'
]
=
static
::
action
(
$action
,
$https
);
$attributes
[
'method'
]
=
static
::
method
(
$method
);
if
(
!
array_key_exists
(
'accept-charset'
,
$attributes
))
{
...
...
@@ -433,7 +435,9 @@ class Form {
*/
protected
static
function
checkable
(
$type
,
$name
,
$value
,
$checked
,
$attributes
)
{
$attributes
=
array_merge
(
$attributes
,
array
(
'id'
=>
static
::
id
(
$name
,
$attributes
),
'checked'
=>
(
$checked
)
?
'checked'
:
null
));
if
(
$checked
)
$attributes
[
'checked'
]
=
'checked'
;
$attributes
[
'id'
]
=
static
::
id
(
$name
,
$attributes
);
return
static
::
input
(
$type
,
$name
,
$value
,
$attributes
);
}
...
...
@@ -508,9 +512,15 @@ class Form {
*/
protected
static
function
id
(
$name
,
$attributes
)
{
if
(
array_key_exists
(
'id'
,
$attributes
))
return
$attributes
[
'id'
];
if
(
array_key_exists
(
'id'
,
$attributes
))
{
return
$attributes
[
'id'
];
}
if
(
in_array
(
$name
,
static
::
$labels
))
return
$name
;
if
(
in_array
(
$name
,
static
::
$labels
))
{
return
$name
;
}
}
}
\ No newline at end of file
laravel/input.php
View file @
a7e98e8e
...
...
@@ -7,7 +7,7 @@ class Input {
*
* @var array
*/
p
rotected
static
$input
;
p
ublic
static
$input
;
/**
* The key used to store old input in the session.
...
...
@@ -16,17 +16,6 @@ class Input {
*/
const
old_input
=
'laravel_old_input'
;
/**
* Set the input for the current request.
*
* @param array $input
* @return void
*/
public
static
function
set
(
$input
)
{
static
::
$input
=
$input
;
}
/**
* Get all of the input data for the request.
*
...
...
laravel/lang.php
View file @
a7e98e8e
...
...
@@ -72,7 +72,7 @@ class Lang {
*/
public
static
function
line
(
$key
,
$replacements
=
array
(),
$language
=
null
)
{
if
(
is_null
(
$language
))
$language
=
Config
::
get
(
'application.language'
)
;
if
(
is_null
(
$language
))
$language
=
Config
::
$items
[
'application'
][
'language'
]
;
return
new
static
(
$key
,
$replacements
,
$language
);
}
...
...
laravel/laravel.php
View file @
a7e98e8e
...
...
@@ -78,7 +78,7 @@ switch (Request::method())
*/
unset
(
$input
[
Request
::
spoofer
]);
Input
::
set
(
$input
)
;
Input
::
$input
=
$input
;
/**
* Route the request to the proper route in the application. If a
...
...
@@ -88,7 +88,7 @@ Input::set($input);
*/
Routing\Filter
::
register
(
require
APP_PATH
.
'filters'
.
EXT
);
list
(
$
method
,
$uri
)
=
array
(
Request
::
method
(),
Request
::
uri
());
list
(
$
uri
,
$method
)
=
array
(
Request
::
uri
(),
Request
::
method
());
$route
=
IoC
::
container
()
->
core
(
'routing.router'
)
->
route
(
$method
,
$uri
);
...
...
laravel/str.php
View file @
a7e98e8e
...
...
@@ -188,9 +188,28 @@ class Str {
*/
public
static
function
random
(
$length
,
$type
=
'alnum'
)
{
$pool
=
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
;
return
substr
(
str_shuffle
(
str_repeat
(
static
::
pool
(
$type
),
5
)),
0
,
$length
);
}
return
substr
(
str_shuffle
(
str_repeat
((
$type
==
'alnum'
)
?
$pool
.
'0123456789'
:
$pool
,
5
)),
0
,
$length
);
/**
* Get the character pool for a given type of random string.
*
* @param string $type
* @return string
*/
protected
static
function
pool
(
$type
)
{
switch
(
$type
)
{
case
'alpha'
:
return
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
;
case
'alnum'
:
return
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
;
default
:
throw
new
\Exception
(
"Invalid random string type [
$type
]."
);
}
}
}
\ 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