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
91518db6
Commit
91518db6
authored
Feb 03, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dropped submodule support. added upgrade command for bundles.
parent
ea42fe75
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
18 deletions
+34
-18
bundles.php
bundles/bundles.php
+1
-1
bundler.php
laravel/cli/tasks/bundle/bundler.php
+32
-14
provider.php
laravel/cli/tasks/bundle/providers/provider.php
+1
-3
No files found.
bundles/bundles.php
View file @
91518db6
...
...
@@ -33,4 +33,4 @@
|
*/
return
array
();
\ No newline at end of file
return
array
(
'gravitas'
);
\ No newline at end of file
laravel/cli/tasks/bundle/bundler.php
View file @
91518db6
<?php
namespace
Laravel\CLI\Tasks\Bundle
;
defined
(
'DS'
)
or
die
(
'No direct script access.'
);
use
Laravel\IoC
;
use
Laravel\File
;
use
Laravel\Bundle
;
use
Laravel\CLI\Tasks\Task
;
...
...
@@ -34,7 +35,7 @@ class Bundler extends Task {
{
foreach
(
$this
->
get
(
$bundles
)
as
$bundle
)
{
if
(
is_dir
(
path
(
'bundle'
)
.
$bundle
[
'name'
]))
if
(
Bundle
::
exists
(
$bundle
[
'name'
]))
{
echo
"Bundle
{
$bundle
[
'name'
]
}
is already installed."
;
...
...
@@ -48,7 +49,9 @@ class Bundler extends Task {
// Each bundle provider implements the Provider interface and
// is repsonsible for retrieving the bundle source from its
// hosting party and installing it into the application.
$this
->
download
(
$bundle
,
$this
->
path
(
$bundle
));
$path
=
path
(
'bundle'
)
.
$this
->
path
(
$bundle
);
$this
->
download
(
$bundle
,
$path
);
echo
"Bundle [
{
$bundle
[
'name'
]
}
] has been installed!"
.
PHP_EOL
;
}
...
...
@@ -64,25 +67,38 @@ class Bundler extends Task {
{
foreach
(
$bundles
as
$name
)
{
$bundle
=
Bundle
::
get
(
$name
);
if
(
is_nulL
(
$bundle
))
if
(
!
Bundle
::
exists
(
$name
))
{
throw
new
\Exception
(
"Bundle [
{
$name
}
] is not installed!"
);
echo
"Bundle [
{
$name
}
] is not installed!"
;
continue
;
}
$data
=
$this
->
retrieve
(
$bundle
);
// First we want to retrieve the information for the bundle,
// such as where it is currently installed. This will let
// us upgrade the bundle into the same path in which it
// is already installed.
$bundle
=
Bundle
::
get
(
$name
);
// If the bundle exists, we will grab the data about the
// bundle from the API so we can make the right bundle
// provider for the bundle, since we have no way of
// knowing which provider was used to install.
$response
=
$this
->
retrieve
(
$name
);
if
(
$response
[
'status'
]
==
'not-found'
)
{
continue
;
}
// Once we have the bundle information from the API,
// we'll simply recursively delete the bundle and
// then re-download it using the provider.
File
::
rmdir
(
$bundle
->
location
);
$this
->
download
(
$
bundle
,
$bundle
->
location
);
$this
->
download
(
$
response
[
'bundle'
]
,
$bundle
->
location
);
echo
"Bundle [
{
$
bundle
[
'name'
]
}
] has been upgraded!"
.
PHP_EOL
;
echo
"Bundle [
{
$
name
}
] has been upgraded!"
.
PHP_EOL
;
}
}
...
...
@@ -94,9 +110,9 @@ class Bundler extends Task {
*/
public
function
publish
(
$bundles
)
{
// If no bundles are passed to the command, we'll just gather
all
//
of the installed bundle names and publish the assets for each
// of the bundles to the public directory.
// If no bundles are passed to the command, we'll just gather
//
all of the installed bundle names and publish the assets
//
for each
of the bundles to the public directory.
if
(
count
(
$bundles
)
==
0
)
$bundles
=
Bundle
::
names
();
$publisher
=
IoC
::
resolve
(
'bundle.publisher'
);
...
...
@@ -138,7 +154,9 @@ class Bundler extends Task {
$responses
[]
=
$bundle
;
$responses
=
array_merge
(
$responses
,
$this
->
get
(
$bundle
[
'dependencies'
]));
$dependencies
=
$this
->
get
(
$bundle
[
'dependencies'
]);
$responses
=
array_merge
(
$responses
,
$dependencies
);
}
return
$responses
;
...
...
@@ -151,7 +169,7 @@ class Bundler extends Task {
* @param string $path
* @return void
*/
protected
function
download
(
$bundle
m
,
$path
)
protected
function
download
(
$bundle
,
$path
)
{
$provider
=
"bundle.provider:
{
$bundle
[
'provider'
]
}
"
;
...
...
laravel/cli/tasks/bundle/providers/provider.php
View file @
91518db6
...
...
@@ -49,9 +49,7 @@ abstract class Provider {
// Once we have the latest modified directory, we should be
// able to move its contents over into the bundles folder
// so the bundle will be usable by the develoepr.
$path
=
$this
->
path
(
$bundle
);
File
::
mvdir
(
$latest
,
path
(
'bundle'
)
.
$path
);
File
::
mvdir
(
$latest
,
$path
);
@
unlink
(
$target
);
}
...
...
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