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
8356151f
Commit
8356151f
authored
Jul 26, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added support for environment configuration files.
parent
2c774adb
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
4 deletions
+15
-4
.gitignore
application/config/.gitignore
+2
-0
.gitignore
application/storage/db/.gitignore
+1
-0
index.php
public/index.php
+2
-1
config.php
system/config.php
+10
-3
No files found.
application/config/.gitignore
0 → 100644
View file @
8356151f
local/*
staging/*
\ No newline at end of file
application/storage/db/.gitignore
View file @
8356151f
*.sqlite
\ No newline at end of file
public/index.php
View file @
8356151f
...
...
@@ -15,8 +15,9 @@
define
(
'BASE_PATH'
,
realpath
(
'../'
)
.
'/'
);
define
(
'APP_PATH'
,
realpath
(
'../application'
)
.
'/'
);
define
(
'SYS_PATH'
,
realpath
(
'../system'
)
.
'/'
);
define
(
'
PUBLIC_PATH'
,
realpath
(
__DIR__
.
'/'
)
);
define
(
'
CONFIG_PATH'
,
APP_PATH
.
'config/'
);
define
(
'PACKAGE_PATH'
,
APP_PATH
.
'packages/'
);
define
(
'PUBLIC_PATH'
,
realpath
(
__DIR__
.
'/'
));
// --------------------------------------------------------------
// Define the PHP file extension.
...
...
system/config.php
View file @
8356151f
...
...
@@ -95,17 +95,24 @@ class Config {
/**
* Load all of the configuration items from a file.
*
* If it exists, the configuration file in the application/config directory will be loaded first.
* Any environment specific configuration files will be merged with the root file.
*
* @param string $file
* @return void
*/
public
static
function
load
(
$file
)
{
$directory
=
(
isset
(
$_SERVER
[
'LARAVEL_ENV'
]))
?
$_SERVER
[
'LARAVEL_ENV'
]
.
'/'
:
''
;
if
(
array_key_exists
(
$file
,
static
::
$items
))
return
;
$config
=
(
file_exists
(
$path
=
CONFIG_PATH
.
$file
.
EXT
))
?
require
$path
:
array
();
if
(
!
array_key_exists
(
$file
,
static
::
$items
)
and
file_exists
(
$path
=
APP_PATH
.
'config/'
.
$directory
.
$file
.
EXT
))
if
(
isset
(
$_SERVER
[
'LARAVEL_ENV'
])
and
file_exists
(
$path
=
CONFIG_PATH
.
$_SERVER
[
'LARAVEL_ENV'
]
.
'/'
.
$file
.
EXT
))
{
static
::
$items
[
$file
]
=
require
$path
;
$config
=
array_merge
(
$config
,
require
$path
)
;
}
return
static
::
$items
[
$file
]
=
$config
;
}
}
\ No newline at end of file
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