classes/phing/system/io/WindowsFileSystem.php
public function normalize($strPath)
    {
        $strPath = $this->fixEncoding($strPath);

        if ($this->_isPharArchive($strPath)) {
            return str_replace('\\', '/', $strPath);
        }

        $n = strlen($strPath);
        $slash = $this->slash;
        $altSlash = $this->altSlash;
        $prev = 0;
        for ($i = 0; $i < $n; $i++) {
            $c = $strPath{$i};
            if ($c === $altSlash) {
                return $this->normalizer($strPath, $n, ($prev === $slash) ? $i - 1 : $i);
            }
            if (($c === $slash) && ($prev === $slash) && ($i > 1)) {
                return $this->normalizer($strPath, $n, $i - 1);
            }
            if (($c === ':') && ($i > 1)) {
                return $this->normalizer($strPath, $n, 0);
            }
            $prev = $c;
        }
        if ($prev === $slash) {
            return $this->normalizer($strPath, $n, $n - 1);
        }

        return $strPath;
    }
public function normalize($strPath)
    {
        $strPath = $this->fixEncoding($strPath);

        if ($this->_isPharArchive($strPath)) {
            return str_replace('\\', '/', $strPath);
        }

        $n = strlen($strPath);
        $slash = $this->slash;
        $altSlash = $this->altSlash;
        $prev = 0;
        for ($i = 0; $i < $n; $i++) {
            $c = $strPath{$i};
            if ($c === $altSlash) {
                return $this->normalizer($strPath, $n, ($prev === $slash) ? $i - 1 : $i);
            }
            if (($c === $slash) && ($prev === $slash) && ($i > 1)) {
                return $this->normalizer($strPath, $n, $i - 1);
            }
            if (($c === ':') && ($i > 1)) {
                return $this->normalizer($strPath, $n, 0);
            }
            $prev = $c;
        }
        if ($prev === $slash) {
            return $this->normalizer($strPath, $n, $n - 1);
        }

        return $strPath;
    }
public function normalize ( $ strPath ) { $ strPath = $ this -> fixEncoding ( $ strPath ) ; if ( $ this -> _isPharArchive ( $ strPath ) ) { return str_replace ( '\\' , '/' , $ strPath ) ; } $ n = strlen ( $ strPath ) ; $ slash = $ this -> slash ; $ altSlash = $ this -> altSlash ; $ prev = 0 ; for ( $ i = 0 ; $ i < $ n ; $ i ++ ) { $ c = $ strPath { $ i } ; if ( $ c === $ altSlash ) { return $ this -> normalizer ( $ strPath , $ n , ( $ prev === $ slash ) ? $ i - 1 : $ i ) ; } if ( ( $ c === $ slash ) && ( $ prev === $ slash ) && ( $ i > 1 ) ) { return $ this -> normalizer ( $ strPath , $ n , $ i - 1 ) ; } if ( ( $ c === ':' ) && ( $ i > 1 ) ) { return $ this -> normalizer ( $ strPath , $ n , 0 ) ; } $ prev = $ c ; } if ( $ prev === $ slash ) { return $ this -> normalizer ( $ strPath , $ n , $ n - 1 ) ; } return $ strPath ; }
Check that the given pathname is normal.  If not, invoke the real
normalizer on the part of the pathname that requires normalization.
This way we iterate through the whole pathname string only once.

@param  string $strPath
@return string
Check that the given pathname is normal . If not invoke the real normalizer on the part of the pathname that requires normalization . This way we iterate through the whole pathname string only once .