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
8718b582
Commit
8718b582
authored
Nov 10, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaning up the autoloader and core bootstrapping.
parent
56daba42
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
37 deletions
+35
-37
autoloader.php
laravel/autoloader.php
+0
-14
core.php
laravel/bootstrap/core.php
+4
-7
laravel.php
laravel/laravel.php
+13
-16
controller.php
laravel/routing/controller.php
+18
-0
No files found.
laravel/autoloader.php
View file @
8718b582
...
...
@@ -86,20 +86,6 @@ class Autoloader {
return
$path
;
}
// Since not all controllers will be resolved by the controller resolver,
// we will do a quick check in the controller directory for the class.
// For instance, since base controllers would not be resolved by the
// controller class, we will need to resolve them here.
if
(
strpos
(
$class
,
'_Controller'
)
!==
false
)
{
$controller
=
str_replace
(
array
(
'_Controller'
,
'_'
),
array
(
''
,
'/'
),
$class
);
if
(
file_exists
(
$path
=
strtolower
(
CONTROLLER_PATH
.
$controller
.
EXT
)))
{
return
$path
;
}
}
}
}
\ No newline at end of file
laravel/bootstrap/core.php
View file @
8718b582
<?php
namespace
Laravel
;
/**
* Define all of the constants used by the framework. All of the core
* paths will be defined, as well as all of the paths which derive
* from these core paths.
*/
define
(
'EXT'
,
'.php'
);
define
(
'CRLF'
,
chr
(
13
)
.
chr
(
10
));
define
(
'BLADE_EXT'
,
'.blade.php'
);
...
...
@@ -30,8 +25,10 @@ define('VIEW_PATH', APP_PATH.'views/');
/**
* Define the Laravel environment configuration path. This path is used
* by the configuration class to load configuration options specific
* for the server environment.
* by the configuration class to load configuration options specific for
* the server environment, allowing the developer to conveniently change
* configuration options based on the application environment.
*
*/
$environment
=
''
;
...
...
laravel/laravel.php
View file @
8718b582
...
...
@@ -8,15 +8,12 @@
require
'bootstrap/core.php'
;
/**
* Register the framework error handling methods and set the
*
error_reporting levels. This file will register handlers
*
for exceptions, errors, and shutdown
.
* Register the framework error handling methods and set the
error
*
reporting levels. This file will register handlers for exceptions,
*
errors, and the shutdown event
.
*/
require
SYS_PATH
.
'bootstrap/errors'
.
EXT
;
/**
* Set the application's default timezone.
*/
date_default_timezone_set
(
Config
::
$items
[
'application'
][
'timezone'
]);
/**
...
...
@@ -34,8 +31,9 @@ if (Config::$items['session']['driver'] !== '')
}
/**
* Manually load some core classes that are used on every request
* This allows to avoid using the loader for these classes.
* Manually load some core classes that are used on every request so
* we can avoid using the loader for these classes. This saves us
* some overhead on each request.
*/
require
SYS_PATH
.
'input'
.
EXT
;
require
SYS_PATH
.
'request'
.
EXT
;
...
...
@@ -46,9 +44,9 @@ require SYS_PATH.'routing/loader'.EXT;
require
SYS_PATH
.
'routing/filter'
.
EXT
;
/**
* Gather the input to the application
for
the current request.
* The input will be gathered based on the current request method
*
and
will be set on the Input manager.
* Gather the input to the application
based on
the current request.
* The input will be gathered based on the current request method
and
* will be set on the Input manager.
*/
$input
=
array
();
...
...
@@ -75,8 +73,10 @@ switch (Request::method())
}
/**
* The spoofed request method is removed from the input so it is
* not unexpectedly included in Input::all() or Input::get().
* The spoofed request method is removed from the input so it is not
* unexpectedly included in Input::all() or Input::get(). Leaving it
* in the input array could cause unexpected results if the developer
* fills an Eloquent model with the input.
*/
unset
(
$input
[
Request
::
spoofer
]);
...
...
@@ -122,7 +122,4 @@ if (Config::$items['session']['driver'] !== '')
IoC
::
container
()
->
core
(
'session'
)
->
save
(
$driver
);
}
/**
* Finally, we can send the response to the browser.
*/
$response
->
send
();
\ No newline at end of file
laravel/routing/controller.php
View file @
8718b582
...
...
@@ -6,6 +6,24 @@ use Laravel\Request;
use
Laravel\Redirect
;
use
Laravel\Response
;
/**
* Register a function on the autoload stack to lazy-load controller files.
* We register this function here to keep the primary autoloader smaller
* since this logic is not needed for every Laravel application.
*/
spl_autoload_register
(
function
(
$controller
)
{
if
(
strpos
(
$controller
,
'_Controller'
)
!==
false
)
{
$controller
=
str_replace
(
array
(
'_Controller'
,
'_'
),
array
(
''
,
'/'
),
$controller
);
if
(
file_exists
(
$path
=
strtolower
(
CONTROLLER_PATH
.
$controller
.
EXT
)))
{
return
$path
;
}
}
});
abstract
class
Controller
{
/**
...
...
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