當前位置: 首頁>>代碼示例>>PHP>>正文


PHP uwFindAllFiles函數代碼示例

本文整理匯總了PHP中uwFindAllFiles函數的典型用法代碼示例。如果您正苦於以下問題:PHP uwFindAllFiles函數的具體用法?PHP uwFindAllFiles怎麽用?PHP uwFindAllFiles使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了uwFindAllFiles函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testIfDirIsNotIncluded

 public function testIfDirIsNotIncluded()
 {
     $skipDirs = array($this->_notIncludeDir);
     $files = uwFindAllFiles(self::WEBALIZER_DIR_NAME, array(), true, $skipDirs);
     $this->assertNotContains($this->_notIncludeDir, $files, "Directory {$this->_notIncludeDir} shouldn't been included in this list");
     $this->assertContains($this->_includeDir, $files, "Directory {$this->_includeDir} should been included in this list");
 }
開發者ID:netconstructor,項目名稱:sugarcrm_dev,代碼行數:7,代碼來源:Bug40793Test.php

示例2: systemCheckJsonGetFiles

function systemCheckJsonGetFiles($persistence)
{
    global $sugar_config;
    global $mod_strings;
    // add directories here that should be skipped when doing file permissions checks (cache/upload is the nasty one)
    $skipDirs = array($sugar_config['upload_dir'], 'themes');
    if (!isset($persistence['dirs_checked'])) {
        $the_array = array();
        $files = array();
        $dir = getcwd();
        $d = dir($dir);
        while ($f = $d->read()) {
            if ($f == "." || $f == "..") {
                // skip *nix self/parent
                continue;
            }
            if (is_dir("{$dir}/{$f}")) {
                $the_array[] = clean_path("{$dir}/{$f}");
            } else {
                $files[] = clean_path("{$dir}/{$f}");
            }
        }
        $persistence['files_to_check'] = $files;
        $persistence['dirs_to_check'] = $the_array;
        $persistence['dirs_total'] = count($the_array);
        $persistence['dirs_checked'] = false;
        $out = "1% {$mod_strings['LBL_UW_DONE']}";
        return $persistence;
    } elseif ($persistence['dirs_checked'] == false) {
        $dir = array_pop($persistence['dirs_to_check']);
        $files = uwFindAllFiles($dir, array(), true, $skipDirs);
        $persistence['files_to_check'] = array_merge($persistence['files_to_check'], $files);
        $whatsLeft = count($persistence['dirs_to_check']);
        if (!isset($persistence['dirs_to_check']) || $whatsLeft < 1) {
            $whatsLeft = 0;
            $persistence['dirs_checked'] = true;
        }
        $out = round(($persistence['dirs_total'] - $whatsLeft) / 21 * 100, 1) . "% {$mod_strings['LBL_UW_DONE']}";
        $out .= " [{$mod_strings['LBL_UW_SYSTEM_CHECK_CHECKING_JSON']} {$dir}]";
    } else {
        $out = "Done";
    }
    echo trim($out);
    return $persistence;
}
開發者ID:MexinaD,項目名稱:SuiteCRM,代碼行數:45,代碼來源:uw_ajax.php

示例3: getFilesForPermsCheck

/**
 * generates an array with all files in the SugarCRM root directory, skipping
 * cache/
 * @return array files Array of files with absolute paths
 */
function getFilesForPermsCheck()
{
    global $sugar_config;
    logThis('Got JSON call to find all files...');
    $filesNotWritable = array();
    $filesNWPerms = array();
    // add directories here that should be skipped when doing file permissions checks (cache/upload is the nasty one)
    $skipDirs = array($sugar_config['upload_dir']);
    $files = uwFindAllFiles(".", array(), true, $skipDirs, true);
    return $files;
}
開發者ID:omusico,項目名稱:sugar_work,代碼行數:16,代碼來源:uw_utils.php

示例4: logThis

/*********************************************************************************
 * Description:
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. All Rights
 * Reserved. Contributor(s): ______________________________________..
 * *******************************************************************************/
logThis('[At systemCheck.php]');
$stop = false;
// flag to prevent going to next step
///////////////////////////////////////////////////////////////////////////////
////	FILE CHECKS
logThis('Starting file permission check...');
$filesNotWritable = array();
$filesNWPerms = array();
// add directories here that should be skipped when doing file permissions checks (cache/upload is the nasty one)
$skipDirs = array($sugar_config['upload_dir'], '.svn');
$files = uwFindAllFiles(getcwd(), array(), true, $skipDirs);
$i = 0;
$filesOut = "\n\t<a href='javascript:void(0); toggleNwFiles(\"filesNw\");'>{$mod_strings['LBL_UW_SHOW_NW_FILES']}</a>\n\t<div id='filesNw' style='display:none;'>\n\t<table cellpadding='3' cellspacing='0' border='0'>\n\t<tr>\n\t\t<th align='left'>{$mod_strings['LBL_UW_FILE']}</th>\n\t\t<th align='left'>{$mod_strings['LBL_UW_FILE_PERMS']}</th>\n\t\t<th align='left'>{$mod_strings['LBL_UW_FILE_OWNER']}</th>\n\t\t<th align='left'>{$mod_strings['LBL_UW_FILE_GROUP']}</th>\n\t</tr>";
$isWindows = is_windows();
foreach ($files as $file) {
    if ($isWindows) {
        if (!is_writable_windows($file)) {
            logThis('WINDOWS: File [' . $file . '] not readable - saving for display');
            // don't warn yet - we're going to use this to check against replacement files
            $filesNotWritable[$i] = $file;
            $filesNWPerms[$i] = substr(sprintf('%o', fileperms($file)), -4);
            $filesOut .= "<tr>" . "<td><span class='error'>{$file}</span></td>" . "<td>{$filesNWPerms[$i]}</td>" . "<td>" . $mod_strings['ERR_UW_CANNOT_DETERMINE_USER'] . "</td>" . "<td>" . $mod_strings['ERR_UW_CANNOT_DETERMINE_GROUP'] . "</td>" . "</tr>";
        }
    } else {
        if (!is_writable($file)) {
            logThis('File [' . $file . '] not writable - saving for display');
開發者ID:klr2003,項目名稱:sourceread,代碼行數:31,代碼來源:systemCheck.php


注:本文中的uwFindAllFiles函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。