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
32989d39
Commit
32989d39
authored
Oct 22, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some small refactorings and cleanup.
parent
b71ecb43
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
42 additions
and
48 deletions
+42
-48
laravel/asset.php
+2
-0
laravel/blade.php
+4
-17
laravel/database/connection.php
+6
-4
laravel/paginator.php
+3
-1
laravel/routing/route.php
+21
-17
laravel/routing/router.php
+1
-0
laravel/session/manager.php
+3
-1
laravel/validation/validator.php
+0
-2
laravel/view.php
+2
-6
No files found.
laravel/asset.php
View file @
32989d39
...
...
@@ -261,6 +261,7 @@ class Asset_Container {
if
(
count
(
$assets
[
$asset
][
'dependencies'
])
==
0
)
{
$sorted
[
$asset
]
=
$value
;
unset
(
$assets
[
$asset
]);
}
else
...
...
@@ -270,6 +271,7 @@ class Asset_Container {
if
(
!
$this
->
dependency_is_valid
(
$asset
,
$dependency
,
$original
,
$assets
))
{
unset
(
$assets
[
$asset
][
'dependencies'
][
$key
]);
continue
;
}
...
...
laravel/blade.php
View file @
32989d39
...
...
@@ -3,29 +3,16 @@
class
Blade
{
/**
*
Rewrit
es the specified file containing Blade pseudo-code into valid PHP.
*
Compil
es the specified file containing Blade pseudo-code into valid PHP.
*
* @param string $path
* @return string
*/
public
static
function
pars
e
(
$path
)
public
static
function
compil
e
(
$path
)
{
return
static
::
parse_string
(
file_get_contents
(
$path
));
}
$value
=
file_get_contents
(
$path
);
/**
* Rewrites the specified string containing Blade pseudo-code into valid PHP.
*
* @param string $value
* @return string
*/
public
static
function
parse_string
(
$value
)
{
$value
=
static
::
echos
(
$value
);
$value
=
static
::
openings
(
$value
);
$value
=
static
::
closings
(
$value
);
return
$value
;
return
static
::
closings
(
static
::
openings
(
static
::
echos
(
$value
)));
}
/**
...
...
laravel/database/connection.php
View file @
32989d39
...
...
@@ -194,16 +194,18 @@ class Connection {
{
$result
=
$statement
->
execute
(
$bindings
);
if
(
strpos
(
strtoupper
(
$statement
->
queryString
),
'SELECT'
)
===
0
)
$sql
=
strtoupper
(
$statement
->
queryString
);
if
(
strpos
(
$sql
,
'SELECT'
)
===
0
)
{
return
$statement
->
fetchAll
(
PDO
::
FETCH_CLASS
,
'stdClass'
);
}
elseif
(
strpos
(
strtoupper
(
$statement
->
queryString
),
'INSERT
'
)
===
0
)
elseif
(
strpos
(
$sql
,
'UPDATE'
)
===
0
or
strpos
(
$sql
,
'DELETE
'
)
===
0
)
{
return
$
result
;
return
$
statement
->
rowCount
()
;
}
return
$
statement
->
rowCount
()
;
return
$
result
;
}
/**
...
...
laravel/paginator.php
View file @
32989d39
...
...
@@ -252,7 +252,9 @@ class Paginator {
// the current URI, this makes pretty good sense.
list
(
$uri
,
$secure
)
=
array
(
Request
::
uri
(),
Request
::
secure
());
return
HTML
::
link
(
$uri
.
$this
->
appendage
(
$element
,
$page
),
$text
,
array
(
'class'
=>
$class
),
$secure
);
$appendage
=
$this
->
appendage
(
$element
,
$page
);
return
HTML
::
link
(
$uri
.
$appendage
,
$text
,
array
(
'class'
=>
$class
),
$secure
);
}
}
...
...
laravel/routing/route.php
View file @
32989d39
...
...
@@ -101,34 +101,38 @@ class Route {
// a controller, the controller will only call its own filters.
$before
=
array_merge
(
array
(
'before'
),
$this
->
filters
(
'before'
));
if
(
!
is_null
(
$response
=
Filter
::
run
(
$before
,
array
(),
true
)))
{
return
$response
;
}
$response
=
Filter
::
run
(
$before
,
array
(),
true
);
if
(
!
is_null
(
$response
=
$this
->
response
()))
if
(
is_null
(
$response
)
and
!
is_null
(
$response
=
$this
->
response
()))
{
if
(
$response
instanceof
Delegate
)
{
$response
=
Controller
::
call
(
$response
->
destination
,
$this
->
parameters
);
}
}
// The after filter and the framework expects all responses to
// be instances of the Response class. If the route did not
// return an instsance of Response, we will make on now.
if
(
!
$response
instanceof
Response
)
{
$response
=
new
Response
(
$response
);
}
// If we still don't have a response, we're out of options and
// will use the 404 response. We will still let the response
// hit the after filter in case the developer is doing any
// logging or other work where every response is needed.
if
(
is_null
(
$response
))
{
$response
=
Response
::
error
(
'404'
);
}
$filters
=
array_merge
(
$this
->
filters
(
'after'
),
array
(
'after'
));
// The after filter and the framework expects all responses to
// be instances of the Response class. If the route did not
// return an instsance of Response, we will make on now.
if
(
!
$response
instanceof
Response
)
{
$response
=
new
Response
(
$response
);
}
Filter
::
run
(
$filters
,
array
(
$response
));
$filters
=
array_merge
(
$this
->
filters
(
'after'
),
array
(
'after'
));
return
$response
;
}
Filter
::
run
(
$filters
,
array
(
$response
));
return
Response
::
error
(
'404'
)
;
return
$response
;
}
/**
...
...
laravel/routing/router.php
View file @
32989d39
...
...
@@ -153,6 +153,7 @@ class Router {
foreach
(
explode
(
', '
,
$keys
)
as
$key
)
{
// Append the provided formats to the route as an optional regular expression.
// This should make the route look something like: "user(\.(json|xml|html))?"
if
(
!
is_null
(
$formats
=
$this
->
provides
(
$callback
)))
{
$key
.=
'(\.('
.
implode
(
'|'
,
$formats
)
.
'))?'
;
...
...
laravel/session/manager.php
View file @
32989d39
...
...
@@ -278,7 +278,9 @@ class Manager {
// driver must do its garbage collection manually. Alternatively, some
// drivers such as APC and Memcached are not required to manually
// clean up their sessions.
if
(
mt_rand
(
1
,
$config
[
'sweepage'
][
1
])
<=
$config
[
'sweepage'
][
0
]
and
static
::
$driver
instanceof
Drivers\Sweeper
)
$sweep
=
(
mt_rand
(
1
,
$config
[
'sweepage'
][
1
])
<=
$config
[
'sweepage'
][
0
]);
if
(
$sweep
and
static
::
$driver
instanceof
Drivers\Sweeper
)
{
static
::
$driver
->
sweep
(
time
()
-
(
$config
[
'lifetime'
]
*
60
));
}
...
...
laravel/validation/validator.php
View file @
32989d39
...
...
@@ -163,8 +163,6 @@ class Validator {
{
list
(
$rule
,
$parameters
)
=
$this
->
parse
(
$rule
);
// Verify that the attribute and rule combination is actually
// validatable before attempting to call the validation rule.
$value
=
Arr
::
get
(
$this
->
attributes
,
$attribute
);
if
(
!
$this
->
validatable
(
$rule
,
$attribute
,
$value
))
return
;
...
...
laravel/view.php
View file @
32989d39
...
...
@@ -123,8 +123,7 @@ class View {
/**
* Find the key for a view by name.
*
* The view's key can be used to create instances of the view through the typical
* methods available on the view factory.
* The view "key" is the string that should be passed into the "make" method.
*
* @param string $name
* @return string
...
...
@@ -133,9 +132,6 @@ class View {
{
if
(
is_null
(
static
::
$composers
))
static
::
$composers
=
require
APP_PATH
.
'composers'
.
EXT
;
// The view's name may specified in several different ways in the composers
// file. The composer may simple have a string value, which is the name.
// Or, it may an array value in which a "name" key exists.
foreach
(
static
::
$composers
as
$key
=>
$value
)
{
if
(
$name
===
$value
or
(
is_array
(
$value
)
and
$name
===
Arr
::
get
(
$value
,
'name'
)))
...
...
@@ -215,7 +211,7 @@ class View {
// without re-compiling.
if
((
file_exists
(
$compiled
)
and
filemtime
(
$this
->
path
)
>
filemtime
(
$compiled
))
or
!
file_exists
(
$compiled
))
{
file_put_contents
(
$compiled
,
Blade
::
pars
e
(
$this
->
path
));
file_put_contents
(
$compiled
,
Blade
::
compil
e
(
$this
->
path
));
}
return
$compiled
;
...
...
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