X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=CRM%2FUtils%2FFile.php;h=f435ad175e5d04928dd8e5a1d3d9d7fc61135a38;hb=4b57bc9f2b1fa63555e588f6ad9c3c079725af4d;hp=42ef38472b85d2443c257fdd597e6da12dafbbae;hpb=e8cca51aa6ed1feb98786bd980a1395d8a9a785a;p=civicrm-core.git diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index 42ef38472b..f435ad175e 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -1,7 +1,7 @@ dsn . $config->userFrameworkResourceURL); //$fileName = "{$config->configAndLogDir}" . $prefix . $nonce . $suffix; @@ -589,7 +583,7 @@ HTACCESS; * @return string, path to an openable/writable directory; ends with '/' * @see tempnam */ - static function tempdir($prefix = 'tmp-') { + public static function tempdir($prefix = 'tmp-') { $fileName = self::tempnam($prefix); unlink($fileName); mkdir($fileName, 0700); @@ -605,7 +599,7 @@ HTACCESS; * @param $pattern string, glob pattern, eg "*.txt" * @return array(string) */ - static function findFiles($dir, $pattern) { + public static function findFiles($dir, $pattern) { $todos = array($dir); $result = array(); while (!empty($todos)) { @@ -618,8 +612,7 @@ HTACCESS; } } } - $dh = opendir($subdir); - if ($dh) { + if ($dh = opendir($subdir)) { while (FALSE !== ($entry = readdir($dh))) { $path = $subdir . DIRECTORY_SEPARATOR . $entry; if ($entry{0} == '.') { @@ -643,7 +636,7 @@ HTACCESS; * * @return bool */ - static function isChildPath($parent, $child, $checkRealPath = TRUE) { + public static function isChildPath($parent, $child, $checkRealPath = TRUE) { if ($checkRealPath) { $parent = realpath($parent); $child = realpath($child); @@ -673,7 +666,7 @@ HTACCESS; * * @return bool TRUE on success */ - static function replaceDir($fromDir, $toDir, $verbose = FALSE) { + public static function replaceDir($fromDir, $toDir, $verbose = FALSE) { if (is_dir($toDir)) { if (!self::cleanDir($toDir, TRUE, $verbose)) { return FALSE; @@ -690,4 +683,3 @@ HTACCESS; return TRUE; } } -