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
f3be544b
Commit
f3be544b
authored
Feb 04, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cache base url.
parent
d7fcd74a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
asset.php
laravel/asset.php
+0
-1
url.php
laravel/url.php
+20
-3
No files found.
laravel/asset.php
View file @
f3be544b
...
@@ -78,7 +78,6 @@ class Asset_Container {
...
@@ -78,7 +78,6 @@ class Asset_Container {
* Create a new asset container instance.
* Create a new asset container instance.
*
*
* @param string $name
* @param string $name
* @param HTML $html
* @return void
* @return void
*/
*/
public
function
__construct
(
$name
)
public
function
__construct
(
$name
)
...
...
laravel/url.php
View file @
f3be544b
...
@@ -2,6 +2,13 @@
...
@@ -2,6 +2,13 @@
class
URL
{
class
URL
{
/**
* The cached base URL.
*
* @var string
*/
public
static
$base
;
/**
/**
* Get the base URL of the application.
* Get the base URL of the application.
*
*
...
@@ -9,7 +16,17 @@ class URL {
...
@@ -9,7 +16,17 @@ class URL {
*/
*/
public
static
function
base
()
public
static
function
base
()
{
{
if
((
$base
=
Config
::
get
(
'application.url'
))
!==
''
)
return
$base
;
if
(
isset
(
static
::
$base
))
return
static
::
$base
;
$base
=
'http://localhost'
;
// If the application URL configuration is set, we will just use
// that instead of trying to guess the URL based on the $_SERVER
// array's host and script name.
if
((
$url
=
Config
::
get
(
'application.url'
))
!==
''
)
{
$base
=
$url
;
}
if
(
isset
(
$_SERVER
[
'HTTP_HOST'
]))
if
(
isset
(
$_SERVER
[
'HTTP_HOST'
]))
{
{
...
@@ -21,10 +38,10 @@ class URL {
...
@@ -21,10 +38,10 @@ class URL {
// construct the base URL to the application.
// construct the base URL to the application.
$path
=
str_replace
(
basename
(
$_SERVER
[
'SCRIPT_NAME'
]),
''
,
$_SERVER
[
'SCRIPT_NAME'
]);
$path
=
str_replace
(
basename
(
$_SERVER
[
'SCRIPT_NAME'
]),
''
,
$_SERVER
[
'SCRIPT_NAME'
]);
return
rtrim
(
$protocol
.
$_SERVER
[
'HTTP_HOST'
]
.
$path
,
'/'
);
$base
=
rtrim
(
$protocol
.
$_SERVER
[
'HTTP_HOST'
]
.
$path
,
'/'
);
}
}
return
'http://localhost'
;
return
static
::
$base
=
$base
;
}
}
/**
/**
...
...
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