Author: Kris.Wallsmith
Date: 2010-02-08 20:09:00 +0100 (Mon, 08 Feb 2010)
New Revision: 27751

Modified:
   branches/1.3/lib/task/sfFilesystem.class.php
   branches/1.4/lib/task/sfFilesystem.class.php
Log:
[1.3, 1.4] fixed symlink logic on vista+ with php 5.3 (closes #8237)

Modified: branches/1.3/lib/task/sfFilesystem.class.php
===================================================================
--- branches/1.3/lib/task/sfFilesystem.class.php        2010-02-08 19:02:44 UTC 
(rev 27750)
+++ branches/1.3/lib/task/sfFilesystem.class.php        2010-02-08 19:09:00 UTC 
(rev 27751)
@@ -198,7 +198,7 @@
    */
   public function symlink($originDir, $targetDir, $copyOnWindows = false)
   {
-    if (!function_exists('symlink') && $copyOnWindows)
+    if ('\\' == DIRECTORY_SEPARATOR && $copyOnWindows)
     {
       $finder = sfFinder::type('any');
       $this->mirror($originDir, $targetDir, $finder);
@@ -234,10 +234,11 @@
    */
   public function relativeSymlink($originDir, $targetDir, $copyOnWindows = 
false)
   {
-    if (function_exists('symlink') || !$copyOnWindows)
+    if ('\\' != DIRECTORY_SEPARATOR || !$copyOnWindows)
     {
       $originDir = $this->calculateRelativeDir($targetDir, $originDir);
     }
+
     $this->symlink($originDir, $targetDir, $copyOnWindows);
   }
 

Modified: branches/1.4/lib/task/sfFilesystem.class.php
===================================================================
--- branches/1.4/lib/task/sfFilesystem.class.php        2010-02-08 19:02:44 UTC 
(rev 27750)
+++ branches/1.4/lib/task/sfFilesystem.class.php        2010-02-08 19:09:00 UTC 
(rev 27751)
@@ -198,7 +198,7 @@
    */
   public function symlink($originDir, $targetDir, $copyOnWindows = false)
   {
-    if (!function_exists('symlink') && $copyOnWindows)
+    if ('\\' == DIRECTORY_SEPARATOR && $copyOnWindows)
     {
       $finder = sfFinder::type('any');
       $this->mirror($originDir, $targetDir, $finder);
@@ -234,10 +234,11 @@
    */
   public function relativeSymlink($originDir, $targetDir, $copyOnWindows = 
false)
   {
-    if (function_exists('symlink') || !$copyOnWindows)
+    if ('\\' != DIRECTORY_SEPARATOR || !$copyOnWindows)
     {
       $originDir = $this->calculateRelativeDir($targetDir, $originDir);
     }
+
     $this->symlink($originDir, $targetDir, $copyOnWindows);
   }
 

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to