LEPTON CMS
7.2.0
feel free to keep it strictly simple...
Loading...
Searching...
No Matches
function.cleanup.php
Go to the documentation of this file.
1
<?php
2
18
// include secure.php to protect this file and the whole CMS!
19
if
(!defined(
"SEC_FILE"
)){define(
"SEC_FILE"
,
'/framework/secure.php'
);}
20
if
(defined(
'LEPTON_PATH'
)) {
21
include LEPTON_PATH.SEC_FILE;
22
}
else
{
23
$oneback =
"../"
;
24
$root
= $oneback;
25
$level
= 1;
26
while
((
$level
< 10) && (!file_exists(
$root
.SEC_FILE))) {
27
$root
.= $oneback;
28
$level
+= 1;
29
}
30
if
(file_exists(
$root
.SEC_FILE)) {
31
include
$root
.SEC_FILE;
32
}
else
{
33
trigger_error(sprintf(
"[ <b>%s</b> ] Can't include secure.php!"
, $_SERVER[
'SCRIPT_NAME'
]), E_USER_ERROR);
34
}
35
}
36
// end include secure file
37
38
55
LEPTON_handle::register
(
"rm_full_dir"
);
56
57
function
cleanup
() : bool
58
{
59
if
( 0 == func_num_args() )
60
{
61
return
true
;
62
}
63
64
$all_args = func_get_args();
65
66
foreach
($all_args as &$file) {
67
if
(
true
=== file_exists($file))
68
{
69
if
(
true
=== is_dir($file))
70
{
71
rm_full_dir
( $file );
72
}
else
{
73
unlink( $file );
74
}
75
}
76
}
77
78
return
true
;
79
}
LEPTON_handle\register
static register()
Definition
lepton_handle.php:729
$root
$root
Definition
function.cleanup.php:24
$level
$level
Definition
function.cleanup.php:25
cleanup
cleanup()
Definition
function.cleanup.php:57
rm_full_dir
rm_full_dir(string $directory)
Definition
function.rm_full_dir.php:45
SVN
upload
framework
functions
function.cleanup.php
Generated by
1.10.0