FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
php-git/tests/init.php at develop · libgit2/php-git · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
libgit2
/
php-git
Public
Notifications
You must be signed in to change notification settings
Fork
76
Star
566
Code
Issues
31
Pull requests
5
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
php-git
/
tests
/
init.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
52 lines (39 loc) · 1.01 KB
Breadcrumbs
php-git
/
tests
/
init.php
Copy path
File metadata and controls
52 lines (39 loc) · 1.01 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
function
recurse_copy
(
$
src
,
$
dst
) {
$
dir
=
opendir
(
$
src
);
@
mkdir
(
$
dst
);
while
(
false
!== (
$
file
=
readdir
(
$
dir
)) ) {
if
((
$
file
!=
'
.
'
) && (
$
file
!=
'
..
'
)) {
if
(
is_dir
(
$
src
.
'
/
'
.
$
file
) ) {
recurse_copy
(
$
src
.
'
/
'
.
$
file
,
$
dst
.
'
/
'
.
$
file
);
}
else
{
copy
(
$
src
.
'
/
'
.
$
file
,
$
dst
.
'
/
'
.
$
file
);
}
}
}
closedir
(
$
dir
);
}
function
init_repo
(
$
reponame
,
$
target
,
$
bare
=
false
)
{
$
rootPath
=
dirname
(
__DIR__
);
$
libgitPath
=
$
rootPath
.
'
/libgit2
'
;
$
testRepoPath
=
$
libgitPath
.
'
/tests/resources
'
;
if
(!
file_exists
(
$
testRepoPath
))
{
throw
new
Exception
(
'
test repository assets not found at
'
.
$
testRepoPath
);
}
$
repoPath
=
$
testRepoPath
.
'
/
'
.
$
reponame
;
if
(!
file_exists
(
$
repoPath
))
{
throw
new
Exception
(
'
test repository
'
.
$
reponame
.
'
assets not found
'
);
}
@
mkdir
(
$
target
);
recurse_copy
(
$
repoPath
,
$
target
.
'
/
'
.
$
reponame
);
if
(!
$
bare
)
{
$
oldPath
=
$
target
.
'
/
'
.
$
reponame
.
'
/.gitted
'
;
$
newPath
=
$
target
.
'
/
'
.
$
reponame
.
'
/.git
'
;
rename
(
$
oldPath
,
$
newPath
);
}
}
Back
|
FazBrowse Home
|
New Git URL