[Phpfreechat-svn] SF.net SVN: phpfreechat: [622] trunk/src/pfctools.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-06-24 20:05:56
|
Revision: 622 Author: kerphi Date: 2006-06-24 13:05:49 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=622&view=rev Log Message: ----------- by default the copy_r function must give 644 rights to files Modified Paths: -------------- trunk/src/pfctools.php Modified: trunk/src/pfctools.php =================================================================== --- trunk/src/pfctools.php 2006-06-17 20:22:04 UTC (rev 621) +++ trunk/src/pfctools.php 2006-06-24 20:05:49 UTC (rev 622) @@ -103,7 +103,7 @@ } -function mkdir_r($path, $mode = 0700) +function mkdir_r($path, $modedir = 0700) { // This function creates the specified directory using mkdir(). Note // that the recursive feature on mkdir() is broken with PHP 5.0.4 for @@ -112,8 +112,8 @@ { // The directory doesn't exist. Recurse, passing in the parent // directory so that it gets created. - mkdir_r(dirname($path), $mode); - mkdir($path, $mode); + mkdir_r(dirname($path), $modedir); + mkdir($path, $modedir); } } @@ -137,18 +137,18 @@ * @param string $dest Destination path * @return bool Returns TRUE on success, FALSE on failure */ -function copy_r($source, $dest, $mode = 0700) +function copy_r($source, $dest, $modedir = 0700, $modefile = 0644) { // Simple copy for a file if (is_file($source)) { $ret = copy($source, $dest); - chmod($dest, $mode); + chmod($dest, $modefile); return $ret; } // Make destination directory if (!is_dir($dest)) { - mkdir($dest, $mode); + mkdir($dest, $modedir); } // Take the directories entries @@ -166,7 +166,7 @@ if ($e == '.' || $e == '..' || $e == '.svn') continue; // Deep copy directories if ($dest !== $source . DIRECTORY_SEPARATOR . $e) - copy_r($source . DIRECTORY_SEPARATOR . $e, $dest . DIRECTORY_SEPARATOR . $e, $mode); + copy_r($source . DIRECTORY_SEPARATOR . $e, $dest . DIRECTORY_SEPARATOR . $e, $modedir, $modefile); } // Clean up This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |