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
68e3b468
Commit
68e3b468
authored
Aug 07, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring config class.
parent
16a1f899
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
7 deletions
+1
-7
config.php
system/config.php
+1
-7
No files found.
system/config.php
View file @
68e3b468
...
...
@@ -64,7 +64,7 @@ class Config {
if
(
is_null
(
$key
)
or
!
static
::
load
(
$module
,
$file
))
{
throw
new
\Exception
(
"
Unable to find configuration file item [
$key
]
."
);
throw
new
\Exception
(
"
Error setting configuration option. Option [
$key
] is not defined
."
);
}
static
::
$items
[
$module
][
$file
][
$key
]
=
$value
;
...
...
@@ -85,8 +85,6 @@ class Config {
// the configuration key, otherwise, we will use "application" as the module.
$module
=
(
strpos
(
$key
,
'::'
)
!==
false
)
?
substr
(
$key
,
0
,
strpos
(
$key
,
':'
))
:
'application'
;
// If the configuration item is stored in a module, we need to strip the module qualifier
// off of the configuration key before continuing.
if
(
$module
!=
'application'
)
{
$key
=
substr
(
$key
,
strpos
(
$key
,
':'
)
+
2
);
...
...
@@ -94,8 +92,6 @@ class Config {
$segments
=
explode
(
'.'
,
$key
);
// If there is more than one segment, we need to splice together and portion of the
// configuration key that comes after the first segment, which is the file name.
$key
=
(
count
(
$segments
)
>
1
)
?
implode
(
'.'
,
array_slice
(
$segments
,
1
))
:
null
;
return
array
(
$module
,
$segments
[
0
],
$key
);
...
...
@@ -113,8 +109,6 @@ class Config {
*/
public
static
function
load
(
$module
,
$file
)
{
// If the configuration items for this module and file have already been
// loaded, we can bail out of this method.
if
(
isset
(
static
::
$items
[
$module
])
and
array_key_exists
(
$file
,
static
::
$items
[
$module
]))
return
true
;
$path
=
(
$module
===
'application'
)
?
CONFIG_PATH
:
MODULE_PATH
.
$module
.
'/config/'
;
...
...
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