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
79f92e57
Commit
79f92e57
authored
Aug 10, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
defer language support in URIs to version 4.
parent
f5123f93
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
61 deletions
+2
-61
application.php
application/config/application.php
+0
-13
laravel.php
laravel/laravel.php
+2
-40
url.php
laravel/url.php
+0
-8
No files found.
application/config/application.php
View file @
79f92e57
...
...
@@ -94,19 +94,6 @@ return array(
'language'
=>
'en'
,
/*
|--------------------------------------------------------------------------
| Supported Languages
|--------------------------------------------------------------------------
|
| These languages may also be supported by your application. If a request
| enters your application with a URI beginning with one of these values
| the default language will automatically be set to that language.
|
*/
'languages'
=>
array
(),
/*
|--------------------------------------------------------------------------
| SSL Link Generation
...
...
laravel/laravel.php
View file @
79f92e57
...
...
@@ -107,46 +107,6 @@ Routing\Router::register('*', '(:all)', function()
return
Event
::
first
(
'404'
);
});
/*
|--------------------------------------------------------------------------
| Gather The URI And Locales
|--------------------------------------------------------------------------
|
| When routing, we'll need to grab the URI and the supported locales for
| the route so we can properly set the language and route the request
| to the proper end-point in the application.
|
*/
$uri
=
URI
::
current
();
$locales
=
Config
::
get
(
'application.languages'
,
array
());
$locales
[]
=
Config
::
get
(
'application.language'
);
/*
|--------------------------------------------------------------------------
| Set The Locale Based On Route
|--------------------------------------------------------------------------
|
| If the URI starts with one of the supported languages, we will set
| the default language to match that URI segment and shorten the
| URI we'll pass to the router to not include the lang segment.
|
*/
foreach
(
$locales
as
$locale
)
{
if
(
starts_with
(
$uri
,
$locale
))
{
Config
::
set
(
'application.language'
,
$locale
);
$uri
=
trim
(
substr
(
$uri
,
strlen
(
$locale
)),
'/'
);
break
;
}
}
if
(
$uri
===
''
)
$uri
=
'/'
;
/*
|--------------------------------------------------------------------------
| Route The Incoming Request
...
...
@@ -158,6 +118,8 @@ if ($uri === '') $uri = '/';
|
*/
$uri
=
URI
::
current
();
Request
::
$route
=
Routing\Router
::
route
(
Request
::
method
(),
$uri
);
$response
=
Request
::
$route
->
call
();
...
...
laravel/url.php
View file @
79f92e57
...
...
@@ -107,14 +107,6 @@ class URL {
$root
=
static
::
base
()
.
'/'
.
Config
::
get
(
'application.index'
);
// If multiple languages are being supported via URIs, we will append current
// language to the URI so all redirects and URLs generated include the
// current language so it is not lost on further requests.
if
(
count
(
Config
::
get
(
'application.languages'
))
>
0
)
{
$root
.=
'/'
.
Config
::
get
(
'application.language'
);
}
// Since SSL is not often used while developing the application, we allow the
// developer to disable SSL on all framework generated links to make it more
// convenient to work with the site while developing locally.
...
...
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