예제 #1
0
파일: Folder.php 프로젝트: tgr0ss/cakephp
 /**
  * Returns a correct set of slashes for given $path. (\\ for Windows paths and / for other paths.)
  *
  * @param string $path Path to check
  * @return string Set of slashes ("\\" or "/")
  */
 public static function correctSlashFor($path)
 {
     return Folder::isWindowsPath($path) ? '\\' : '/';
 }
예제 #2
0
 /**
  * testWindowsPath method
  *
  * @return void
  */
 public function testWindowsPath()
 {
     $this->assertFalse(Folder::isWindowsPath('0:\\cake\\is\\awesome'));
     $this->assertTrue(Folder::isWindowsPath('C:\\cake\\is\\awesome'));
     $this->assertTrue(Folder::isWindowsPath('d:\\cake\\is\\awesome'));
     $this->assertTrue(Folder::isWindowsPath('\\\\vmware-host\\Shared Folders\\file'));
 }