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
31e2c1c4
Commit
31e2c1c4
authored
Sep 04, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added facades for core classes.
parent
86da3af7
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
127 additions
and
61 deletions
+127
-61
aliases.php
application/config/aliases.php
+15
-15
routes.php
application/routes.php
+1
-1
bootstrap.php
laravel/bootstrap.php
+1
-0
config.php
laravel/config.php
+4
-2
container.php
laravel/config/container.php
+5
-3
cookie.php
laravel/cookie.php
+2
-0
download.php
laravel/download.php
+2
-0
facade.php
laravel/facade.php
+15
-0
file.php
laravel/file.php
+2
-0
form.php
laravel/form.php
+2
-0
html.php
laravel/html.php
+2
-0
input.php
laravel/input.php
+3
-1
lang.php
laravel/lang.php
+58
-38
loader.php
laravel/loader.php
+3
-1
package.php
laravel/package.php
+2
-0
redirect.php
laravel/redirect.php
+2
-0
request.php
laravel/request.php
+2
-0
response.php
laravel/response.php
+2
-0
url.php
laravel/url.php
+2
-0
view.php
laravel/view.php
+2
-0
No files found.
application/config/aliases.php
View file @
31e2c1c4
...
...
@@ -22,30 +22,30 @@ return array(
'Auth'
=>
'Laravel\\Security\\Authenticator'
,
'Benchmark'
=>
'Laravel\\Benchmark'
,
'Cache'
=>
'Laravel\\Cache\\Manager'
,
'Config'
=>
'Laravel\\Config'
,
'Cookie'
=>
'Laravel\\Cookie'
,
'Config'
=>
'Laravel\\Config
_Facade
'
,
'Cookie'
=>
'Laravel\\Cookie
_Facade
'
,
'Crypter'
=>
'Laravel\\Security\\Crypter'
,
'DB'
=>
'Laravel\\Database\\Manager'
,
'Download'
=>
'Laravel\\Download'
,
'Download'
=>
'Laravel\\Download
_Facade
'
,
'Eloquent'
=>
'Laravel\\Database\\Eloquent\\Model'
,
'Error'
=>
'Laravel\\Error'
,
'File'
=>
'Laravel\\File'
,
'Form'
=>
'Laravel\\Form'
,
'File'
=>
'Laravel\\File
_Facade
'
,
'Form'
=>
'Laravel\\Form
_Facade
'
,
'Hasher'
=>
'Laravel\\Security\\Hasher'
,
'HTML'
=>
'Laravel\\HTML'
,
'HTML'
=>
'Laravel\\HTML
_Facade
'
,
'Inflector'
=>
'Laravel\\Inflector'
,
'Input'
=>
'Laravel\\Input'
,
'Input'
=>
'Laravel\\Input
_Facade
'
,
'IoC'
=>
'Laravel\\IoC'
,
'Lang'
=>
'Laravel\\Lang'
,
'Loader'
=>
'Laravel\\Loader'
,
'Package'
=>
'Laravel\\Package'
,
'URL'
=>
'Laravel\\URL'
,
'Redirect'
=>
'Laravel\\Redirect'
,
'Request'
=>
'Laravel\\Request'
,
'Response'
=>
'Laravel\\Response'
,
'Lang'
=>
'Laravel\\Lang
_Facade
'
,
'Loader'
=>
'Laravel\\Loader
_Facade
'
,
'Package'
=>
'Laravel\\Package
_Facade
'
,
'URL'
=>
'Laravel\\URL
_Facade
'
,
'Redirect'
=>
'Laravel\\Redirect
_Facade
'
,
'Request'
=>
'Laravel\\Request
_Facade
'
,
'Response'
=>
'Laravel\\Response
_Facade
'
,
'Session'
=>
'Laravel\\Session\\Manager'
,
'Str'
=>
'Laravel\\Str'
,
'Validator'
=>
'Laravel\\Validation\\Validator'
,
'View'
=>
'Laravel\\View'
,
'View'
=>
'Laravel\\View
_Facade
'
,
);
\ No newline at end of file
application/routes.php
View file @
31e2c1c4
...
...
@@ -39,7 +39,7 @@ return array(
'GET /'
=>
function
(
$laravel
)
{
return
$laravel
->
view
->
make
(
'home.index'
);
return
View
::
make
(
'home.index'
);
},
);
\ No newline at end of file
laravel/bootstrap.php
View file @
31e2c1c4
...
...
@@ -42,6 +42,7 @@ $application = new Application;
// --------------------------------------------------------------
// Load the configuration manager.
// --------------------------------------------------------------
require
SYS_PATH
.
'facade'
.
EXT
;
require
SYS_PATH
.
'loader'
.
EXT
;
require
SYS_PATH
.
'config'
.
EXT
;
require
SYS_PATH
.
'arr'
.
EXT
;
...
...
laravel/config.php
View file @
31e2c1c4
<?php
namespace
Laravel
;
class
Config_Facade
extends
Facade
{
public
static
$resolve
=
'config'
;
}
class
Config
{
/**
...
...
@@ -9,14 +11,14 @@ class Config {
*
* @var array
*/
p
ublic
$items
=
array
();
p
rotected
$items
=
array
();
/**
* The paths containing the configuration files.
*
* @var array
*/
p
ublic
$paths
=
array
();
p
rotected
$paths
=
array
();
/**
* Create a new configuration manager instance.
...
...
laravel/config/container.php
View file @
31e2c1c4
...
...
@@ -61,7 +61,7 @@ return array(
}),
'laravel.form'
=>
array
(
'resolver'
=>
function
(
$container
)
'laravel.form'
=>
array
(
'
singleton'
=>
true
,
'
resolver'
=>
function
(
$container
)
{
list
(
$request
,
$html
,
$url
)
=
array
(
$container
->
resolve
(
'laravel.request'
),
...
...
@@ -79,7 +79,7 @@ return array(
}),
'laravel.html'
=>
array
(
'resolver'
=>
function
(
$container
)
'laravel.html'
=>
array
(
'
singleton'
=>
true
,
'
resolver'
=>
function
(
$container
)
{
return
new
HTML
(
$container
->
resolve
(
'laravel.url'
),
$container
->
resolve
(
'laravel.config'
)
->
get
(
'application.encoding'
));
}),
...
...
@@ -110,7 +110,9 @@ return array(
'laravel.lang'
=>
array
(
'singleton'
=>
true
,
'resolver'
=>
function
(
$container
)
{
return
new
Lang
(
$container
->
resolve
(
'laravel.config'
)
->
get
(
'application.language'
),
array
(
SYS_LANG_PATH
,
LANG_PATH
));
require_once
SYS_PATH
.
'lang'
.
EXT
;
return
new
Lang_Factory
(
$container
->
resolve
(
'laravel.config'
),
array
(
SYS_LANG_PATH
,
LANG_PATH
));
}),
...
...
laravel/cookie.php
View file @
31e2c1c4
<?php
namespace
Laravel
;
class
Cookie_Facade
extends
Facade
{
public
static
$resolve
=
'cookie'
;
}
class
Cookie
{
/**
...
...
laravel/download.php
View file @
31e2c1c4
<?php
namespace
Laravel
;
class
Download_Facade
extends
Facade
{
public
static
$resolve
=
'download'
;
}
class
Download
extends
Response
{
/**
...
...
laravel/facade.php
0 → 100644
View file @
31e2c1c4
<?php
namespace
Laravel
;
abstract
class
Facade
{
/**
* Magic Method for passing methods to a class registered in the IoC container.
* This provides a convenient method of accessing functions on classes that
* could not otherwise be accessed staticly.
*/
public
static
function
__callStatic
(
$method
,
$parameters
)
{
return
call_user_func_array
(
array
(
IoC
::
container
()
->
resolve
(
'laravel.'
.
static
::
$resolve
),
$method
),
$parameters
);
}
}
\ No newline at end of file
laravel/file.php
View file @
31e2c1c4
<?php
namespace
Laravel
;
class
File_Facade
extends
Facade
{
public
static
$resolve
=
'file'
;
}
class
File
{
/**
...
...
laravel/form.php
View file @
31e2c1c4
<?php
namespace
Laravel
;
class
Form_Facade
extends
Facade
{
public
static
$resolve
=
'form'
;
}
class
Form
{
/**
...
...
laravel/html.php
View file @
31e2c1c4
<?php
namespace
Laravel
;
class
HTML_Facade
extends
Facade
{
public
static
$resolve
=
'html'
;
}
class
HTML
{
/**
...
...
laravel/input.php
View file @
31e2c1c4
<?php
namespace
Laravel
;
class
Input_Facade
extends
Facade
{
public
static
$resolve
=
'input'
;
}
class
Input
{
/**
...
...
@@ -7,7 +9,7 @@ class Input {
*
* @var array
*/
pr
ivate
$input
;
pr
otected
$input
;
/**
* The $_GET array for the request.
...
...
laravel/lang.php
View file @
31e2c1c4
<?php
namespace
Laravel
;
class
Lang
{
class
Lang_Facade
extends
Facade
{
public
static
$resolve
=
'lang'
;
}
class
Lang_Factory
{
/**
*
All of the loaded language lines
.
*
The configuration manager instance
.
*
* The array is keyed by [$language.$file].
* @var Config
*/
protected
$config
;
/**
* The paths containing the language files.
*
* @var array
*/
pr
ivate
$lines
=
array
()
;
pr
otected
$paths
;
/**
*
The default language being used by the application
.
*
Create a new language factory instance
.
*
* @var string
* @param Config $config
* @param array $paths
* @return void
*/
private
$language
;
public
function
__construct
(
Config
$config
,
$paths
)
{
$this
->
paths
=
$paths
;
$this
->
config
=
$config
;
}
/**
* The paths containing the language files.
* Begin retrieving a language line.
*
* @param string $key
* @param array $replacements
* @return Lang
*/
public
function
line
(
$key
,
$replacements
=
array
())
{
return
new
Lang
(
$key
,
$replacements
,
$this
->
config
->
get
(
'application.language'
),
$this
->
paths
);
}
}
class
Lang
{
/**
* All of the loaded language lines.
*
* The array is keyed by [$language.$file].
*
* @var array
*/
private
$paths
;
private
static
$lines
=
array
()
;
/**
* The key of the language line being retrieved.
...
...
@@ -40,45 +71,34 @@ class Lang {
private
$replacements
;
/**
* The language of the line being retrieved.
*
* This is set to the default language when a new line is requested.
* However, it may be changed using the "in" method.
* The default language being used by the application.
*
* @var string
*/
private
$l
ine_l
anguage
;
private
$language
;
/**
*
Create a new Lang instance
.
*
The paths containing the language files
.
*
* @param string $language
* @param array $paths
* @return void
* @var array
*/
public
function
__construct
(
$language
,
$paths
)
{
$this
->
paths
=
$paths
;
$this
->
language
=
$language
;
}
private
$paths
;
/**
* Begin retrieving a new language line.
*
* Language lines are retrieved using "dot" notation. So, asking for the "messages.required" langauge
* line would return the "required" line from the "messages" language file.
* Create a new Lang instance.
*
* @param string $key
* @param array $replacements
* @return Lang
* @param string $language
* @param array $paths
* @return void
*/
public
function
line
(
$key
,
$replacements
=
array
()
)
public
function
__construct
(
$key
,
$replacements
,
$language
,
$paths
)
{
$this
->
key
=
$key
;
$this
->
paths
=
$paths
;
$this
->
language
=
$language
;
$this
->
replacements
=
$replacements
;
$this
->
line_language
=
$this
->
language
;
return
$this
;
}
/**
...
...
@@ -98,7 +118,7 @@ class Lang {
return
(
$default
instanceof
\Closure
)
?
call_user_func
(
$default
)
:
$default
;
}
$line
=
Arr
::
get
(
$this
->
lines
[
$this
->
line_
language
.
$file
],
$line
,
$default
);
$line
=
Arr
::
get
(
static
::
$lines
[
$this
->
language
.
$file
],
$line
,
$default
);
foreach
(
$this
->
replacements
as
$key
=>
$value
)
{
...
...
@@ -138,13 +158,13 @@ class Lang {
*/
private
function
load
(
$file
)
{
if
(
isset
(
$this
->
lines
[
$this
->
line_
language
.
$file
]))
return
;
if
(
isset
(
static
::
$lines
[
$this
->
language
.
$file
]))
return
;
$language
=
array
();
foreach
(
$this
->
paths
as
$directory
)
{
if
(
file_exists
(
$path
=
$directory
.
$this
->
l
ine_l
anguage
.
'/'
.
$file
.
EXT
))
if
(
file_exists
(
$path
=
$directory
.
$this
->
language
.
'/'
.
$file
.
EXT
))
{
$language
=
array_merge
(
$language
,
require
$path
);
}
...
...
@@ -152,10 +172,10 @@ class Lang {
if
(
count
(
$language
)
>
0
)
{
$this
->
lines
[
$this
->
line_
language
.
$file
]
=
$language
;
static
::
$lines
[
$this
->
language
.
$file
]
=
$language
;
}
return
isset
(
$this
->
lines
[
$this
->
line_
language
.
$file
]);
return
isset
(
static
::
$lines
[
$this
->
language
.
$file
]);
}
/**
...
...
@@ -168,7 +188,7 @@ class Lang {
*/
public
function
in
(
$language
)
{
$this
->
l
ine_language
=
$line_
language
;
$this
->
l
anguage
=
$
language
;
return
$this
;
}
...
...
laravel/loader.php
View file @
31e2c1c4
<?php
namespace
Laravel
;
class
Loader_Facade
extends
Facade
{
public
static
$resolve
=
'loader'
;
}
class
Loader
{
/**
...
...
@@ -38,7 +40,7 @@ class Loader {
*/
public
function
load
(
$class
)
{
$file
=
strtolower
(
str_replace
(
'\\'
,
'/'
,
$class
));
$file
=
strtolower
(
str_replace
(
array
(
'\\'
,
'_Facade'
),
array
(
'/'
,
''
)
,
$class
));
if
(
array_key_exists
(
$class
,
$this
->
aliases
))
{
...
...
laravel/package.php
View file @
31e2c1c4
<?php
namespace
Laravel
;
class
Package_Facade
extends
Facade
{
public
static
$resolve
=
'package'
;
}
class
Package
{
/**
...
...
laravel/redirect.php
View file @
31e2c1c4
<?php
namespace
Laravel
;
class
Redirect_Facade
extends
Facade
{
public
static
$resolve
=
'redirect'
;
}
class
Redirect
extends
Response
{
/**
...
...
laravel/request.php
View file @
31e2c1c4
<?php
namespace
Laravel
;
class
Request_Facade
extends
Facade
{
public
static
$resolve
=
'request'
;
}
class
Request
{
/**
...
...
laravel/response.php
View file @
31e2c1c4
<?php
namespace
Laravel
;
class
Response_Facade
extends
Facade
{
public
static
$resolve
=
'response'
;
}
class
Response_Factory
{
/**
...
...
laravel/url.php
View file @
31e2c1c4
<?php
namespace
Laravel
;
class
URL_Facade
extends
Facade
{
public
static
$resolve
=
'url'
;
}
class
URL
{
/**
...
...
laravel/view.php
View file @
31e2c1c4
<?php
namespace
Laravel
;
class
View_Facade
extends
Facade
{
public
static
$resolve
=
'view'
;
}
/**
* The view composer class is responsible for calling the composer on a view and
* searching through the view composers for a given view name. It is injected
...
...
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