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
d9f2ba84
Commit
d9f2ba84
authored
Aug 19, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2.0 modular refactoring.
parent
4569ebec
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
180 additions
and
25 deletions
+180
-25
aliases.php
laravel/config/aliases.php
+48
-0
application.php
laravel/config/application.php
+0
-0
ascii.php
laravel/config/ascii.php
+0
-0
auth.php
laravel/config/auth.php
+0
-0
cache.php
laravel/config/cache.php
+0
-0
db.php
laravel/config/db.php
+0
-0
error.php
laravel/config/error.php
+0
-0
mimes.php
laravel/config/mimes.php
+0
-0
session.php
laravel/config/session.php
+0
-0
lang.php
laravel/lang.php
+11
-7
pagination.php
laravel/lang/en/pagination.php
+0
-0
validation.php
laravel/lang/en/validation.php
+0
-0
laravel.php
laravel/laravel.php
+18
-7
module.php
laravel/module.php
+4
-3
.gitignore
modules/application/config/.gitignore
+0
-0
application.php
modules/application/config/application.php
+98
-0
index.php
public/index.php
+1
-8
No files found.
config/aliases.php
→
laravel/
config/aliases.php
View file @
d9f2ba84
...
...
@@ -18,31 +18,31 @@ return array(
|
*/
'Asset'
=>
'Laravel\\Asset'
,
'Auth'
=>
'Laravel\\Auth'
,
'Asset'
=>
'Laravel\\Asset'
,
'Auth'
=>
'Laravel\\Auth'
,
'Benchmark'
=>
'Laravel\\Benchmark'
,
'Cache'
=>
'Laravel\\Cache'
,
'Config'
=>
'Laravel\\Config'
,
'Cookie'
=>
'Laravel\\Cookie'
,
'Crypter'
=>
'Laravel\\Crypter'
,
'DB'
=>
'Laravel\\DB'
,
'Eloquent'
=>
'Laravel\\DB\\Eloquent\\Model'
,
'File'
=>
'Laravel\\File'
,
'Form'
=>
'Laravel\\Form'
,
'Hash'
=>
'Laravel\\Hash'
,
'HTML'
=>
'Laravel\\HTML'
,
'Cache'
=>
'Laravel\\Cache'
,
'Config'
=>
'Laravel\\Config'
,
'Cookie'
=>
'Laravel\\Cookie'
,
'Crypter'
=>
'Laravel\\Crypter'
,
'DB'
=>
'Laravel\\DB'
,
'Eloquent'
=>
'Laravel\\DB\\Eloquent\\Model'
,
'File'
=>
'Laravel\\File'
,
'Form'
=>
'Laravel\\Form'
,
'Hash'
=>
'Laravel\\Hash'
,
'HTML'
=>
'Laravel\\HTML'
,
'Inflector'
=>
'Laravel\\Inflector'
,
'Input'
=>
'Laravel\\Input'
,
'Lang'
=>
'Laravel\\Lang'
,
'Loader'
=>
'Laravel\\Loader'
,
'Package'
=>
'Laravel\\Package'
,
'URL'
=>
'Laravel\\URL'
,
'Redirect'
=>
'Laravel\\Redirect'
,
'Request'
=>
'Laravel\\Request'
,
'Response'
=>
'Laravel\\Response'
,
'Session'
=>
'Laravel\\Session'
,
'Str'
=>
'Laravel\\Str'
,
'Input'
=>
'Laravel\\Input'
,
'Lang'
=>
'Laravel\\Lang'
,
'Loader'
=>
'Laravel\\Loader'
,
'Package'
=>
'Laravel\\Package'
,
'URL'
=>
'Laravel\\URL'
,
'Redirect'
=>
'Laravel\\Redirect'
,
'Request'
=>
'Laravel\\Request'
,
'Response'
=>
'Laravel\\Response'
,
'Session'
=>
'Laravel\\Session'
,
'Str'
=>
'Laravel\\Str'
,
'Validator'
=>
'Laravel\\Validator'
,
'View'
=>
'Laravel\\View'
,
'View'
=>
'Laravel\\View'
,
);
\ No newline at end of file
config/application.php
→
laravel/
config/application.php
View file @
d9f2ba84
File moved
config/ascii.php
→
laravel/
config/ascii.php
View file @
d9f2ba84
File moved
config/auth.php
→
laravel/
config/auth.php
View file @
d9f2ba84
File moved
config/cache.php
→
laravel/
config/cache.php
View file @
d9f2ba84
File moved
config/db.php
→
laravel/
config/db.php
View file @
d9f2ba84
File moved
config/error.php
→
laravel/
config/error.php
View file @
d9f2ba84
File moved
config/mimes.php
→
laravel/
config/mimes.php
View file @
d9f2ba84
File moved
config/session.php
→
laravel/
config/session.php
View file @
d9f2ba84
File moved
laravel/lang.php
View file @
d9f2ba84
...
...
@@ -67,14 +67,12 @@ class Lang {
list
(
$module
,
$file
,
$line
)
=
$this
->
parse
(
$this
->
key
,
$language
);
$this
->
load
(
$module
,
$file
,
$language
);
if
(
!
isset
(
static
::
$lines
[
$module
][
$language
.
$file
][
$line
]))
if
(
!
$this
->
load
(
$module
,
$file
,
$language
))
{
return
is_callable
(
$default
)
?
call_user_func
(
$default
)
:
$default
;
}
$line
=
static
::
$lines
[
$module
][
$language
.
$file
][
$line
]
;
$line
=
Arr
::
get
(
static
::
$lines
[
$module
][
$language
.
$file
],
$line
,
$default
)
;
foreach
(
$this
->
replacements
as
$key
=>
$value
)
{
...
...
@@ -109,16 +107,22 @@ class Lang {
* @param string $module
* @param string $file
* @param string $language
* @return
void
* @return
bool
*/
private
function
load
(
$module
,
$file
,
$language
)
{
if
(
isset
(
static
::
$lines
[
$module
][
$language
.
$file
]))
return
;
if
(
file_exists
(
$path
=
Module
::
path
(
$module
)
.
'lang/'
.
$language
.
'/'
.
$file
.
EXT
))
$lang
=
array
();
foreach
(
array
(
LANG_PATH
,
Module
::
path
(
$module
)
.
'lang/'
)
as
$directory
)
{
static
::
$lines
[
$module
][
$language
.
$file
]
=
require
$path
;
$lang
=
(
file_exists
(
$path
=
$directory
.
$language
.
'/'
.
$file
.
EXT
))
?
array_merge
(
$lang
,
require
$path
)
:
$lang
;
}
if
(
count
(
$lang
)
>
0
)
static
::
$lines
[
$module
][
$language
.
$file
]
=
$lang
;
return
isset
(
static
::
$lines
[
$module
][
$language
.
$file
]);
}
/**
...
...
modules/application
/lang/en/pagination.php
→
laravel
/lang/en/pagination.php
View file @
d9f2ba84
File moved
modules/application
/lang/en/validation.php
→
laravel
/lang/en/validation.php
View file @
d9f2ba84
File moved
laravel/laravel.php
View file @
d9f2ba84
...
...
@@ -9,7 +9,6 @@ define('EXT', '.php');
// Define the core framework paths.
// --------------------------------------------------------------
define
(
'BASE_PATH'
,
realpath
(
str_replace
(
'laravel'
,
''
,
$system
))
.
'/'
);
define
(
'CONFIG_PATH'
,
realpath
(
$config
)
.
'/'
);
define
(
'MODULE_PATH'
,
realpath
(
$modules
)
.
'/'
);
define
(
'PACKAGE_PATH'
,
realpath
(
$packages
)
.
'/'
);
define
(
'PUBLIC_PATH'
,
realpath
(
$public
)
.
'/'
);
...
...
@@ -22,16 +21,13 @@ unset($system, $config, $modules, $packages, $public, $storage);
// Define various other framework paths.
// --------------------------------------------------------------
define
(
'CACHE_PATH'
,
STORAGE_PATH
.
'cache/'
);
define
(
'CONFIG_PATH'
,
SYS_PATH
.
'config/'
);
define
(
'DATABASE_PATH'
,
STORAGE_PATH
.
'db/'
);
define
(
'LANG_PATH'
,
SYS_PATH
.
'lang/'
);
define
(
'SCRIPT_PATH'
,
PUBLIC_PATH
.
'js/'
);
define
(
'SESSION_PATH'
,
STORAGE_PATH
.
'sessions/'
);
define
(
'STYLE_PATH'
,
PUBLIC_PATH
.
'css/'
);
// --------------------------------------------------------------
// Define the default module.
// --------------------------------------------------------------
define
(
'DEFAULT_MODULE'
,
'application'
);
// --------------------------------------------------------------
// Load the classes used by the auto-loader.
// --------------------------------------------------------------
...
...
@@ -40,13 +36,23 @@ require SYS_PATH.'config'.EXT;
require
SYS_PATH
.
'module'
.
EXT
;
require
SYS_PATH
.
'arr'
.
EXT
;
// --------------------------------------------------------------
// Define the default module.
// --------------------------------------------------------------
define
(
'DEFAULT_MODULE'
,
'application'
);
// --------------------------------------------------------------
// Register the active modules.
// --------------------------------------------------------------
Module
::
$modules
=
$active
;
Module
::
$modules
=
array_merge
(
array
(
'application'
=>
'application'
),
$active
)
;
unset
(
$active
);
// --------------------------------------------------------------
// Define the default module path.
// --------------------------------------------------------------
define
(
'DEFAULT_MODULE_PATH'
,
Module
::
path
(
DEFAULT_MODULE
));
// --------------------------------------------------------------
// Register the auto-loader.
// --------------------------------------------------------------
...
...
@@ -142,6 +148,11 @@ define('ACTIVE_MODULE', (array_key_exists($segments[0], Module::$modules)) ? $se
// --------------------------------------------------------------
define
(
'ACTIVE_MODULE_PATH'
,
Module
::
path
(
ACTIVE_MODULE
));
// --------------------------------------------------------------
// Register the filters for the default module.
// --------------------------------------------------------------
Routing\Filter
::
register
(
require
DEFAULT_MODULE_PATH
.
'filters'
.
EXT
);
// --------------------------------------------------------------
// Register the filters for the active module.
// --------------------------------------------------------------
...
...
laravel/module.php
View file @
d9f2ba84
...
...
@@ -43,9 +43,10 @@ class Module {
{
if
(
array_key_exists
(
$module
,
static
::
$paths
))
return
static
::
$paths
[
$module
];
if
(
array_key_exists
(
$module
,
static
::
$modules
))
$path
=
MODULE_PATH
.
static
::
$modules
[
$module
]
.
'/'
;
return
static
::
$paths
[
$module
]
=
$path
;
if
(
array_key_exists
(
$module
,
static
::
$modules
))
{
return
static
::
$paths
[
$module
]
=
MODULE_PATH
.
static
::
$modules
[
$module
]
.
'/'
;
}
}
/**
...
...
config/.gitignore
→
modules/application/
config/.gitignore
View file @
d9f2ba84
File moved
modules/application/config/application.php
0 → 100644
View file @
d9f2ba84
<?php
return
array
(
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| The URL used to access your application. No trailing slash.
|
*/
'url'
=>
'http://localhost'
,
/*
|--------------------------------------------------------------------------
| Application Index
|--------------------------------------------------------------------------
|
| If you are including the "index.php" in your URLs, you can ignore this.
|
| However, if you are using mod_rewrite or something similar to get
| cleaner URLs, set this option to an empty string.
|
*/
'index'
=>
'index.php'
,
/*
|--------------------------------------------------------------------------
| Application Language
|--------------------------------------------------------------------------
|
| The default language of your application. This language will be used by
| Lang library as the default language when doing string localization.
|
*/
'language'
=>
'en'
,
/*
|--------------------------------------------------------------------------
| Application Character Encoding
|--------------------------------------------------------------------------
|
| The default character encoding used by your application. This is the
| character encoding that will be used by the Str, Text, and Form classes.
|
*/
'encoding'
=>
'UTF-8'
,
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| The default timezone of your application. This timezone will be used when
| Laravel needs a date, such as when writing to a log file.
|
*/
'timezone'
=>
'UTC'
,
/*
|--------------------------------------------------------------------------
| Auto-Loaded Packages
|--------------------------------------------------------------------------
|
| The packages that should be auto-loaded each time Laravel handles
| a request. These should generally be packages that you use on almost
| every request to your application.
|
| Each package specified here will be bootstrapped and can be conveniently
| used by your application's routes, models, and libraries.
|
| Note: The package names in this array should correspond to a package
| directory in application/packages.
|
*/
'packages'
=>
array
(),
/*
|--------------------------------------------------------------------------
| Application Key
|--------------------------------------------------------------------------
|
| Your application key should be a 32 character string that is totally
| random and secret. This key is used by the encryption class to generate
| secure, encrypted strings.
|
*/
'key'
=>
''
,
);
\ No newline at end of file
public/index.php
View file @
d9f2ba84
...
...
@@ -11,20 +11,13 @@
// --------------------------------------------------------------
// The active modules for this Laravel installation.
// --------------------------------------------------------------
$active
=
array
(
'application'
=>
'application'
,
);
$active
=
array
();
// --------------------------------------------------------------
// The path to the Laravel directory.
// --------------------------------------------------------------
$system
=
'../laravel'
;
// --------------------------------------------------------------
// The path to the configuration directory.
// --------------------------------------------------------------
$config
=
'../config'
;
// --------------------------------------------------------------
// The path to the packages directory.
// --------------------------------------------------------------
...
...
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