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
4c2406db
Commit
4c2406db
authored
Apr 03, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing base url generation.
parent
2276c670
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
26 deletions
+4
-26
url.php
laravel/url.php
+4
-26
No files found.
laravel/url.php
View file @
4c2406db
...
@@ -68,38 +68,16 @@ class URL {
...
@@ -68,38 +68,16 @@ class URL {
{
{
$base
=
$url
;
$base
=
$url
;
}
}
else
if
(
isset
(
$_SERVER
[
'HTTP_HOST'
]))
else
{
{
$base
=
static
::
guess
();
$f
=
Request
::
foundation
();
$base
=
$f
->
getScheme
()
.
'://'
.
$f
->
getHttpHost
()
.
$f
->
getBaseUrl
();
}
}
return
static
::
$base
=
$base
;
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 URI. Leaving us with
// the installation path for the application.
$script
=
$_SERVER
[
'SCRIPT_NAME'
];
$path
=
str_replace
(
basename
(
$script
),
''
,
$script
);
// 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
rtrim
(
$uri
,
'/'
);
}
/**
/**
* Generate an application URL.
* Generate an application URL.
*
*
...
...
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