- Kód: Vybrat vše
<?php
// public static function deleteDir($dirPath) {
$dirPath = "adresář který se smaže";
if (! is_dir($dirPath)) {
throw new InvalidArgumentException("$dirPath must be a directory");
}
if (substr($dirPath, strlen($dirPath) - 1, 1) != '/') {
$dirPath .= '/';
}
$files = glob($dirPath . '*', GLOB_MARK);
foreach ($files as $file) {
if (is_dir($file)) {
self::deleteDir($file);
} else {
unlink($file);
}
}
?>
fungovalo to od roku 2015 a poslední dobou mi to hází tuto chybu
Fatal error: Cannot access self:: when no class scope is active in
hodil jsem to do strýce Googla a vypadlo mi mnoho odkazů ale jen v angličtině kde je chyba a jak to napravit? díky