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
efe3de68
Commit
efe3de68
authored
Apr 30, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow the specification of a asset base URL.
parent
48dae0c3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
11 deletions
+9
-11
application.php
application/config/application.php
+3
-4
changes.md
laravel/documentation/changes.md
+1
-0
url.php
laravel/url.php
+5
-7
No files found.
application/config/application.php
View file @
efe3de68
...
...
@@ -20,10 +20,9 @@ return array(
| Asset URL
|--------------------------------------------------------------------------
|
| The base URL used for your application's asset files, if you are serving
| them through a different server or a content delivery network, for
| example. If it's not set, we'll default to the application URL (above).
| Leave off the trailing slash.
| The base URL used for your application's asset files. This is useful if
| you are serving your assets through a different server or a CDN. If it
| is not set, we'll default to the application URL above.
|
*/
...
...
laravel/documentation/changes.md
View file @
efe3de68
...
...
@@ -63,6 +63,7 @@
-
Added support for
`HAVING`
SQL clauses.
-
Added
`array_pluck`
helper, similar to pluck method in Underscore.js.
-
Allow the registration of custom cache and session drivers.
-
Allow the specification of a separate asset base URL for using CDNs.
<a
name=
"upgrade-3.2"
></a>
## Upgrading From 3.1
...
...
laravel/url.php
View file @
efe3de68
...
...
@@ -220,16 +220,14 @@ class URL {
*/
public
static
function
to_asset
(
$url
,
$https
=
null
)
{
// If the URL is already well-formed, just return it
if
(
static
::
valid
(
$url
))
return
$url
;
// If a base asset URL is defined in the configuration, use that and
// don't try and change links to http/https.
if
(
$root
=
Config
::
get
(
'application.asset_url'
,
false
))
{
// If a base asset URL is defined in the configuration, use that and don't
// try and change the HTTP protocol. This allows the delivery of assets
// through a different server or third-party content delivery network.
if
(
$root
=
Config
::
get
(
'application.asset_url'
,
false
))
{
return
rtrim
(
$root
,
'/'
)
.
'/'
.
ltrim
(
$url
,
'/'
);
}
if
(
is_null
(
$https
))
$https
=
Request
::
secure
();
...
...
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