public static function delete($target, $include_target = true)
    {
        if (!is_dir($target)) {
            return false;
        }

        $success = self::doDelete($target, $include_target);

        if (!$success) {
            $error = error_get_last();
            throw new \RuntimeException($error['message']);
        }

        // Make sure that the change will be detected when caching.
        if ($include_target) {
            @touch(dirname($target));
        } else {
            @touch($target);
        }

        return $success;
    }
public static function delete($target, $include_target = true)
    {
        if (!is_dir($target)) {
            return false;
        }

        $success = self::doDelete($target, $include_target);

        if (!$success) {
            $error = error_get_last();
            throw new \RuntimeException($error['message']);
        }

        // Make sure that the change will be detected when caching.
        if ($include_target) {
            @touch(dirname($target));
        } else {
            @touch($target);
        }

        return $success;
    }
public static function delete ( $ target , $ include_target = true ) { if ( ! is_dir ( $ target ) ) { return false ; } $ success = self :: doDelete ( $ target , $ include_target ) ; if ( ! $ success ) { $ error = error_get_last ( ) ; throw new \ RuntimeException ( $ error [ 'message' ] ) ; } // Make sure that the change will be detected when caching. if ( $ include_target ) { @ touch ( dirname ( $ target ) ) ; } else { @ touch ( $ target ) ; } return $ success ; }
Recursively delete directory from filesystem.

@param  string $target
@param  bool   $include_target
@return bool
@throws \RuntimeException
Recursively delete directory from filesystem .