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
a0853733
Commit
a0853733
authored
Feb 26, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify autoloader namespace mapping.
Signed-off-by:
Taylor Otwell
<
taylorotwell@gmail.com
>
parent
90941391
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
21 deletions
+6
-21
autoloader.php
laravel/autoloader.php
+5
-20
paginator.php
laravel/paginator.php
+1
-1
No files found.
laravel/autoloader.php
View file @
a0853733
...
...
@@ -56,14 +56,16 @@ class Autoloader {
require
static
::
$mappings
[
$class
];
}
$namespace
=
root_namespace
(
$class
)
.
'\\'
;
// If the class namespace is mapped to a directory, we will load the
// class using the PSR-0 standards from that directory accounting
// for the root of the namespace by trimming it.
if
(
!
is_null
(
$info
=
static
::
namespaced
(
$class
)
))
if
(
isset
(
static
::
$namespaces
[
$namespace
]
))
{
$class
=
substr
(
$class
,
strlen
(
$
info
[
'namespace'
]
));
$class
=
substr
(
$class
,
strlen
(
$
namespace
));
return
static
::
load_psr
(
$class
,
$info
[
'directory'
]);
return
static
::
load_psr
(
$class
,
static
::
$namespaces
[
$namespace
]);
}
static
::
load_psr
(
$class
);
...
...
@@ -103,23 +105,6 @@ class Autoloader {
}
}
/**
* Get the directory for a given namespaced class.
*
* @param string $class
* @return string
*/
protected
static
function
namespaced
(
$class
)
{
foreach
(
static
::
$namespaces
as
$namespace
=>
$directory
)
{
if
(
starts_with
(
$class
,
$namespace
))
{
return
compact
(
'namespace'
,
'directory'
);
}
}
}
/**
* Register an array of class to path mappings.
*
...
...
laravel/paginator.php
View file @
a0853733
...
...
@@ -216,7 +216,7 @@ class Paginator {
//
// Likewise, if the page is very close to the end, we will create the
// beginning of the slider, but just show the last several pages at
// the end of the slider.
// the end of the slider.
Otherwise, we'll build the range.
//
// Example: 1 [2] 3 4 5 6 ... 23 24
if
(
$this
->
page
<=
$window
)
...
...
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