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
ec84d3f9
Commit
ec84d3f9
authored
Feb 20, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added ability to specify autoloader configuration for bundles in bundles.php
parent
a8851142
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
bundle.php
laravel/bundle.php
+31
-0
No files found.
laravel/bundle.php
View file @
ec84d3f9
...
...
@@ -63,6 +63,8 @@ class Bundle {
}
static
::
$bundles
[
$bundle
]
=
array_merge
(
$defaults
,
$config
);
static
::
autoloading
(
$bundle
,
$config
);
}
/**
...
...
@@ -125,6 +127,35 @@ class Bundle {
}
}
/**
* Register the auto-loading configuration for a bundle.
*
* @param string $bundle
* @param array $config
* @return void
*/
protected
static
function
autoloading
(
$bundle
,
$config
)
{
$path
=
trim
(
Bundle
::
path
(
$bundle
),
DS
);
foreach
((
array
)
$config
[
'autoloads'
]
as
$type
=>
$mappings
)
{
// When registering each type of mapping we'll replace the (:bundle)
// place-holder with the path to the bundle's root directory, so
// the developer may dryly register the mappings.
$mappings
=
array_map
(
function
(
$mapping
)
use
(
$path
)
{
return
str_replace
(
'(:bundle)'
,
$path
,
$mapping
);
},
$mappings
);
// Once the mappings are formatted, we will call the Autoloader
// function matching the mapping type and pass in the array of
// mappings so they can be registered and used.
Autoloader
::
$type
(
$mappings
);
}
}
/**
* Disable a bundle for the current request.
*
...
...
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