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
62571b39
Commit
62571b39
authored
Jan 24, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some problems on the CLI and allow specification of environment and database.
parent
ec2fc6dd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
4 deletions
+44
-4
artisan.php
laravel/cli/artisan.php
+39
-0
dependencies.php
laravel/cli/dependencies.php
+4
-4
database.php
laravel/cli/tasks/migrate/database.php
+1
-0
No files found.
laravel/cli/artisan.php
View file @
62571b39
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
use
Laravel\IoC
;
use
Laravel\IoC
;
use
Laravel\Bundle
;
use
Laravel\Bundle
;
use
Laravel\Config
;
use
Laravel\Database
as
DB
;
use
Laravel\Database
as
DB
;
/**
/**
...
@@ -11,6 +12,44 @@ use Laravel\Database as DB;
...
@@ -11,6 +12,44 @@ use Laravel\Database as DB;
*/
*/
Bundle
::
start
(
DEFAULT_BUNDLE
);
Bundle
::
start
(
DEFAULT_BUNDLE
);
/**
* Set the CLI options on the $_SERVER global array so we can easily
* retrieve them from the various parts of the CLI code. We can use
* the Request class to access them conveniently.
*/
$_SERVER
[
'cli'
]
=
array
();
foreach
(
$_SERVER
[
'argv'
]
as
$key
=>
$value
)
{
if
(
starts_with
(
$value
,
'--'
))
{
$option
=
array_get
(
$_SERVER
[
'argv'
],
$key
+
1
,
true
);
array_set
(
$_SERVER
,
'cli.'
.
substr
(
$value
,
2
),
$option
);
}
}
/**
* The Laravel environment may be specified on the CLI using the "env"
* option, allowing the developer to easily use local configuration
* files from the CLI since the environment is usually controlled
* by server environmenet variables.
*/
if
(
isset
(
$_SERVER
[
'cli'
][
'env'
]))
{
$_SERVER
[
'LARAVEL_ENV'
]
=
$_SERVER
[
'cli'
][
'env'
];
}
/**
* The default database connection may be set by specifying a value
* for the "database" CLI option. This allows migrations to be run
* conveniently for a test or staging database.
*/
if
(
isset
(
$_SERVER
[
'cli'
][
'db'
]))
{
Config
::
set
(
'database.default'
,
$_SERVER
[
'cli'
][
'db'
]);
}
/**
/**
* 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
...
...
laravel/cli/dependencies.php
View file @
62571b39
<?php
<?php
namespace
Laravel\CLI
;
use
Laravel\IoC
;
/**
/**
* The migrate task is responsible for running database migrations
* The migrate task is responsible for running database migrations
...
@@ -32,7 +32,7 @@ IoC::register('task: bundle', function()
...
@@ -32,7 +32,7 @@ IoC::register('task: bundle', function()
*/
*/
IoC
::
singleton
(
'bundle.repository'
,
function
()
IoC
::
singleton
(
'bundle.repository'
,
function
()
{
{
return
new
Repository
;
return
new
Tasks\Bundle\
Repository
;
});
});
/**
/**
...
@@ -42,7 +42,7 @@ IoC::singleton('bundle.repository', function()
...
@@ -42,7 +42,7 @@ IoC::singleton('bundle.repository', function()
*/
*/
IoC
::
singleton
(
'bundle.publisher'
,
function
()
IoC
::
singleton
(
'bundle.publisher'
,
function
()
{
{
return
new
Publisher
;
return
new
Tasks\Bundle\
Publisher
;
});
});
/**
/**
...
@@ -53,5 +53,5 @@ IoC::singleton('bundle.publisher', function()
...
@@ -53,5 +53,5 @@ IoC::singleton('bundle.publisher', function()
*/
*/
IoC
::
singleton
(
'bundle.provider: github'
,
function
()
IoC
::
singleton
(
'bundle.provider: github'
,
function
()
{
{
return
new
Providers\Github
;
return
new
Tasks\Bundle\
Providers\Github
;
});
});
\ No newline at end of file
laravel/cli/tasks/migrate/database.php
View file @
62571b39
<?php
namespace
Laravel\CLI\Tasks\Migrate
;
<?php
namespace
Laravel\CLI\Tasks\Migrate
;
use
Laravel\Request
;
use
Laravel\Database
as
DB
;
use
Laravel\Database
as
DB
;
class
Database
{
class
Database
{
...
...
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