Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
7f2ebbc0
Commit
7f2ebbc0
authored
8 years ago
by
Alex ORLUC
Browse files
Options
Downloads
Patches
Plain Diff
FIX #4490 copy template file in docservers
parent
f36ec5b9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/trunk/install/class/Class_Install.php
+37
-1
37 additions, 1 deletion
core/trunk/install/class/Class_Install.php
with
37 additions
and
1 deletion
core/trunk/install/class/Class_Install.php
+
37
−
1
View file @
7f2ebbc0
...
...
@@ -1105,7 +1105,7 @@ class Install extends functions
return
false
;
exit
;
}
$write
=
fwrite
(
$fp
,
$res
);
if
(
!
$write
)
{
return
false
;
...
...
@@ -1782,6 +1782,13 @@ class Install extends functions
return
false
;
}
}
//copy template files
$dir2copy
=
'install'
.
DIRECTORY_SEPARATOR
.
'templates'
.
DIRECTORY_SEPARATOR
.
'0000'
.
DIRECTORY_SEPARATOR
;
$dir_paste
=
$docserverPath
.
DIRECTORY_SEPARATOR
.
'templates'
.
DIRECTORY_SEPARATOR
.
'0000'
.
DIRECTORY_SEPARATOR
;
copy_dir
(
$dir2copy
,
$dir_paste
);
return
true
;
}
...
...
@@ -1814,3 +1821,32 @@ class Install extends functions
$db
->
query
(
$query
);
}
}
function
copy_dir
(
$dir2copy
,
$dir_paste
)
{
// On vérifie si $dir2copy est un dossier
if
(
is_dir
(
$dir2copy
))
{
// Si oui, on l'ouvre
if
(
$dh
=
opendir
(
$dir2copy
))
{
// On liste les dossiers et fichiers de $dir2copy
while
((
$file
=
readdir
(
$dh
))
!==
false
)
{
// Si le dossier dans lequel on veut coller n'existe pas, on le cree
if
(
!
is_dir
(
$dir_paste
))
mkdir
(
$dir_paste
,
0777
);
// S'il s'agit d'un dossier, on relance la fonction recursive
if
(
is_dir
(
$dir2copy
.
$file
)
&&
$file
!=
'..'
&&
$file
!=
'.'
)
copy_dir
(
$dir2copy
.
$file
.
'/'
,
$dir_paste
.
$file
.
'/'
);
// S'il sagit d'un fichier, on le copue simplement
elseif
(
$file
!=
'..'
&&
$file
!=
'.'
)
copy
(
$dir2copy
.
$file
,
$dir_paste
.
$file
);
}
// On ferme $dir2copy
closedir
(
$dh
);
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment