<?php
/**
 * WordPress-aware filesystem path resolution.
 *
 * @package SEOvaultSEO\Utils
 */

namespace SEOvaultSEO\Utils;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Resolves WordPress temporary-directory paths used by the connector upload flow.
 */
class Paths {

	/**
	 * Resolve WordPress's preferred temporary directory.
	 *
	 * @return string Empty when no temporary directory is available.
	 */
	public static function temp_dir() {
		if ( ! function_exists( 'get_temp_dir' ) ) {
			return '';
		}

		$temp_dir = get_temp_dir();
		return is_string( $temp_dir ) && '' !== trim( $temp_dir ) ? trailingslashit( $temp_dir ) : '';
	}
}
