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
442904b2
Commit
442904b2
authored
Sep 29, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring.
parent
5cc7c3a6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
20 deletions
+20
-20
redirect.php
laravel/redirect.php
+1
-1
request.php
laravel/request.php
+6
-6
response.php
laravel/response.php
+5
-3
str.php
laravel/str.php
+6
-8
url.php
laravel/url.php
+2
-2
No files found.
laravel/redirect.php
View file @
442904b2
...
@@ -61,7 +61,7 @@ class Redirect extends Response {
...
@@ -61,7 +61,7 @@ class Redirect extends Response {
throw
new
\Exception
(
'A session driver must be set before setting flash data.'
);
throw
new
\Exception
(
'A session driver must be set before setting flash data.'
);
}
}
IoC
::
container
()
->
resolve
(
'laravel.
session'
)
->
flash
(
$key
,
$value
);
IoC
::
container
()
->
core
(
'
session'
)
->
flash
(
$key
,
$value
);
return
$this
;
return
$this
;
}
}
...
...
laravel/request.php
View file @
442904b2
...
@@ -119,17 +119,17 @@ class Request {
...
@@ -119,17 +119,17 @@ class Request {
*/
*/
public
function
ip
(
$default
=
'0.0.0.0'
)
public
function
ip
(
$default
=
'0.0.0.0'
)
{
{
if
(
isset
(
$
_SERVER
[
'HTTP_X_FORWARDED_FOR'
]))
if
(
isset
(
$
this
->
server
[
'HTTP_X_FORWARDED_FOR'
]))
{
{
return
$
_SERVER
[
'HTTP_X_FORWARDED_FOR'
];
return
$
this
->
server
[
'HTTP_X_FORWARDED_FOR'
];
}
}
elseif
(
isset
(
$
_SERVER
[
'HTTP_CLIENT_IP'
]))
elseif
(
isset
(
$
this
->
server
[
'HTTP_CLIENT_IP'
]))
{
{
return
$
_SERVER
[
'HTTP_CLIENT_IP'
];
return
$
this
->
server
[
'HTTP_CLIENT_IP'
];
}
}
elseif
(
isset
(
$
_SERVER
[
'REMOTE_ADDR'
]))
elseif
(
isset
(
$
this
->
server
[
'REMOTE_ADDR'
]))
{
{
return
$
_SERVER
[
'REMOTE_ADDR'
];
return
$
this
->
server
[
'REMOTE_ADDR'
];
}
}
return
(
$default
instanceof
\Closure
)
?
call_user_func
(
$default
)
:
$default
;
return
(
$default
instanceof
\Closure
)
?
call_user_func
(
$default
)
:
$default
;
...
...
laravel/response.php
View file @
442904b2
...
@@ -133,7 +133,7 @@ class Response {
...
@@ -133,7 +133,7 @@ class Response {
*/
*/
public
static
function
view
(
$view
,
$data
=
array
())
public
static
function
view
(
$view
,
$data
=
array
())
{
{
return
new
static
(
IoC
::
container
()
->
resolve
(
'laravel.
view'
)
->
make
(
$view
,
$data
));
return
new
static
(
IoC
::
container
()
->
core
(
'
view'
)
->
make
(
$view
,
$data
));
}
}
/**
/**
...
@@ -153,7 +153,7 @@ class Response {
...
@@ -153,7 +153,7 @@ class Response {
*/
*/
public
static
function
with
(
$name
,
$data
=
array
())
public
static
function
with
(
$name
,
$data
=
array
())
{
{
return
new
static
(
IoC
::
container
()
->
resolve
(
'laravel.
view'
)
->
of
(
$name
,
$data
));
return
new
static
(
IoC
::
container
()
->
core
(
'
view'
)
->
of
(
$name
,
$data
));
}
}
/**
/**
...
@@ -177,7 +177,7 @@ class Response {
...
@@ -177,7 +177,7 @@ class Response {
*/
*/
public
static
function
error
(
$code
,
$data
=
array
())
public
static
function
error
(
$code
,
$data
=
array
())
{
{
return
new
static
(
IoC
::
container
()
->
resolve
(
'laravel.
view'
)
->
make
(
'error/'
.
$code
,
$data
),
$code
);
return
new
static
(
IoC
::
container
()
->
core
(
'
view'
)
->
make
(
'error/'
.
$code
,
$data
),
$code
);
}
}
/**
/**
...
@@ -274,6 +274,7 @@ class Response {
...
@@ -274,6 +274,7 @@ class Response {
public
function
header
(
$name
,
$value
)
public
function
header
(
$name
,
$value
)
{
{
$this
->
headers
[
$name
]
=
$value
;
$this
->
headers
[
$name
]
=
$value
;
return
$this
;
return
$this
;
}
}
...
@@ -286,6 +287,7 @@ class Response {
...
@@ -286,6 +287,7 @@ class Response {
public
function
status
(
$status
)
public
function
status
(
$status
)
{
{
$this
->
status
=
$status
;
$this
->
status
=
$status
;
return
$this
;
return
$this
;
}
}
...
...
laravel/str.php
View file @
442904b2
...
@@ -28,7 +28,7 @@ class Str {
...
@@ -28,7 +28,7 @@ class Str {
{
{
if
(
function_exists
(
'mb_strtoupper'
))
if
(
function_exists
(
'mb_strtoupper'
))
{
{
return
mb_strtoupper
(
$value
,
static
::
encoding
(
));
return
mb_strtoupper
(
$value
,
Config
::
get
(
'application.encoding'
));
}
}
return
strtoupper
(
$value
);
return
strtoupper
(
$value
);
...
@@ -84,19 +84,17 @@ class Str {
...
@@ -84,19 +84,17 @@ class Str {
/**
/**
* Generate a random alpha or alpha-numeric string.
* Generate a random alpha or alpha-numeric string.
*
*
* Supported types: 'al
pha_
num' and 'alpha'.
* Supported types: 'alnum' and 'alpha'.
*
*
* @param int $length
* @param int
$length
* @param string $type
* @param string $type
* @return string
* @return string
*/
*/
public
static
function
random
(
$length
=
16
,
$type
=
'alpha_
num'
)
public
static
function
random
(
$length
,
$type
=
'al
num'
)
{
{
$
alpha
=
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
;
$
pool
=
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
;
$pool
=
(
$type
==
'alpha_num'
)
?
'0123456789'
.
$alpha
:
$alpha
;
return
substr
(
str_shuffle
(
str_repeat
((
$type
==
'alnum'
)
?
$pool
.
'0123456789'
:
$pool
,
5
)),
0
,
$length
);
return
implode
(
''
,
array_map
(
function
()
use
(
$pool
)
{
return
$pool
[
mt_rand
(
0
,
strlen
(
$pool
)
-
1
)];
},
range
(
0
,
$length
-
1
)));
}
}
}
}
\ No newline at end of file
laravel/url.php
View file @
442904b2
...
@@ -50,7 +50,7 @@ class URL {
...
@@ -50,7 +50,7 @@ class URL {
*/
*/
public
static
function
to_asset
(
$url
,
$https
=
null
)
public
static
function
to_asset
(
$url
,
$https
=
null
)
{
{
if
(
is_null
(
$https
))
$https
=
IoC
::
container
()
->
resolve
(
'laravel.
request'
)
->
secure
();
if
(
is_null
(
$https
))
$https
=
IoC
::
container
()
->
core
(
'
request'
)
->
secure
();
return
str_replace
(
'index.php/'
,
''
,
static
::
to
(
$url
,
$https
));
return
str_replace
(
'index.php/'
,
''
,
static
::
to
(
$url
,
$https
));
}
}
...
@@ -77,7 +77,7 @@ class URL {
...
@@ -77,7 +77,7 @@ class URL {
*/
*/
public
static
function
to_route
(
$name
,
$parameters
=
array
(),
$https
=
false
)
public
static
function
to_route
(
$name
,
$parameters
=
array
(),
$https
=
false
)
{
{
if
(
!
is_null
(
$route
=
IoC
::
container
()
->
resolve
(
'laravel.
routing.router'
)
->
find
(
$name
)))
if
(
!
is_null
(
$route
=
IoC
::
container
()
->
core
(
'
routing.router'
)
->
find
(
$name
)))
{
{
$uris
=
explode
(
', '
,
key
(
$route
));
$uris
=
explode
(
', '
,
key
(
$route
));
...
...
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