Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
c200f3eb
Commit
c200f3eb
authored
Aug 30, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more ioc refactoring.
parent
0ef96fb8
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
31 additions
and
112 deletions
+31
-112
application/config/aliases.php
+1
-1
laravel/bootstrap.php
+0
-1
laravel/cache/file.php
+4
-14
laravel/config/container.php
+6
-18
laravel/download.php
+0
-2
laravel/facade.php
+0
-18
laravel/file.php
+1
-3
laravel/inflector.php
+1
-25
laravel/input.php
+1
-3
laravel/lang.php
+1
-3
laravel/laravel.php
+3
-1
laravel/loader.php
+0
-2
laravel/package.php
+1
-3
laravel/redirect.php
+1
-3
laravel/request.php
+1
-3
laravel/routing/router.php
+5
-5
laravel/session/file.php
+4
-4
laravel/url.php
+1
-3
No files found.
application/config/aliases.php
View file @
c200f3eb
...
...
@@ -29,7 +29,7 @@ return array(
'Download'
=>
'Laravel\\Download'
,
'Eloquent'
=>
'Laravel\\Database\\Eloquent\\Model'
,
'Error'
=>
'Laravel\\Error'
,
'File'
=>
'Laravel\\File
_Facade
'
,
'File'
=>
'Laravel\\File'
,
'Form'
=>
'Laravel\\Form'
,
'Hasher'
=>
'Laravel\\Security\\Hasher'
,
'HTML'
=>
'Laravel\\HTML'
,
...
...
laravel/bootstrap.php
View file @
c200f3eb
...
...
@@ -42,7 +42,6 @@ $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/cache/file.php
View file @
c200f3eb
...
...
@@ -5,7 +5,7 @@ class File extends Driver {
/**
* The file engine instance.
*
* @var Laravel\File
_Engine
* @var Laravel\File
*/
private
$file
;
...
...
@@ -19,11 +19,11 @@ class File extends Driver {
/**
* Create a new File cache driver instance.
*
* @param Laravel\File
_Engine
$file
* @param string
$path
* @param Laravel\File $file
* @param string $path
* @return void
*/
public
function
__construct
(
\Laravel\File
_Engine
$file
,
$path
)
public
function
__construct
(
\Laravel\File
$file
,
$path
)
{
$this
->
file
=
$file
;
$this
->
path
=
$path
;
...
...
@@ -32,11 +32,6 @@ class File extends Driver {
/**
* Determine if an item exists in the cache.
*
* <code>
* // Determine if the "name" item exists in the cache
* $exists = Cache::driver()->has('name');
* </code>
*
* @param string $key
* @return bool
*/
...
...
@@ -66,11 +61,6 @@ class File extends Driver {
/**
* Write an item to the cache for a given number of minutes.
*
* <code>
* // Write the "name" item to the cache for 30 minutes
* Cache::driver()->put('name', 'Fred', 30);
* </code>
*
* @param string $key
* @param mixed $value
* @param int $minutes
...
...
laravel/config/container.php
View file @
c200f3eb
...
...
@@ -43,16 +43,12 @@ return array(
'laravel.file'
=>
array
(
'singleton'
=>
true
,
'resolver'
=>
function
(
$container
)
{
require_once
SYS_PATH
.
'file'
.
EXT
;
return
new
File
(
$container
->
resolve
(
'laravel.config'
)
->
get
(
'mimes'
));
}),
'laravel.input'
=>
array
(
'singleton'
=>
true
,
'resolver'
=>
function
(
$container
)
{
require_once
SYS_PATH
.
'input'
.
EXT
;
$application
=
$container
->
resolve
(
'laravel.application'
);
$input
=
array
();
...
...
@@ -70,15 +66,13 @@ return array(
(
$application
->
request
->
spoofed
())
?
$input
=
$_POST
:
parse_str
(
file_get_contents
(
'php://input'
),
$input
);
}
return
new
Input
_Engine
(
$input
,
$_FILES
,
$container
->
resolve
(
'laravel.cookie'
));
return
new
Input
(
$input
,
$_FILES
,
$container
->
resolve
(
'laravel.cookie'
));
}),
'laravel.lang'
=>
array
(
'singleton'
=>
true
,
'resolver'
=>
function
(
$container
)
{
require_once
SYS_PATH
.
'lang'
.
EXT
;
return
new
Lang_Engine
(
$container
->
resolve
(
'laravel.config'
)
->
get
(
'application.language'
),
array
(
SYS_LANG_PATH
,
LANG_PATH
));
return
new
Lang
(
$container
->
resolve
(
'laravel.config'
)
->
get
(
'application.language'
),
array
(
SYS_LANG_PATH
,
LANG_PATH
));
}),
...
...
@@ -92,23 +86,19 @@ return array(
'laravel.package'
=>
array
(
'singleton'
=>
true
,
'resolver'
=>
function
()
{
return
new
Package
_Engine
(
PACKAGE_PATH
);
return
new
Package
(
PACKAGE_PATH
);
}),
'laravel.redirect'
=>
array
(
'singleton'
=>
true
,
'resolver'
=>
function
(
$container
)
{
require_once
SYS_PATH
.
'redirect'
.
EXT
;
return
new
Redirect_Engine
(
$container
->
resolve
(
'laravel.url'
));
return
new
Redirect
(
$container
->
resolve
(
'laravel.url'
));
}),
'laravel.request'
=>
array
(
'singleton'
=>
true
,
'resolver'
=>
function
(
$container
)
{
require_once
SYS_PATH
.
'request'
.
EXT
;
return
new
Request_Engine
(
$_SERVER
,
$container
->
resolve
(
'laravel.config'
)
->
get
(
'application.url'
));
return
new
Request
(
$_SERVER
,
$container
->
resolve
(
'laravel.config'
)
->
get
(
'application.url'
));
}),
...
...
@@ -140,15 +130,13 @@ return array(
'laravel.url'
=>
array
(
'singleton'
=>
true
,
'resolver'
=>
function
(
$container
)
{
require_once
SYS_PATH
.
'url'
.
EXT
;
list
(
$request
,
$base
,
$index
)
=
array
(
$container
->
resolve
(
'laravel.request'
),
$container
->
resolve
(
'laravel.config'
)
->
get
(
'application.url'
),
$container
->
resolve
(
'laravel.config'
)
->
get
(
'application.index'
),
);
return
new
URL
_Engine
(
$container
->
resolve
(
'laravel.router'
),
$base
,
$index
,
$request
->
secure
());
return
new
URL
(
$container
->
resolve
(
'laravel.router'
),
$base
,
$index
,
$request
->
secure
());
}),
...
...
laravel/download.php
View file @
c200f3eb
<?php
namespace
Laravel
;
class
Download_Facade
extends
Facade
{
public
static
$resolve
=
'download'
;
}
class
Download
extends
Response
{
/**
...
...
laravel/facade.php
deleted
100644 → 0
View file @
0ef96fb8
<?php
namespace
Laravel
;
abstract
class
Facade
{
/**
* Magic Method that allows the calling of a class staticly. This provides a convenient API
* while still maintaining the benefits of dependency injection and testability of the class.
*
* Each facade has a "resolve" property that informs the base class of what it needs to resolve
* our of the IoC container each time an operation is called on the facade.
*/
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 @
c200f3eb
<?php
namespace
Laravel
;
class
File_Facade
extends
Facade
{
public
static
$resolve
=
'file'
;
}
class
File
{
/**
...
...
@@ -12,7 +10,7 @@ class File {
private
$mimes
;
/**
* Create a new file
manager
instance.
* Create a new file
engine
instance.
*
* @param array $mimes
* @return void
...
...
laravel/inflector.php
View file @
c200f3eb
...
...
@@ -116,16 +116,8 @@ class Inflector {
/**
* Get the plural form of a word if the specified count is greater than one.
*
* <code>
* // Returns "friend"
* Inflector::plural_if('friend', 1);
*
* // Returns "friends"
* Inflector::plural_if('friend', 2);
* </code>
*
* @param string $value
* @param int $count
* @param int
$count
* @return string
*/
public
static
function
plural_if
(
$value
,
$count
)
...
...
@@ -136,14 +128,6 @@ class Inflector {
/**
* Convert a word to its plural form.
*
* <code>
* // Returns "friends"
* Inflector::plural('friend');
*
* // Returns "children"
* Inflector::plural('child');
* </code>
*
* @param string $value
* @return string
*/
...
...
@@ -157,14 +141,6 @@ class Inflector {
/**
* Convert a word to its singular form.
*
* <code>
* // Returns "friend"
* Inflector::singular('friends');
*
* // Returns "child"
* Inflector::singular('children');
* </code>
*
* @param string $value
* @return string
*/
...
...
laravel/input.php
View file @
c200f3eb
<?php
namespace
Laravel
;
class
Input
extends
Facade
{
public
static
$resolve
=
'input'
;
}
class
Input_Engine
{
class
Input
{
/**
* The applicable input for the request.
...
...
laravel/lang.php
View file @
c200f3eb
<?php
namespace
Laravel
;
class
Lang
extends
Facade
{
public
static
$resolve
=
'lang'
;
}
class
Lang_Engine
{
class
Lang
{
/**
* All of the loaded language lines.
...
...
laravel/laravel.php
View file @
c200f3eb
...
...
@@ -47,7 +47,9 @@ date_default_timezone_set($application->config->get('application.timezone'));
// --------------------------------------------------------------
if
(
$application
->
config
->
get
(
'session.driver'
)
!==
''
)
{
$application
->
session
->
start
(
$application
->
input
->
cookies
->
get
(
'laravel_session'
),
$application
->
config
->
get
(
'session.lifetime'
));
$cookie
=
$application
->
input
->
cookies
->
get
(
'laravel_session'
);
$application
->
session
->
start
(
$cookie
,
$application
->
config
->
get
(
'session.lifetime'
));
}
// --------------------------------------------------------------
...
...
laravel/loader.php
View file @
c200f3eb
...
...
@@ -40,8 +40,6 @@ class Loader {
{
$file
=
strtolower
(
str_replace
(
'\\'
,
'/'
,
$class
));
if
(
strpos
(
$file
,
'laravel'
)
!==
false
)
$file
=
str_replace
(
'_facade'
,
''
,
$file
);
if
(
array_key_exists
(
$class
,
$this
->
aliases
))
{
return
class_alias
(
$this
->
aliases
[
$class
],
$class
);
...
...
laravel/package.php
View file @
c200f3eb
<?php
namespace
Laravel
;
class
Package
extends
Facade
{
public
static
$resolve
=
'package'
;
}
class
Package_Engine
{
class
Package
{
/**
* All of the loaded packages.
...
...
laravel/redirect.php
View file @
c200f3eb
<?php
namespace
Laravel
;
class
Redirect
extends
Facade
{
public
static
$resolve
=
'redirect'
;
}
class
Redirect_Engine
extends
Response
{
class
Redirect
extends
Response
{
/**
* The URL generator instance.
...
...
laravel/request.php
View file @
c200f3eb
<?php
namespace
Laravel
;
class
Request
extends
Facade
{
public
static
$resolve
=
'request'
;
}
class
Request_Engine
{
class
Request
{
/**
* The $_SERVER array for the request.
...
...
laravel/routing/router.php
View file @
c200f3eb
<?php
namespace
Laravel\Routing
;
use
Laravel\Request
_Engine
;
use
Laravel\Request
;
class
Router
{
...
...
@@ -14,7 +14,7 @@ class Router {
/**
* The current request instance.
*
* @var Request
_Engine
* @var Request
*/
protected
$request
;
...
...
@@ -35,11 +35,11 @@ class Router {
/**
* Create a new router for a request method and URI.
*
* @param Request
_Engine
$request
* @param array
$routes
* @param Request $request
* @param array $routes
* @return void
*/
public
function
__construct
(
Request
_Engine
$request
,
$routes
,
$controller_path
)
public
function
__construct
(
Request
$request
,
$routes
,
$controller_path
)
{
$this
->
routes
=
$routes
;
$this
->
request
=
$request
;
...
...
laravel/session/file.php
View file @
c200f3eb
...
...
@@ -5,7 +5,7 @@ class File extends Driver implements Sweeper {
/**
* The file engine instance.
*
* @var Laravel\File
_Engine
* @var Laravel\File
*/
private
$file
;
...
...
@@ -19,11 +19,11 @@ class File extends Driver implements Sweeper {
/**
* Create a new File session driver instance.
*
* @param Laravel\File
_Engine
$file
* @param string
$path
* @param Laravel\File $file
* @param string $path
* @return void
*/
public
function
__construct
(
\Laravel\File
_Engine
$file
,
$path
)
public
function
__construct
(
\Laravel\File
$file
,
$path
)
{
$this
->
file
=
$file
;
$this
->
path
=
$path
;
...
...
laravel/url.php
View file @
c200f3eb
<?php
namespace
Laravel
;
class
URL
extends
Facade
{
public
static
$resolve
=
'url'
;
}
class
URL_Engine
{
class
URL
{
/**
* Create a new URL writer instance.
...
...
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