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
a92ab1ca
Commit
a92ab1ca
authored
Apr 20, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing bugs.
parent
98ea9ac4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
24 deletions
+43
-24
laravel/cache/drivers/driver.php
+14
-2
laravel/cli/artisan.php
+3
-12
laravel/core.php
+1
-9
laravel/database/schema.php
+4
-1
laravel/helpers.php
+21
-0
No files found.
laravel/cache/drivers/driver.php
View file @
a92ab1ca
...
@@ -69,16 +69,28 @@ abstract class Driver {
...
@@ -69,16 +69,28 @@ abstract class Driver {
* @param int $minutes
* @param int $minutes
* @return mixed
* @return mixed
*/
*/
public
function
remember
(
$key
,
$default
,
$minutes
)
public
function
remember
(
$key
,
$default
,
$minutes
,
$function
=
'put'
)
{
{
if
(
!
is_null
(
$item
=
$this
->
get
(
$key
,
null
)))
return
$item
;
if
(
!
is_null
(
$item
=
$this
->
get
(
$key
,
null
)))
return
$item
;
$this
->
put
(
$key
,
$default
=
value
(
$default
),
$minutes
);
$this
->
$function
(
$key
,
$default
=
value
(
$default
),
$minutes
);
return
$default
;
return
$default
;
}
}
/**
/**
* Get an item from the cache, or cache the default value forever.
*
* @param string $key
* @param mixed $default
* @return mixed
*/
public
function
sear
(
$key
,
$default
)
{
return
$this
->
remember
(
$key
,
$default
,
null
,
'forever'
);
}
/**
* Delete an item from the cache.
* Delete an item from the cache.
*
*
* @param string $key
* @param string $key
...
...
laravel/cli/artisan.php
View file @
a92ab1ca
...
@@ -16,22 +16,13 @@ Bundle::start(DEFAULT_BUNDLE);
...
@@ -16,22 +16,13 @@ Bundle::start(DEFAULT_BUNDLE);
* for the "database" CLI option. This allows migrations to be run
* for the "database" CLI option. This allows migrations to be run
* conveniently for a test or staging database.
* conveniently for a test or staging database.
*/
*/
if
(
isset
(
$_SERVER
[
'CLI'
][
'DB'
]))
if
(
!
is_null
(
$database
=
get_cli_option
(
'db'
)))
{
{
Config
::
set
(
'database.default'
,
$
_SERVER
[
'CLI'
][
'DB'
]
);
Config
::
set
(
'database.default'
,
$
database
);
}
}
/**
/**
* Overwrite the HttpFoundation request since we have set some of
* the server variables since it was created. This allows us to
* set the default database for the CLI task.
*/
use
Symfony\Component\HttpFoundation\LaravelRequest
as
RequestFoundation
;
Request
::
$foundation
=
RequestFoundation
::
createFromGlobals
();
/**
* We will register all of the Laravel provided tasks inside the IoC
* We will register all of the Laravel provided tasks inside the IoC
* container so they can be resolved by the task class. This allows
* container so they can be resolved by the task class. This allows
* us to seamlessly add tasks to the CLI so that the Task class
* us to seamlessly add tasks to the CLI so that the Task class
...
...
laravel/core.php
View file @
a92ab1ca
...
@@ -156,15 +156,7 @@ Request::$foundation = RequestFoundation::createFromGlobals();
...
@@ -156,15 +156,7 @@ Request::$foundation = RequestFoundation::createFromGlobals();
if
(
Request
::
cli
())
if
(
Request
::
cli
())
{
{
foreach
(
Request
::
foundation
()
->
server
->
get
(
'argv'
)
as
$argument
)
$environment
=
get_cli_option
(
'env'
);
{
if
(
starts_with
(
$argument
,
'--env='
))
{
$environment
=
substr
(
$argument
,
6
);
break
;
}
}
}
}
else
else
{
{
...
...
laravel/database/schema.php
View file @
a92ab1ca
...
@@ -44,12 +44,15 @@ class Schema {
...
@@ -44,12 +44,15 @@ class Schema {
* Drop a database table from the schema.
* Drop a database table from the schema.
*
*
* @param string $table
* @param string $table
* @param string $connection
* @return void
* @return void
*/
*/
public
static
function
drop
(
$table
)
public
static
function
drop
(
$table
,
$connection
=
null
)
{
{
$table
=
new
Schema\Table
(
$table
);
$table
=
new
Schema\Table
(
$table
);
$table
->
on
(
$connection
);
// To indicate that the table needs to be dropped, we will run the
// To indicate that the table needs to be dropped, we will run the
// "drop" command on the table instance and pass the instance to
// "drop" command on the table instance and pass the instance to
// the execute method as calling a Closure isn't needed.
// the execute method as calling a Closure isn't needed.
...
...
laravel/helpers.php
View file @
a92ab1ca
...
@@ -504,4 +504,24 @@ function render_each($partial, array $data, $iterator, $empty = 'raw|')
...
@@ -504,4 +504,24 @@ function render_each($partial, array $data, $iterator, $empty = 'raw|')
function
yield
(
$section
)
function
yield
(
$section
)
{
{
return
Laravel\Section
::
yield
(
$section
);
return
Laravel\Section
::
yield
(
$section
);
}
/**
* Get a CLI option from the argv $_SERVER variable.
*
* @param string $option
* @param mixed $default
* @return string
*/
function
get_cli_option
(
$option
,
$default
=
null
)
{
foreach
(
Laravel\Request
::
foundation
()
->
server
->
get
(
'argv'
)
as
$argument
)
{
if
(
starts_with
(
$argument
,
"--
{
$option
}
="
))
{
return
substr
(
$argument
,
strlen
(
$option
)
+
3
);
}
}
return
value
(
$default
);
}
}
\ No newline at end of file
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