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
160e839e
Commit
160e839e
authored
Feb 23, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaning up classes.
parent
fadadd0f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
13 deletions
+25
-13
cookie.php
laravel/cookie.php
+1
-1
url.php
laravel/url.php
+24
-12
No files found.
laravel/cookie.php
View file @
160e839e
...
...
@@ -33,7 +33,7 @@ class Cookie {
// All cookies are stored in the "jar" when set and not sent directly to the
// browser. This simply makes testing all of the cookie stuff very easy
// since the jar can be inspected by the tests.
// since the jar can be inspected by the
application's
tests.
foreach
(
static
::
$jar
as
$cookie
)
{
static
::
set
(
$cookie
);
...
...
laravel/url.php
View file @
160e839e
...
...
@@ -70,22 +70,34 @@ class URL {
}
elseif
(
isset
(
$_SERVER
[
'HTTP_HOST'
]))
{
$protocol
=
(
Request
::
secure
())
?
'https://'
:
'http://'
;
$base
=
static
::
guess
();
}
return
static
::
$base
=
$base
;
}
/**
* Guess the application URL based on the $_SERVER variables.
*
* @return string
*/
protected
static
function
guess
()
{
$protocol
=
(
Request
::
secure
())
?
'https://'
:
'http://'
;
// Basically, by removing the basename, we are removing everything after the
// and including the front controller from the request
URI. Leaving us with
// the path in which the framework is installed
.
$script
=
$_SERVER
[
'SCRIPT_NAME'
];
// Basically, by removing the basename, we are removing everything after
// the and including the front controller from the
URI. Leaving us with
// the installation path for the application
.
$script
=
$_SERVER
[
'SCRIPT_NAME'
];
$path
=
str_replace
(
basename
(
$script
),
''
,
$script
);
$path
=
str_replace
(
basename
(
$script
),
''
,
$script
);
// Now that we have the base URL, all we need to do is attach the protocol
// and the HTTP_HOST to build the full URL for the application. We also
// trim off trailing slashes to clean the URL.
$base
=
rtrim
(
$protocol
.
$_SERVER
[
'HTTP_HOST'
]
.
$path
,
'/'
);
}
// Now that we have the URL, all we need to do is attach the protocol
// protocol and HTTP_HOST to build the URL for the application, and
// we also trim off trailing slashes for cleanliness.
$uri
=
$protocol
.
$_SERVER
[
'HTTP_HOST'
]
.
$path
;
return
static
::
$base
=
$base
;
return
rtrim
(
$uri
,
'/'
)
;
}
/**
...
...
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