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
70b6cc59
Commit
70b6cc59
authored
Sep 07, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring.
parent
7eef380d
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
56 additions
and
45 deletions
+56
-45
composers.php
application/composers.php
+1
-1
arr.php
laravel/arr.php
+3
-7
asset.php
laravel/asset.php
+36
-10
config.php
laravel/config.php
+1
-11
container.php
laravel/config/container.php
+6
-0
connection.php
laravel/database/connection.php
+1
-1
postgres.php
laravel/database/query/postgres.php
+0
-5
facades.php
laravel/facades.php
+1
-0
lang.php
laravel/lang.php
+1
-4
route.php
laravel/routing/route.php
+5
-5
view.php
laravel/view.php
+1
-1
No files found.
application/composers.php
View file @
70b6cc59
...
...
@@ -39,7 +39,7 @@ return array(
|
*/
'
global
'
=>
function
(
$view
,
$laravel
)
'
shared
'
=>
function
(
$view
,
$laravel
)
{
//
},
...
...
laravel/arr.php
View file @
70b6cc59
...
...
@@ -7,7 +7,7 @@ class Arr {
*
* If the specified key is null, the entire array will be returned. The array may
* also be accessed using JavaScript "dot" style notation. Retrieving items nested
* in multiple arrays is
also
supported.
* in multiple arrays is supported.
*
* @param array $array
* @param string $key
...
...
@@ -35,12 +35,8 @@ class Arr {
* Set an array item to a given value.
*
* This method is primarly helpful for setting the value in an array with
* a variable depth, such as configuration arrays.
*
* If the specified item doesn't exist, it will be created. If the item's
* parents do no exist, they will also be created as arrays.
*
* Like the Arr::get method, JavaScript "dot" syntax is supported.
* a variable depth, such as configuration arrays. Like the Arr::get
* method, JavaScript "dot" syntax is supported.
*
* @param array $array
* @param string $key
...
...
laravel/asset.php
View file @
70b6cc59
...
...
@@ -9,7 +9,25 @@ class Asset {
*
* @var array
*/
public
static
$containers
=
array
();
public
$containers
=
array
();
/**
* The HTML writer instance.
*
* @var HTML
*/
protected
$html
;
/**
* Create a new asset manager instance.
*
* @param HTML $html
* @return void
*/
public
function
__construct
(
HTML
$html
)
{
$this
->
html
=
$html
;
}
/**
* Get an asset container instance.
...
...
@@ -21,14 +39,14 @@ class Asset {
* @param string $container
* @return Asset_Container
*/
public
static
function
container
(
$container
=
'default'
)
public
function
container
(
$container
=
'default'
)
{
if
(
!
isset
(
static
::
$
containers
[
$container
]))
if
(
!
isset
(
$this
->
containers
[
$container
]))
{
static
::
$containers
[
$container
]
=
new
Asset_Container
(
$container
);
$this
->
containers
[
$container
]
=
new
Asset_Container
(
$container
,
$this
->
html
);
}
return
static
::
$
containers
[
$container
];
return
$this
->
containers
[
$container
];
}
/**
...
...
@@ -37,9 +55,9 @@ class Asset {
* This provides a convenient API, allowing the develop to skip the "container"
* method when using the default container.
*/
public
static
function
__callStatic
(
$method
,
$parameters
)
public
function
__call
(
$method
,
$parameters
)
{
return
call_user_func_array
(
array
(
static
::
container
(),
$method
),
$parameters
);
return
call_user_func_array
(
array
(
$this
->
container
(),
$method
),
$parameters
);
}
}
...
...
@@ -62,16 +80,24 @@ class Asset_Container {
*/
public
$assets
=
array
();
/**
* The HTML writer instance.
*
* @var HTML
*/
protected
$html
;
/**
* Create a new asset container instance.
*
* @param string $name
* @param
File $file
* @param
HTML $html
* @return void
*/
public
function
__construct
(
$name
)
public
function
__construct
(
$name
,
HTML
$html
)
{
$this
->
name
=
$name
;
$this
->
html
=
$html
;
}
/**
...
...
@@ -225,7 +251,7 @@ class Asset_Container {
$asset
=
$this
->
assets
[
$group
][
$name
];
return
HTML
::
$group
(
$asset
[
'source'
],
$asset
[
'attributes'
]);
return
$this
->
html
->
$group
(
$asset
[
'source'
],
$asset
[
'attributes'
]);
}
/**
...
...
laravel/config.php
View file @
70b6cc59
...
...
@@ -43,10 +43,6 @@ class Config {
/**
* Get a configuration item.
*
* Configuration items are retrieved using "dot" notation. So, asking for the
* "application.timezone" configuration item would return the "timezone" option
* from the "application" configuration file.
*
* If the name of a configuration file is passed without specifying an item, the
* entire configuration array will be returned.
*
...
...
@@ -71,9 +67,6 @@ class Config {
/**
* Set a configuration item.
*
* Like the get method, "dot" notation is used to set items, and setting items
* at any depth in the configuration array is supported.
*
* If a specific configuration item is not specified, the entire configuration
* array will be replaced with the given value.
*
...
...
@@ -124,10 +117,7 @@ class Config {
$config
=
(
file_exists
(
$path
=
$directory
.
$file
.
EXT
))
?
array_merge
(
$config
,
require
$path
)
:
$config
;
}
if
(
count
(
$config
)
>
0
)
{
$this
->
items
[
$file
]
=
$config
;
}
if
(
count
(
$config
)
>
0
)
$this
->
items
[
$file
]
=
$config
;
return
isset
(
$this
->
items
[
$file
]);
}
...
...
laravel/config/container.php
View file @
70b6cc59
...
...
@@ -8,6 +8,12 @@ return array(
|--------------------------------------------------------------------------
*/
'laravel.asset'
=>
array
(
'singleton'
=>
true
,
'resolver'
=>
function
(
$container
)
{
return
new
Asset
(
$container
->
resolve
(
'laravel.html'
));
}),
'laravel.auth'
=>
array
(
'resolver'
=>
function
(
$container
)
{
return
new
Security\Authenticator
(
$container
->
resolve
(
'laravel.session'
),
$container
->
resolve
(
'laravel.hasher'
));
...
...
laravel/database/connection.php
View file @
70b6cc59
...
...
@@ -87,7 +87,7 @@ class Connection {
{
$result
=
(
array
)
$this
->
first
(
$sql
,
$bindings
);
return
(
strpos
(
strtolower
(
$sql
),
'select count'
)
===
0
)
?
(
int
)
reset
(
$result
)
:
(
float
)
reset
(
$result
);
return
(
strpos
(
strtolower
(
trim
(
$sql
)
),
'select count'
)
===
0
)
?
(
int
)
reset
(
$result
)
:
(
float
)
reset
(
$result
);
}
/**
...
...
laravel/database/query/postgres.php
View file @
70b6cc59
...
...
@@ -7,11 +7,6 @@ class Postgres extends Query {
/**
* Insert an array of values into the database table and return the value of the ID column.
*
* <code>
* // Insert into the "users" table and get the auto-incrementing ID
* $id = DB::table('users')->insert_get_id(array('email' => 'example@gmail.com'));
* </code>
*
* @param array $values
* @return int
*/
...
...
laravel/facades.php
View file @
70b6cc59
...
...
@@ -20,6 +20,7 @@ abstract class Facade {
}
class
Asset
extends
Facade
{
public
static
$resolve
=
'asset'
;
}
class
Auth
extends
Facade
{
public
static
$resolve
=
'auth'
;
}
class
Cache
extends
Facade
{
public
static
$resolve
=
'cache'
;
}
class
Config
extends
Facade
{
public
static
$resolve
=
'config'
;
}
...
...
laravel/lang.php
View file @
70b6cc59
...
...
@@ -183,10 +183,7 @@ class Lang {
}
}
if
(
count
(
$language
)
>
0
)
{
static
::
$lines
[
$this
->
language
.
$file
]
=
$language
;
}
if
(
count
(
$language
)
>
0
)
static
::
$lines
[
$this
->
language
.
$file
]
=
$language
;
return
isset
(
static
::
$lines
[
$this
->
language
.
$file
]);
}
...
...
laravel/routing/route.php
View file @
70b6cc59
...
...
@@ -46,7 +46,7 @@ class Route {
$this
->
key
=
$key
;
$this
->
callback
=
$callback
;
$this
->
parameters
=
$parameters
;
$this
->
uris
=
$this
->
parse
(
$key
);
$this
->
uris
=
$this
->
parse
_uris
(
$key
);
}
/**
...
...
@@ -120,13 +120,13 @@ class Route {
* @param string $key
* @return array
*/
protected
function
parse
(
$key
)
protected
function
parse
_uris
(
$key
)
{
if
(
strpos
(
$key
,
', '
)
===
false
)
return
array
(
$this
->
extract
(
$key
));
if
(
strpos
(
$key
,
', '
)
===
false
)
return
array
(
$this
->
extract
_uri
(
$key
));
foreach
(
explode
(
', '
,
$key
)
as
$segment
)
{
$uris
[]
=
$this
->
extract
(
$segment
);
$uris
[]
=
$this
->
extract
_uri
(
$segment
);
}
return
$uris
;
...
...
@@ -142,7 +142,7 @@ class Route {
* @param string $segment
* @return string
*/
protected
function
extract
(
$segment
)
protected
function
extract
_uri
(
$segment
)
{
$segment
=
substr
(
$segment
,
strpos
(
$segment
,
' '
)
+
1
);
...
...
laravel/view.php
View file @
70b6cc59
...
...
@@ -144,7 +144,7 @@ class View_Composer {
*/
public
function
compose
(
View
$view
)
{
if
(
isset
(
$this
->
composers
[
'
global'
]))
call_user_func
(
$this
->
composers
[
'global
'
],
$view
,
$this
->
container
);
if
(
isset
(
$this
->
composers
[
'
shared'
]))
call_user_func
(
$this
->
composers
[
'shared
'
],
$view
,
$this
->
container
);
if
(
isset
(
$this
->
composers
[
$view
->
view
]))
{
...
...
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