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
5ad61844
Commit
5ad61844
authored
Jul 26, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved auto-loader into public/index.php.
parent
14c8878b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
4 deletions
+30
-4
index.php
public/index.php
+30
-4
No files found.
public/index.php
View file @
5ad61844
...
...
@@ -8,6 +8,8 @@
* @link http://laravel.com
*/
$time
=
microtime
(
true
);
// --------------------------------------------------------------
// Define the framework paths.
// --------------------------------------------------------------
...
...
@@ -15,8 +17,12 @@ define('BASE_PATH', realpath('../').'/');
define
(
'APP_PATH'
,
realpath
(
'../application'
)
.
'/'
);
define
(
'SYS_PATH'
,
realpath
(
'../system'
)
.
'/'
);
define
(
'CONFIG_PATH'
,
APP_PATH
.
'config/'
);
define
(
'LIBRARY_PATH'
,
APP_PATH
.
'libraries/'
);
define
(
'MODEL_PATH'
,
APP_PATH
.
'models/'
);
define
(
'PACKAGE_PATH'
,
APP_PATH
.
'packages/'
);
define
(
'PUBLIC_PATH'
,
realpath
(
__DIR__
.
'/'
));
define
(
'ROUTE_PATH'
,
APP_PATH
.
'routes/'
);
define
(
'VIEW_PATH'
,
APP_PATH
.
'views/'
);
// --------------------------------------------------------------
// Define the PHP file extension.
...
...
@@ -32,7 +38,25 @@ require SYS_PATH.'arr'.EXT;
// --------------------------------------------------------------
// Register the auto-loader.
// --------------------------------------------------------------
spl_autoload_register
(
require
SYS_PATH
.
'loader'
.
EXT
);
spl_autoload_register
(
function
(
$class
)
{
$file
=
strtolower
(
str_replace
(
'\\'
,
'/'
,
$class
));
if
(
array_key_exists
(
$class
,
$aliases
=
System\Config
::
get
(
'aliases'
)))
{
return
class_alias
(
$aliases
[
$class
],
$class
);
}
foreach
(
array
(
BASE_PATH
,
MODEL_PATH
,
LIBRARY_PATH
)
as
$directory
)
{
if
(
file_exists
(
$path
=
$directory
.
$file
.
EXT
))
{
require
$path
;
return
;
}
}
});
// --------------------------------------------------------------
// Set the error reporting and display levels.
...
...
@@ -91,9 +115,9 @@ $response = System\Route\Filter::call('before', array(), true);
// ----------------------------------------------------------
if
(
is_null
(
$response
))
{
$route
=
System\Router
::
route
(
Request
::
method
(),
Request
::
uri
());
$route
=
System\Router
::
route
(
System\Request
::
method
(),
System\
Request
::
uri
());
$response
=
(
is_null
(
$route
))
?
System\Response
::
make
(
View
::
make
(
'error/404'
),
404
)
:
$route
->
call
();
$response
=
(
is_null
(
$route
))
?
System\Response
::
make
(
System\
View
::
make
(
'error/404'
),
404
)
:
$route
->
call
();
}
else
{
...
...
@@ -121,4 +145,6 @@ if (System\Config::get('session.driver') != '')
// --------------------------------------------------------------
// Send the response to the browser.
// --------------------------------------------------------------
$response
->
send
();
\ No newline at end of file
$response
->
send
();
echo
(
microtime
(
true
)
-
$time
)
*
1000
;
\ 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