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
8bc128fd
Commit
8bc128fd
authored
Apr 11, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaning up code.
parent
9ad6fabc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
24 deletions
+12
-24
asset.php
laravel/asset.php
+1
-1
autoloader.php
laravel/autoloader.php
+11
-23
No files found.
laravel/asset.php
View file @
8bc128fd
<?php
namespace
Laravel
;
defined
(
'DS'
)
or
die
(
'No direct script access.'
);
<?php
namespace
Laravel
;
class
Asset
{
...
...
laravel/autoloader.php
View file @
8bc128fd
<?php
namespace
Laravel
;
defined
(
'DS'
)
or
die
(
'No direct script access.'
);
<?php
namespace
Laravel
;
class
Autoloader
{
...
...
@@ -52,7 +52,7 @@ class Autoloader {
// called again for the "real" class name to load its file.
if
(
isset
(
static
::
$aliases
[
$class
]))
{
class_alias
(
static
::
$aliases
[
$class
],
$class
);
return
class_alias
(
static
::
$aliases
[
$class
],
$class
);
}
// All classes in Laravel are staticly mapped. There is no crazy search
...
...
@@ -76,17 +76,6 @@ class Autoloader {
}
}
// If the class uses PEAR-ish style underscores for indicating its
// directory structure we'll load the class using PSR-0 standards
// standards from that directory, trimming the root.
foreach
(
static
::
$underscored
as
$prefix
=>
$directory
)
{
if
(
starts_with
(
$class
,
$prefix
))
{
return
static
::
load_namespaced
(
$class
,
$prefix
,
$directory
);
}
}
// If all else fails we will just iterator through the mapped
// PSR-0 directories looking for the class. This is the last
// resort and slowest loading option for the class.
...
...
@@ -177,29 +166,28 @@ class Autoloader {
}
/**
*
Register underscored "namespaces" to directory mapping
s.
*
Map namespaces to directorie
s.
*
* @param array $mappings
* @param string $append
* @return void
*/
public
static
function
underscored
(
$mappings
)
public
static
function
namespaces
(
$mappings
,
$append
=
'\\'
)
{
$mappings
=
static
::
format_mappings
(
$mappings
,
'_'
);
$mappings
=
static
::
format_mappings
(
$mappings
,
$append
);
static
::
$
underscored
=
array_merge
(
$mappings
,
static
::
$underscored
);
static
::
$
namespaces
=
array_merge
(
$mappings
,
static
::
$namespaces
);
}
/**
*
Map namespaces to directorie
s.
*
Register underscored "namespaces" to directory mapping
s.
*
* @param array $mappings
* @return void
*/
public
static
function
namespaces
(
$mappings
)
public
static
function
underscored
(
$mappings
)
{
$mappings
=
static
::
format_mappings
(
$mappings
,
'\\'
);
static
::
$namespaces
=
array_merge
(
$mappings
,
static
::
$namespaces
);
static
::
namespaces
(
$mappings
,
'_'
);
}
/**
...
...
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