Gumdrop\FileHandler::clearDestinationLocation PHP Метод

clearDestinationLocation() публичный Метод

public clearDestinationLocation ( $path = '' )
    public function clearDestinationLocation($path = '')
    {
        if ($path == '') {
            $path = $this->app->getDestinationLocation();
        }
        foreach (glob($path . '/*') as $file) {
            if (is_dir($file)) {
                $this->clearDestinationLocation($file);
            } else {
                unlink($file);
            }
        }
        if ($path != $this->app->getDestinationLocation()) {
            rmdir($path);
        }
    }