public function Archive_Tar::_translateWinPath

public Archive_Tar::_translateWinPath($p_path, $p_remove_disk_letter = true)

Parameters

$p_path:

bool $p_remove_disk_letter:

Return value

string

File

modules/system/system.tar.inc, line 2443

Class

Archive_Tar

Code

public function _translateWinPath($p_path, $p_remove_disk_letter = true) 
 {
  if (defined('OS_WINDOWS') && OS_WINDOWS) {
    // ----- Look for potential disk letter
    if (($p_remove_disk_letter)
     && (($v_position = strpos($p_path, ':')) != false)
      ) {
      $p_path = substr($p_path, $v_position + 1);
    }
    // ----- Change potential windows directory separator
    if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0, 1) == '\\')) {
      $p_path = strtr($p_path, '\\', '/');
    }
  }
  return $p_path;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.tar.inc/function/Archive_Tar::_translateWinPath/7.x