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
14ab7c4e
Commit
14ab7c4e
authored
Feb 02, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweaking github provider.
parent
a6c083f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
13 deletions
+62
-13
laravel/cli/tasks/bundle/providers/github.php
+29
-11
laravel/cli/tasks/bundle/providers/provider.php
+33
-2
No files found.
laravel/cli/tasks/bundle/providers/github.php
View file @
14ab7c4e
<?php
namespace
Laravel\CLI\Tasks\Bundle\Providers
;
class
Github
implement
s
Provider
{
class
Github
extend
s
Provider
{
/**
* Install the given bundle into the application.
...
...
@@ -10,17 +10,35 @@ class Github implements Provider {
*/
public
function
install
(
$bundle
)
{
$repository
=
"git@github.com:
{
$bundle
[
'location'
]
}
.git"
;
$method
=
(
Request
::
server
(
'cli.zip'
))
?
'zipball'
:
'submodule'
;
$this
->
$method
(
$bundle
);
}
/**
* Install a Github hosted bundle from Zip.
*
* @param string $bundle
* @return void
*/
protected
function
zipball
(
$bundle
)
{
$zip
=
"https://github.com/
{
$bundle
[
'location'
]
}
/zipball/master"
;
$path
=
array_get
(
$bundle
,
'path'
,
$bundle
[
'name'
]);
parent
::
zipball
(
$zip
,
true
);
}
/**
* Install a Github hosted bundle using submodules.
*
* @param string $bundle
* @return void
*/
protected
function
submodule
(
$bundle
)
{
$repository
=
"git@github.com:
{
$bundle
[
'location'
]
}
.git"
;
// If the installation target directory doesn't exist, we will create
// it recursively so that we can properly add the Git submodule for
// the bundle when we install.
if
(
!
is_dir
(
$target
=
dirname
(
path
(
'bundle'
)
.
$path
)))
{
mkdir
(
$target
,
0777
,
true
);
}
$this
->
directory
(
$bundle
);
// We need to just extract the basename of the bundle path when
// adding the submodule. Of course, we can't add a submodule to
...
...
@@ -28,7 +46,7 @@ class Github implements Provider {
// the full bundle path.
$root
=
basename
(
path
(
'bundle'
))
.
'/'
;
passthru
(
'git submodule add '
.
$repository
.
' '
.
$root
.
$
path
);
passthru
(
'git submodule add '
.
$repository
.
' '
.
$root
.
$
this
->
path
(
$bundle
)
);
passthru
(
'git submodule update'
);
}
...
...
laravel/cli/tasks/bundle/providers/provider.php
View file @
14ab7c4e
<?php
namespace
Laravel\CLI\Tasks\Bundle\Providers
;
interface
Provider
{
abstract
class
Provider
{
/**
* Install the given bundle into the application.
...
...
@@ -8,6 +8,36 @@ interface Provider {
* @param string $bundle
* @return void
*/
public
function
install
(
$bundle
);
abstract
public
function
install
(
$bundle
);
/**
* Create the path to the bundle's dirname.
*
* @param array $bundle
* @return void
*/
protected
function
directory
(
$bundle
)
{
// If the installation target directory doesn't exist, we will create
// it recursively so that we can properly install the bundle to the
// correct path in the application.
$target
=
dirname
(
path
(
'bundle'
)
.
$this
->
path
(
$bundle
));
if
(
!
is_dir
(
$target
))
{
mkdir
(
$target
,
0777
,
true
);
}
}
/**
* Return the path for a given bundle.
*
* @param array $bundle
* @return string
*/
protected
function
path
(
$bundle
)
{
return
array_get
(
$bundle
,
'path'
,
$bundle
[
'name'
]);
}
}
\ 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