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
f473e441
Commit
f473e441
authored
Mar 01, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaning up the core bootstrap file.
Signed-off-by:
Taylor Otwell
<
taylorotwell@gmail.com
>
parent
fdcebc1b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
37 deletions
+81
-37
core.php
laravel/core.php
+81
-37
No files found.
laravel/core.php
View file @
f473e441
<?php
namespace
Laravel
;
<?php
namespace
Laravel
;
/**
/*
* Define all of the constants that we will need to use the framework.
|--------------------------------------------------------------------------
* These are things like file extensions, as well as all of the paths
| PHP Display Errors Configuration
* used by the framework. All of the paths are built on top of the
|--------------------------------------------------------------------------
* basic application, laravel, and public paths.
|
*/
| Register the constants used by the framework. These are things like file
| extensions and other information that we want to be able to access with
| just a simple constant.
|
*/
define
(
'EXT'
,
'.php'
);
define
(
'EXT'
,
'.php'
);
define
(
'CRLF'
,
"
\r\n
"
);
define
(
'CRLF'
,
"
\r\n
"
);
define
(
'DEFAULT_BUNDLE'
,
'application'
);
define
(
'DEFAULT_BUNDLE'
,
'application'
);
define
(
'MB_STRING'
,
(
int
)
function_exists
(
'mb_get_info'
));
define
(
'MB_STRING'
,
(
int
)
function_exists
(
'mb_get_info'
));
/**
/*
* Require all of the classes that can't be loaded by the auto-loader.
|--------------------------------------------------------------------------
* These are typically classes that the auto-loader relies upon to
| Require Core Classes
* load classes, such as the array and configuration classes.
|--------------------------------------------------------------------------
*/
|
| Here we will just load in the classes that are used for every request
| or are used by the configuration class. It is quicker and simpler to
| just manually load them in instead of using the auto-loader.
|
*/
require
path
(
'sys'
)
.
'ioc'
.
EXT
;
require
path
(
'sys'
)
.
'event'
.
EXT
;
require
path
(
'sys'
)
.
'event'
.
EXT
;
require
path
(
'sys'
)
.
'bundle'
.
EXT
;
require
path
(
'sys'
)
.
'bundle'
.
EXT
;
require
path
(
'sys'
)
.
'config'
.
EXT
;
require
path
(
'sys'
)
.
'config'
.
EXT
;
require
path
(
'sys'
)
.
'helpers'
.
EXT
;
require
path
(
'sys'
)
.
'helpers'
.
EXT
;
require
path
(
'sys'
)
.
'autoloader'
.
EXT
;
require
path
(
'sys'
)
.
'autoloader'
.
EXT
;
/**
/*
* Register the Autoloader's "load" method on the auto-loader stack.
|--------------------------------------------------------------------------
* This method provides the lazy-loading of all class files, as well
| Register The Framework Auto-Loader
* as any PSR-0 compliant libraries used by the application.
|--------------------------------------------------------------------------
*/
|
| Next we'll register the Autoloader class on the SPL auto-loader stack
| so it can lazy-load our class files as we need them. This class and
| method will be called each time a class is needed but has not been
| defined yet and will load the appropriate file.
|
*/
spl_autoload_register
(
array
(
'Laravel\\Autoloader'
,
'load'
));
spl_autoload_register
(
array
(
'Laravel\\Autoloader'
,
'load'
));
/**
/*
* Register the Laravel namespace so that the auto-loader loads it
|--------------------------------------------------------------------------
* according to the PSR-0 naming conventions. This should provide
| Register The Laravel Namespace
* fast resolution of all core classes.
|--------------------------------------------------------------------------
*/
|
| Register the "Laravel" namespace and its directory mapping so the class
| loader can quickly load all of the core classes using PSR-0 style load
| conventions throughout the "laravel" directory since all core classes
| are namespaced into the "Laravel" namespace.
|
*/
Autoloader
::
namespaces
(
array
(
'Laravel'
=>
path
(
'sys'
)));
Autoloader
::
namespaces
(
array
(
'Laravel'
=>
path
(
'sys'
)));
/**
/*
* Set the CLI options on the $_SERVER global array so we can easily
|--------------------------------------------------------------------------
* retrieve them from the various parts of the CLI code. We can use
| Set The CLI Options Array
* the Request class to access them conveniently.
|--------------------------------------------------------------------------
*/
|
| If the current request is from the Artisan command-line interface, we
| will parse the command line arguments and options and set them the
| array of options in the $_SERVER global array for convenience.
|
*/
if
(
defined
(
'STDIN'
))
if
(
defined
(
'STDIN'
))
{
{
$console
=
CLI\Command
::
options
(
$_SERVER
[
'argv'
]);
$console
=
CLI\Command
::
options
(
$_SERVER
[
'argv'
]);
...
@@ -52,22 +84,34 @@ if (defined('STDIN'))
...
@@ -52,22 +84,34 @@ if (defined('STDIN'))
$_SERVER
[
'CLI'
]
=
$options
;
$_SERVER
[
'CLI'
]
=
$options
;
}
}
/**
/*
* The Laravel environment may be specified on the CLI using the env
|--------------------------------------------------------------------------
* option, allowing the developer to easily use local configuration
| Set The CLI Laravel Environment
* files from the CLI since the environment is usually controlled
|--------------------------------------------------------------------------
* by server environmenet variables.
|
*/
| Next we'll set the LARAVEL_ENV variable if the current request is from
| the Artisan command-line interface. Since the environment is often
| specified within an Apache .htaccess file, we need to set it here
| when the request is not coming through Apache.
|
*/
if
(
isset
(
$_SERVER
[
'CLI'
][
'ENV'
]))
if
(
isset
(
$_SERVER
[
'CLI'
][
'ENV'
]))
{
{
$_SERVER
[
'LARAVEL_ENV'
]
=
$_SERVER
[
'CLI'
][
'ENV'
];
$_SERVER
[
'LARAVEL_ENV'
]
=
$_SERVER
[
'CLI'
][
'ENV'
];
}
}
/**
/*
* Finally we'll grab all of the bundles and register them with the
|--------------------------------------------------------------------------
* bundle class. All of the bundles are stored in an array within
| Register The Laravel Bundles
* the application directory which defines all bundles.
|--------------------------------------------------------------------------
*/
|
| Finally we will register all of the bundles that have been defined for
| the application. None of them will be started, yet but will be setup
| so that they may be started by the develop at any time.
|
*/
$bundles
=
require
path
(
'app'
)
.
'bundles'
.
EXT
;
$bundles
=
require
path
(
'app'
)
.
'bundles'
.
EXT
;
foreach
(
$bundles
as
$bundle
=>
$config
)
foreach
(
$bundles
as
$bundle
=>
$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