[pLog-svn] r2903 - plugins/branches/lifetype-1.0/templateeditor/class/file

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Sat Feb 4 18:19:21 GMT 2006


Author: jondaley
Date: 2006-02-04 18:19:20 +0000 (Sat, 04 Feb 2006)
New Revision: 2903

Modified:
   plugins/branches/lifetype-1.0/templateeditor/class/file/myfile.class.php
Log:
don't copy backups or .svn directories when copying templates.  Also default file and directory creation permissions are 0700, so this doesn't work for people running suphp.  I believe my method work for both regular, safemode, and suphp

Modified: plugins/branches/lifetype-1.0/templateeditor/class/file/myfile.class.php
===================================================================
--- plugins/branches/lifetype-1.0/templateeditor/class/file/myfile.class.php	2006-02-04 18:19:12 UTC (rev 2902)
+++ plugins/branches/lifetype-1.0/templateeditor/class/file/myfile.class.php	2006-02-04 18:19:20 UTC (rev 2903)
@@ -23,7 +23,6 @@
          function writeFileContent( $contents )
          {
              $bytes = file_put_contents( $this->_fileName, $contents );
-             
              return $bytes;
          }
          
@@ -43,12 +42,14 @@
              
              // Simple copy for a file
              if (is_file($source)) {
-                 return File::copy($source, $dest);
+                 $ret = File::copy($source, $dest);
+                 File::chMod($dest, 0644);
+                 return $ret;
              }
           
              // Make destination directory
              if (!File::isDir($dest)) {
-                 File::createDir($dest);
+                 File::createDir($dest, 0755);
              }
           
              // Loop through the folder
@@ -58,6 +59,11 @@
                  if ($entry == '.' || $entry == '..') {
                      continue;
                  }
+
+                     // Don't copy .svn directories and backups directory
+                 if ($entry == '.svn' || $entry == 'backups') {
+                     continue;
+                 }
           
                  // Deep copy directories
                  if ($dest !== "$source/$entry") {



More information about the pLog-svn mailing list