Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
0826f6cb
Commit
0826f6cb
authored
11 years ago
by
Andreas Gohr
Browse files
Options
Downloads
Patches
Plain Diff
now use new core funtion to recursively delete
parent
9a6e0ba0
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
lib/plugins/extension/helper/extension.php
+4
-28
4 additions, 28 deletions
lib/plugins/extension/helper/extension.php
with
4 additions
and
28 deletions
lib/plugins/extension/helper/extension.php
+
4
−
28
View file @
0826f6cb
...
...
@@ -33,7 +33,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin {
*/
public
function
__destruct
()
{
foreach
(
$this
->
temporary
as
$dir
){
$this
->
dir_delete
(
$dir
);
io_rmdir
(
$dir
,
true
);
}
}
...
...
@@ -640,7 +640,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin {
*/
public
function
uninstall
()
{
$this
->
purgeCache
();
return
$this
->
dir_delete
(
$this
->
getInstallDir
());
return
io_rmdir
(
$this
->
getInstallDir
()
,
true
);
}
/**
...
...
@@ -768,30 +768,6 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin {
io_saveFile
(
$managerpath
,
$data
);
}
/**
* delete, with recursive sub-directory support
*
* @param string $path The path that shall be deleted
* @return bool If the directory has been successfully deleted
*/
protected
function
dir_delete
(
$path
)
{
if
(
!
is_string
(
$path
)
||
$path
==
""
)
return
false
;
if
(
is_dir
(
$path
)
&&
!
is_link
(
$path
))
{
if
(
!
$dh
=
@
opendir
(
$path
))
return
false
;
while
(
$f
=
readdir
(
$dh
))
{
if
(
$f
==
'..'
||
$f
==
'.'
)
continue
;
$this
->
dir_delete
(
"
$path
/
$f
"
);
}
closedir
(
$dh
);
return
@
rmdir
(
$path
);
}
else
{
return
@
unlink
(
$path
);
}
}
/**
* Returns a temporary directory
*
...
...
@@ -828,7 +804,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin {
// download
if
(
!
$file
=
io_download
(
$url
,
$tmp
.
'/'
,
true
,
$file
,
0
))
{
$this
->
dir_delete
(
$tmp
);
io_rmdir
(
$tmp
,
true
);
throw
new
Exception
(
sprintf
(
$this
->
getLang
(
'error_download'
),
'<bdi>'
.
hsc
(
$url
)
.
'</bdi>'
));
}
...
...
@@ -926,7 +902,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin {
}
// cleanup
if
(
$tmp
)
$this
->
dir_delete
(
$tmp
);
if
(
$tmp
)
io_rmdir
(
$tmp
,
true
);
return
$installed_extensions
;
}
...
...
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