[Phpfreechat-svn] SF.net SVN: phpfreechat: [614] trunk/src
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-06-17 10:58:51
|
Revision: 614 Author: kerphi Date: 2006-06-17 03:58:45 -0700 (Sat, 17 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=614&view=rev Log Message: ----------- Refactoring: rename copyr to copy_r Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php trunk/src/pfctools.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-06-17 10:54:12 UTC (rev 613) +++ trunk/src/pfcglobalconfig.class.php 2006-06-17 10:58:45 UTC (rev 614) @@ -199,29 +199,29 @@ $this->errors = array_merge($this->errors, @install_dir($this->jspath, $this->data_public_path."/javascript")); $this->errors = array_merge($this->errors, @test_writable_dir($this->data_private_path."/cache", "data_private_path/cache")); - // check the copyr and rm_r function works + // check the copy_r and rm_r function works if (count($this->errors) == 0) { - $copyr_ok = true; - $dir1 = $this->data_private_path."/copyr1"; + $copy_r_ok = true; + $dir1 = $this->data_private_path."/copy_r1"; $file1 = $dir1."/dummy"; - $dir2 = $this->data_private_path."/copyr2"; + $dir2 = $this->data_private_path."/copy_r2"; $file2 = $dir2."/dummy"; // create a dummy directory mkdir($dir1); // check the directory exists - if (!file_exists($dir1) || !is_dir($dir1)) $copyr_ok = false; + if (!file_exists($dir1) || !is_dir($dir1)) $copy_r_ok = false; // create a dummy file touch($file1); // check the file exists - if (!file_exists($file1)) $copyr_ok = false; - // copyr the dummy dir - copyr($dir1,$dir2); + if (!file_exists($file1)) $copy_r_ok = false; + // copy_r the dummy dir + copy_r($dir1,$dir2); // check the directory exists - if (!file_exists($dir2) || !is_dir($dir2)) $copyr_ok = false; + if (!file_exists($dir2) || !is_dir($dir2)) $copy_r_ok = false; // check the file exists - if (!file_exists($file2)) $copyr_ok = false; - if (!$copyr_ok) + if (!file_exists($file2)) $copy_r_ok = false; + if (!$copy_r_ok) $this->errors[] = _pfc("Recursive copy doesn't works"); // try to remove recursively the directory @@ -232,7 +232,7 @@ if (file_exists($dir1) || file_exists($dir2)) $rm_r_ok = false; // check the file doesn't exists if (file_exists($file1) || file_exists($file2)) $rm_r_ok = false; - if (!$copyr_ok) + if (!$copy_r_ok) $this->errors[] = _pfc("Recursive remove doesn't works"); } Modified: trunk/src/pfctools.php =================================================================== --- trunk/src/pfctools.php 2006-06-17 10:54:12 UTC (rev 613) +++ trunk/src/pfctools.php 2006-06-17 10:58:45 UTC (rev 614) @@ -137,7 +137,7 @@ * @param string $dest Destination path * @return bool Returns TRUE on success, FALSE on failure */ -function copyr($source, $dest, $mode = 0700) +function copy_r($source, $dest, $mode = 0700) { // Simple copy for a file if (is_file($source)) { @@ -166,7 +166,7 @@ if ($e == '.' || $e == '..' || $e == '.svn') continue; // Deep copy directories if ($dest !== $source . DIRECTORY_SEPARATOR . $e) - copyr($source . DIRECTORY_SEPARATOR . $e, $dest . DIRECTORY_SEPARATOR . $e, $mode); + copy_r($source . DIRECTORY_SEPARATOR . $e, $dest . DIRECTORY_SEPARATOR . $e, $mode); } // Clean up @@ -239,7 +239,7 @@ if (!is_readable($src_dir)) $errors[] = _pfc("%s is not readable", $src_dir); - copyr( $src_dir, $dst_dir ); + copy_r( $src_dir, $dst_dir ); return $errors; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |