PclZipUtilTranslateWinPath

The WordPress Core PclZipUtilTranslateWinPath function.

Description

PclZipUtilTranslateWinPath( $p_path, (constant) $p_remove_disk_letter = true ); 

Parameters (2)

0. $p_path
The path.
1. $p_remove_disk_letter — Optional. (constant) => true
The remove disk letter.

Usage

  1. if ( !function_exists( 'PclZipUtilTranslateWinPath' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/class-pclzip.php'; 
  3.  
  4. // The path. 
  5. $p_path = null; 
  6.  
  7. // The remove disk letter. 
  8. $p_remove_disk_letter = true; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/class-pclzip.php  
  1. function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true) 
  2. if (stristr(php_uname(), 'windows')) { 
  3. // ----- Look for potential disk letter 
  4. if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) { 
  5. $p_path = substr($p_path, $v_position+1); 
  6. // ----- Change potential windows directory separator 
  7. if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0, 1) == '\\')) { 
  8. $p_path = strtr($p_path, '\\', '/'); 
  9. return $p_path;