Mistři v programování na #hovnokod

PHP #2031

snazim se prijit na to co to dela.

private function _clear() {
        if (date("N") % 2 == 0) {
            $path = $this->_config["file_storage"] . "query";
            foreach (scandir($path) as $file) {
                if ($file != "." && $file != "..") {
                    if (is_dir($path . "/" . $file)) {
                        foreach (scandir($path . "/" . $file) as $subfile) {
                            if ($subfile != "." && $subfile != "..") {
                                if (is_dir($path . "/" . $file . "/" . $subfile)) {
                                    foreach (scandir($path . "/" . $file . "/" . $subfile) as $subsubfile) {
                                        if ($subsubfile != "." && $subsubfile != "..") {
                                            unlink($path . "/" . $file . "/" . $subfile . "/" . $subsubfile);
                                        }
                                    }
                                    rmdir($path . "/" . $file . "/" . $subfile);
                                } else {
                                    unlink($path . "/" . $file . "/" . $subfile);
                                }
                            }
                        }
                        rmdir($path . "/" . $file);
                    } else {
                        unlink($path . "/" . $file);
                    }
                }
            }
        }
    }

Anonymous,