• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP findAllFiles函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中findAllFiles函数的典型用法代码示例。如果您正苦于以下问题:PHP findAllFiles函数的具体用法?PHP findAllFiles怎么用?PHP findAllFiles使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了findAllFiles函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: cleanFromCache

function cleanFromCache($sugar_config, $dir)
{
    //Clean smarty from cache
    if (is_dir($sugar_config['cache_dir'] . $dir)) {
        $allModFiles = array();
        $allModFiles = findAllFiles($sugar_config['cache_dir'] . $dir, $allModFiles);
        foreach ($allModFiles as $file) {
            if (file_exists($file)) {
                unlink($file);
            }
        }
    }
}
开发者ID:adderall,项目名称:shadow,代码行数:13,代码来源:shadowUpgrade.php


示例2: unlinkTempFiles

/**
 * deletes files created by unzipping a package
 */
function unlinkTempFiles()
{
    global $sugar_config;
    logThis('at unlinkTempFiles()');
    $tempDir = clean_path(getcwd() . '/' . $sugar_config['upload_dir'] . '/upgrades/temp');
    $files = findAllFiles($tempDir, array(), false);
    rsort($files);
    foreach ($files as $file) {
        if (!is_dir($file)) {
            logThis('unlinking [' . $file . ']');
            @unlink($file);
        }
    }
    // now do dirs
    $files = findAllFiles($tempDir, array(), true);
    foreach ($files as $dir) {
        if (is_dir($dir)) {
            logThis('removing dir [' . $dir . ']');
            @rmdir($dir);
        }
    }
    $cacheFile = "modules/UpgradeWizard/_persistence.php";
    if (is_file($cacheFile)) {
        logThis("Unlinking Upgrade cache file: '_persistence.php'");
        @unlink($cacheFile);
    }
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:30,代码来源:uw_utils.php


示例3: upgrade_custom_relationships

$trackerManager = TrackerManager::getInstance();
$trackerManager->pause();
$trackerManager->unsetMonitors();
include 'modules/ACLActions/actiondefs.php';
include 'include/modules.php';
require_once 'modules/Administration/upgrade_custom_relationships.php';
upgrade_custom_relationships();
logThis('Upgrading user preferences start .', $path);
if (function_exists('upgradeUserPreferences')) {
    upgradeUserPreferences();
}
logThis('Upgrading user preferences finish .', $path);
// clear out the theme cache
if (is_dir($GLOBALS['sugar_config']['cache_dir'] . 'themes')) {
    $allModFiles = array();
    $allModFiles = findAllFiles($GLOBALS['sugar_config']['cache_dir'] . 'themes', $allModFiles);
    foreach ($allModFiles as $file) {
        //$file_md5_ref = str_replace(clean_path(getcwd()),'',$file);
        if (file_exists($file)) {
            unlink($file);
        }
    }
}
// re-minify the JS source files
$_REQUEST['root_directory'] = getcwd();
$_REQUEST['js_rebuild_concat'] = 'rebuild';
require_once 'jssource/minify.php';
//Add the cache cleaning here.
if (function_exists('deleteCache')) {
    logThis('Call deleteCache', $path);
    @deleteCache();
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:31,代码来源:silentUpgrade_step2.php


示例4: logThis

         logThis('clear ' . $GLOBALS['sugar_config']['cache_dir'] . 'modules' . ' files');
         $allModFiles = array();
         $allModFiles = findAllFiles($GLOBALS['sugar_config']['cache_dir'] . 'modules', $allModFiles);
         foreach ($allModFiles as $file) {
             //$file_md5_ref = str_replace(clean_path(getcwd()),'',$file);
             if (file_exists($file)) {
                 logThis('unlink ' . $file);
                 unlink($file);
             }
         }
     }
     //Clean jsLanguage from cache
     if (is_dir($GLOBALS['sugar_config']['cache_dir'] . 'jsLanguage')) {
         logThis('clear ' . $GLOBALS['sugar_config']['cache_dir'] . 'jsLanguage' . ' files');
         $allModFiles = array();
         $allModFiles = findAllFiles($GLOBALS['sugar_config']['cache_dir'] . 'jsLanguage', $allModFiles);
         foreach ($allModFiles as $file) {
             //$file_md5_ref = str_replace(clean_path(getcwd()),'',$file);
             if (file_exists($file)) {
                 logThis('unlink ' . $file);
                 unlink($file);
             }
         }
     }
 }
 logThis('finished check to see if current_db_version in $_SESSION equals target_db_version in $_SESSION');
 //Look for chance folder and delete it if found. Bug 23595
 if (function_exists('deleteChance')) {
     logThis('running deleteChance() function');
     @deleteChance();
 }
开发者ID:razorinc,项目名称:sugarcrm-example,代码行数:31,代码来源:commit.php


示例5: getPackagesInStaging

 function getPackagesInStaging($view = 'module')
 {
     global $sugar_config;
     global $current_language;
     $uh = new UpgradeHistory();
     $base_upgrade_dir = "upload://upgrades";
     $base_tmp_upgrade_dir = sugar_cached("upgrades/temp");
     $uContent = findAllFiles($base_upgrade_dir, array(), false, 'zip');
     $upgrade_contents = array();
     $content_values = array_values($uContent);
     $alreadyProcessed = array();
     foreach ($content_values as $val) {
         if (empty($alreadyProcessed[$val])) {
             $upgrade_contents[] = $val;
             $alreadyProcessed[$val] = true;
         }
     }
     $upgrades_available = 0;
     $packages = array();
     $mod_strings = return_module_language($current_language, "Administration");
     foreach ($upgrade_contents as $upgrade_content) {
         if (!preg_match('#.*\\.zip$#', strtolower($upgrade_content)) || preg_match("#.*./zips/.*#", strtolower($upgrade_content))) {
             continue;
         }
         $the_base = basename($upgrade_content);
         $the_md5 = md5_file($upgrade_content);
         $md5_matches = $uh->findByMd5($the_md5);
         $file_install = $upgrade_content;
         if (empty($md5_matches)) {
             $target_manifest = remove_file_extension($upgrade_content) . '-manifest.php';
             require_once $target_manifest;
             $name = empty($manifest['name']) ? $upgrade_content : $manifest['name'];
             $version = empty($manifest['version']) ? '' : $manifest['version'];
             $published_date = empty($manifest['published_date']) ? '' : $manifest['published_date'];
             $icon = '';
             $description = empty($manifest['description']) ? 'None' : $manifest['description'];
             $uninstallable = empty($manifest['is_uninstallable']) ? 'No' : 'Yes';
             $type = $this->getUITextForType($manifest['type']);
             $manifest_type = $manifest['type'];
             $dependencies = array();
             if (isset($manifest['dependencies'])) {
                 $dependencies = $manifest['dependencies'];
             }
             //check dependencies first
             if (!empty($dependencies)) {
                 $uh = new UpgradeHistory();
                 $not_found = $uh->checkDependencies($dependencies);
                 if (!empty($not_found) && count($not_found) > 0) {
                     $file_install = 'errors_' . $mod_strings['ERR_UW_NO_DEPENDENCY'] . "[" . implode(',', $not_found) . "]";
                 }
             }
             if ($view == 'default' && $manifest_type != 'patch') {
                 continue;
             }
             if ($view == 'module' && $manifest_type != 'module' && $manifest_type != 'theme' && $manifest_type != 'langpack') {
                 continue;
             }
             if (empty($manifest['icon'])) {
                 $icon = $this->getImageForType($manifest['type']);
             } else {
                 $path_parts = pathinfo($manifest['icon']);
                 $icon = "<img src=\"" . remove_file_extension($upgrade_content) . "-icon." . $path_parts['extension'] . "\">";
             }
             $upgrades_available++;
             $packages[] = array('name' => $name, 'version' => $version, 'published_date' => $published_date, 'description' => $description, 'uninstallable' => $uninstallable, 'type' => $type, 'file' => fileToHash($upgrade_content), 'file_install' => fileToHash($upgrade_content));
         }
         //fi
     }
     //rof
     return $packages;
 }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:71,代码来源:PackageManager.php


示例6: upgradeSugarCache

/**
 * change from using the older SugarCache in 6.1 and below to the new one in 6.2
 */
function upgradeSugarCache($file)
{
    global $sugar_config;
    $cacheUploadUpgradesTemp = mk_temp_dir(sugar_cached('upgrades/temp'));
    unzip($file, $cacheUploadUpgradesTemp);
    if (!file_exists(clean_path("{$cacheUploadUpgradesTemp}/manifest.php"))) {
        logThis("*** ERROR: no manifest file detected while bootstraping upgrade wizard files!");
        return;
    } else {
        include clean_path("{$cacheUploadUpgradesTemp}/manifest.php");
    }
    $from_dir = "{$cacheUploadUpgradesTemp}/{$manifest['copy_files']['from_dir']}";
    $allFiles = array();
    if (file_exists("{$from_dir}/include/SugarCache")) {
        $allFiles = findAllFiles("{$from_dir}/include/SugarCache", $allFiles);
    }
    if (file_exists("{$from_dir}/include/database")) {
        $allFiles = findAllFiles("{$from_dir}/include/database", $allFiles);
    }
    if (file_exists("{$from_dir}/include/utils/external_cache.php")) {
        $allFiles[] = "{$from_dir}/include/utils/external_cache.php";
    }
    if (file_exists("{$from_dir}/include/utils/sugar_file_utils.php")) {
        $allFiles[] = "{$from_dir}/include/utils/sugar_file_utils.php";
    }
    if (file_exists("{$from_dir}/include/utils/sugar_file_utils.php")) {
        $allFiles[] = "{$from_dir}/include/utils/sugar_file_utils.php";
    }
    foreach ($allFiles as $k => $file) {
        $destFile = str_replace($from_dir . "/", "", $file);
        if (!is_dir(dirname($destFile))) {
            mkdir_recursive(dirname($destFile));
            // make sure the directory exists
        }
        if (stristr($file, 'uw_main.tpl')) {
            logThis('Skipping "' . $file . '" - file copy will during commit step.');
        } else {
            logThis('updating UpgradeWizard code: ' . $destFile);
            copy_recursive($file, $destFile);
        }
    }
}
开发者ID:omusico,项目名称:sugar_work,代码行数:45,代码来源:uw_utils.php


示例7: clearInboundAccountCache

 function clearInboundAccountCache($ieId)
 {
     global $sugar_config;
     $cacheRoot = sugar_cached("modules/Emails/{$ieId}");
     $files = findAllFiles($cacheRoot . "/messages/", array());
     foreach ($files as $file) {
         unlink($file);
     }
     // fn
     $files = findAllFiles($cacheRoot . "/attachments/", array());
     foreach ($files as $file) {
         unlink($file);
     }
     // for
 }
开发者ID:NALSS,项目名称:SuiteCRM,代码行数:15,代码来源:EmailUI.php


示例8: getAllCustomizedModules

 /**
  * Get all the customized modules. Compare the file md5s with the base md5s
  * If a file has been modified then put the module in the list of customized
  * modules. Show the list in the preflight check UI.
  */
 function getAllCustomizedModules()
 {
     require_once 'files.md5';
     $return_array = array();
     $modules = getAllModules();
     foreach ($modules as $mod) {
         //find all files in each module if the files have been modified
         //as compared to the base version then add the module to the
         //customized modules array
         $modFiles = findAllFiles(clean_path(getcwd()) . "/modules/{$mod}", array());
         foreach ($modFiles as $file) {
             $fileContents = file_get_contents($file);
             $file = str_replace(clean_path(getcwd()), '', $file);
             if ($md5_string['./' . $file]) {
                 if (md5($fileContents) != $md5_string['./' . $file]) {
                     //A file has been customized in the module. Put the module into the
                     // customized modules array.
                     echo 'Changed File' . $file;
                     $return_array[$mod];
                     break;
                 }
             } else {
                 // This is a new file in user's version and indicates that module has been
                 //customized. Put the module in the customized array.
                 echo 'New File' . $file;
                 $return_array[$mod];
                 break;
             }
         }
     }
     //foreach
     return $return_array;
 }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:38,代码来源:upgradeMetaHelper.php


示例9: getSources

 /**
  * getSources
  * Returns an Array of source entries found under the given directory
  * @param String $directory The directory to search
  * @return mixed $sources An Array of source entries
  */
 private static function getSources($directory = 'modules/Connectors/connectors/sources')
 {
     if (file_exists($directory)) {
         $files = array();
         $files = findAllFiles($directory, $files, false, 'config\\.php');
         $start = strrpos($directory, '/') == strlen($directory) - 1 ? strlen($directory) : strlen($directory) + 1;
         $sources = array();
         foreach ($files as $file) {
             require $file;
             $end = strrpos($file, '/') - $start;
             $source = array();
             $source['id'] = str_replace('/', '_', substr($file, $start, $end));
             $source['name'] = !empty($config['name']) ? $config['name'] : $source['id'];
             $source['enabled'] = true;
             $source['directory'] = $directory . '/' . str_replace('_', '/', $source['id']);
             $instance = ConnectorFactory::getInstance($source['id']);
             $mapping = $instance->getMapping();
             $modules = array();
             if (!empty($mapping['beans'])) {
                 foreach ($mapping['beans'] as $module => $mapping_entry) {
                     $modules[] = $module;
                 }
             }
             $source['modules'] = $modules;
             $sources[$source['id']] = $source;
         }
         return $sources;
     }
     return array();
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:36,代码来源:ConnectorUtils.php


示例10: getPackagesInStaging

 function getPackagesInStaging($view = 'module')
 {
     global $sugar_config;
     global $current_language;
     $uh = new UpgradeHistory();
     $base_upgrade_dir = $sugar_config['upload_dir'] . "/upgrades";
     $base_tmp_upgrade_dir = "{$base_upgrade_dir}/temp";
     $uContent = findAllFiles("{$base_upgrade_dir}", array(), false, 'zip', $base_tmp_upgrade_dir);
     //other variations of zip file i.e. ZIP, zIp,zIP,Zip,ZIp,ZiP
     $extns = array('ZIP', 'ZIp', 'ZiP', 'Zip', 'zIP', 'zIp', 'ziP');
     foreach ($extns as $extn) {
         $uContent = array_merge($uContent, findAllFiles("{$base_upgrade_dir}", array(), false, $extn, $base_tmp_upgrade_dir));
     }
     $upgrade_contents = array();
     $content_values = array_values($uContent);
     $alreadyProcessed = array();
     foreach ($content_values as $val) {
         if (empty($alreadyProcessed[$val])) {
             $upgrade_contents[] = $val;
             $alreadyProcessed["{$val}"] = true;
         }
     }
     $upgrades_available = 0;
     $packages = array();
     $mod_strings = return_module_language($current_language, "Administration");
     foreach ($upgrade_contents as $upgrade_content) {
         if (!preg_match("#.*\\.zip\$#", strtolower($upgrade_content)) || preg_match("#.*./zips/.*#", strtolower($upgrade_content))) {
             continue;
         }
         $upgrade_content = clean_path($upgrade_content);
         // Bug 22285 - fix for UNC paths
         if (substr($upgrade_content, 0, 2) == '\\\\') {
             $upgrade_content = '\\\\' . $upgrade_content;
         }
         $the_base = basename($upgrade_content);
         $the_md5 = md5_file($upgrade_content);
         $md5_matches = $uh->findByMd5($the_md5);
         $file_install = $upgrade_content;
         if (0 == sizeof($md5_matches)) {
             $target_manifest = remove_file_extension($upgrade_content) . '-manifest.php';
             require_once $target_manifest;
             $name = empty($manifest['name']) ? $upgrade_content : $manifest['name'];
             $version = empty($manifest['version']) ? '' : $manifest['version'];
             $published_date = empty($manifest['published_date']) ? '' : $manifest['published_date'];
             $icon = '';
             $description = empty($manifest['description']) ? 'None' : $manifest['description'];
             $uninstallable = empty($manifest['is_uninstallable']) ? 'No' : 'Yes';
             $type = $this->getUITextForType($manifest['type']);
             $manifest_type = $manifest['type'];
             $dependencies = array();
             if (isset($manifest['dependencies'])) {
                 $dependencies = $manifest['dependencies'];
             }
             //check dependencies first
             if (!empty($dependencies)) {
                 $uh = new UpgradeHistory();
                 $not_found = $uh->checkDependencies($dependencies);
                 if (!empty($not_found) && count($not_found) > 0) {
                     $file_install = 'errors_' . $mod_strings['ERR_UW_NO_DEPENDENCY'] . "[" . implode(',', $not_found) . "]";
                 }
                 //fi
             }
             if ($view == 'default' && $manifest_type != 'patch') {
                 continue;
             }
             if ($view == 'module' && $manifest_type != 'module' && $manifest_type != 'theme' && $manifest_type != 'langpack') {
                 continue;
             }
             if (empty($manifest['icon'])) {
                 $icon = $this->getImageForType($manifest['type']);
             } else {
                 $path_parts = pathinfo($manifest['icon']);
                 $icon = "<img src=\"" . remove_file_extension($upgrade_content) . "-icon." . $path_parts['extension'] . "\">";
             }
             $upgrades_available++;
             // uploaded file in cache/upload
             $fileS = explode('/', $upgrade_content);
             $c = count($fileS);
             $fileName = isset($fileS[$c - 1]) && !empty($fileS[$c - 1]) ? $fileS[$c - 1] : $fileS[$c - 2];
             $upload_file = $sugar_config['upload_dir'] . $fileName;
             $upgrade_content = urlencode($upgrade_content);
             $upload_content = urlencode($upload_file);
             $packages[] = array('name' => $name, 'version' => $version, 'published_date' => $published_date, 'description' => $description, 'uninstallable' => $uninstallable, 'type' => $type, 'file_install' => fileToHash($file_install), 'file' => fileToHash($upgrade_content), 'upload_file' => $upload_content);
         }
         //fi
     }
     //rof
     return $packages;
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:89,代码来源:PackageManager.php


示例11: unlinkUWTempFiles

/**
 * deletes files created by unzipping a package
 */
function unlinkUWTempFiles()
{
    global $sugar_config;
    global $path;
    logThis('at unlinkUWTempFiles()');
    $tempDir = '';
    list($upgDir, $tempDir) = getUWDirs();
    if (file_exists($tempDir) && is_dir($tempDir)) {
        $files = findAllFiles($tempDir, array(), false);
        rsort($files);
        foreach ($files as $file) {
            if (!is_dir($file)) {
                //logThis('unlinking ['.$file.']', $path);
                @unlink($file);
            }
        }
        // now do dirs
        $files = findAllFiles($tempDir, array(), true);
        foreach ($files as $dir) {
            if (is_dir($dir)) {
                //logThis('removing dir ['.$dir.']', $path);
                @rmdir($dir);
            }
        }
        $cacheFile = sugar_cached("modules/UpgradeWizard/_persistence.php");
        if (is_file($cacheFile)) {
            logThis("Unlinking Upgrade cache file: '_persistence.php'", $path);
            @unlink($cacheFile);
        }
    }
    logThis("finished!");
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:35,代码来源:uw_utils.php


示例12: getLangPacks

/**
 * searches upgrade dir for lang pack files.
 * 
 * @return string HTML of available lang packs
 */
function getLangPacks()
{
    global $mod_strings;
    global $next_step;
    global $base_upgrade_dir;
    $ret = "<tr><td colspan=7 align=left>{$mod_strings['LBL_LANG_PACK_READY']}</td></tr>";
    $ret .= "<tr>\n\t            <td nowrap align=left><b>{$mod_strings['LBL_ML_NAME']}</b></td>\n\t            <td nowrap><b>{$mod_strings['LBL_ML_VERSION']}</b></td>\n\t            <td nowrap><b>{$mod_strings['LBL_ML_PUBLISHED']}</b></td>\n\t            <td nowrap><b>{$mod_strings['LBL_ML_UNINSTALLABLE']}</b></td>\n\t            <td nowrap><b>{$mod_strings['LBL_ML_DESCRIPTION']}</b></td>\n            </tr>\n";
    $files = array();
    // duh, new installs won't have the upgrade folders
    if (!is_dir(getcwd() . "/cache/upload/upgrades")) {
        $subdirs = array('full', 'langpack', 'module', 'patch', 'theme', 'temp');
        foreach ($subdirs as $subdir) {
            mkdir_recursive("{$base_upgrade_dir}/{$subdir}");
        }
    }
    $files = findAllFiles(getcwd() . "/cache/upload/upgrades", $files);
    foreach ($files as $file) {
        if (!preg_match("#.*\\.zip\$#", $file)) {
            continue;
        }
        // skip installed lang packs
        if (isset($_SESSION['INSTALLED_LANG_PACKS']) && in_array($file, $_SESSION['INSTALLED_LANG_PACKS'])) {
            continue;
        }
        // handle manifest.php
        $target_manifest = remove_file_extension($file) . '-manifest.php';
        include $target_manifest;
        $name = empty($manifest['name']) ? $file : $manifest['name'];
        $version = empty($manifest['version']) ? '' : $manifest['version'];
        $published_date = empty($manifest['published_date']) ? '' : $manifest['published_date'];
        $icon = '';
        $description = empty($manifest['description']) ? 'None' : $manifest['description'];
        $uninstallable = empty($manifest['is_uninstallable']) ? 'No' : 'Yes';
        $manifest_type = $manifest['type'];
        $commitPackage = getPackButton('commit', $target_manifest, $file, $next_step);
        $deletePackage = getPackButton('remove', $target_manifest, $file, $next_step);
        $ret .= "<tr>";
        $ret .= "<td nowrap>" . $name . "</td>";
        $ret .= "<td nowrap>" . $version . "</td>";
        $ret .= "<td nowrap>" . $published_date . "</td>";
        $ret .= "<td nowrap>" . $uninstallable . "</td>";
        $ret .= "<td>" . $description . "</td>";
        $ret .= "<td nowrap>{$commitPackage}</td>";
        $ret .= "<td nowrap>{$deletePackage}</td>";
        $ret .= "</td></tr>";
    }
    if (count($files) > 0) {
        $ret .= "</tr><td colspan=7>";
        $ret .= "<form name='commit' action='install.php' method='POST'>\n                    <input type='hidden' name='current_step' value='{$next_step}'>\n                    <input type='hidden' name='goto' value='Re-check'>\n                    <input type='hidden' name='languagePackAction' value='commit'>\n                 </form>\n                ";
        $ret .= "</td></tr>";
    } else {
        $ret .= "</tr><td colspan=7><i>{$mod_strings['LBL_LANG_NO_PACKS']}</i></td></tr>";
    }
    return $ret;
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:60,代码来源:install_utils.php


示例13: get_encoded_portal_zip_file

function get_encoded_portal_zip_file($session, $md5file, $last_sync, $is_md5_sync = 1)
{
    // files might be big
    global $sugar_config;
    ini_set("memory_limit", "-1");
    $md5 = "";
    $data = "";
    $error = new SoapError();
    $the_error = "";
    if (!validate_authenticated($session)) {
        $the_error = "Invalid session";
    }
    require "install/data/disc_client.php";
    $tempdir_parent = create_cache_directory("disc_client");
    $temp_dir = tempnam($tempdir_parent, "sug");
    sugar_mkdir($temp_dir, 0775);
    $temp_file = tempnam($temp_dir, "sug");
    write_encoded_file($md5file, $temp_dir, $temp_file);
    $ignore = false;
    //generate md5 files on server
    require_once $temp_file;
    $server_files = array();
    // used later for removing unneeded local files
    $zip_file = tempnam(tempdir_parent, $session);
    $root_files = array();
    $custom_files = array();
    $file_list = array();
    if (!$is_md5_sync) {
        if (is_dir("portal")) {
            $root_files = findAllTouchedFiles("portal", array(), $last_sync);
        }
        if (is_dir("custom/portal")) {
            $custom_files = findAllTouchedFiles("custom/portal", array(), $last_sync);
        }
        $all_src_files = array_merge($root_files, $custom_files);
        foreach ($all_src_files as $src_file) {
            $ignore = false;
            foreach ($disc_client_ignore as $ignore_pattern) {
                if (preg_match("#" . $ignore_pattern . "#", $src_file)) {
                    $ignore = true;
                }
            }
            if (!$ignore) {
                //we have to strip off portal or custom/portal before the src file to look it up
                $key = str_replace('custom/portal/', '', $src_file);
                $key = str_replace('portal/', '', $key);
                if ($client_file_list != null && isset($client_file_list[$key])) {
                    //we have found a file out of sync
                    $file_list[] = $src_file;
                    //since we have processed this element of the client
                    //list of files, remove it from the list
                    unset($client_file_list[$key]);
                } else {
                    //this file does not exist on the client side
                    $file_list[] = $src_file;
                }
            }
        }
    } else {
        if (is_dir("portal")) {
            $root_files = findAllFiles("portal", array());
        }
        if (is_dir("custom/portal")) {
            $custom_files = findAllFiles("custom/portal", array());
        }
        $all_src_files = array_merge($root_files, $custom_files);
        foreach ($all_src_files as $src_file) {
            $ignore = false;
            foreach ($disc_client_ignore as $ignore_pattern) {
                if (preg_match("#" . $ignore_pattern . "#", $src_file)) {
                    $ignore = true;
                }
            }
            if (!$ignore) {
                $value = md5_file($src_file);
                //we have to strip off portal or custom/portal before the src file to look it up
                $key = str_replace('custom/portal/', '', $src_file);
                $key = str_replace('portal/', '', $key);
                if ($client_file_list != null && isset($client_file_list[$key])) {
                    if ($value != $client_file_list[$key]) {
                        //we have found a file out of sync
                        $file_list[] = $src_file;
                        //since we have processed this element of the client
                        //list of files, remove it from the list
                    }
                    unset($client_file_list[$key]);
                } else {
                    //this file does not exist on the client side
                    $file_list[] = $src_file;
                }
            }
        }
    }
    zip_files_list($zip_file, $file_list, '|.*portal/|');
    $contents = sugar_file_get_contents($zip_file);
    // encode data
    $data = base64_encode($contents);
    unlink($zip_file);
    return array('result' => $data, 'error' => $error->get_soap_array());
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:100,代码来源:SoapUpgradeUtils.php


示例14: constant

 if (empty($errors)) {
     $file = "{$unzip_dir}/" . constant('SUGARCRM_PRE_INSTALL_FILE');
     if (is_file($file)) {
         $out .= "{$mod_strings['LBL_UW_INCLUDING']}: {$file} <br>\n";
         include $file;
         logThis('Running pre_install()...');
         pre_install();
         logThis('pre_install() done.');
     }
 }
 ////	HANDLE PREINSTALL SCRIPTS
 ///////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////
 ////	COPY NEW FILES INTO TARGET INSTANCE
 logThis('Starting file copy process...');
 $newFiles = findAllFiles(clean_path($unzip_dir . '/' . $zip_from_dir), array());
 $zipPath = clean_path($unzip_dir . '/' . $zip_from_dir);
 $doNotOverwrite = explode('::', $_REQUEST['overwrite_files_serial']);
 $copiedFiles = array();
 $skippedFiles = array();
 foreach ($newFiles as $file) {
     $cleanFile = str_replace($zipPath, '', $file);
     $srcFile = $zipPath . $cleanFile;
     $targetFile = clean_path(getcwd() . '/' . $cleanFile);
     if (!is_dir(dirname($targetFile))) {
         mkdir_recursive(dirname($targetFile));
         // make sure the directory exists
     }
     if (!file_exists($targetFile) || !in_array($targetFile, $doNotOverwrite)) {
         // handle sugar_version.php
         if (strpos($targetFile, 'sugar_version.php') !== false) {
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:commit.php


示例15: die

 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 ********************************************************************************/
global $sugar_version;
if (!defined('sugarEntry') || !sugarEntry) {
    die('Not A Valid Entry Point');
}
///////////////////////////////////////////////////////////////////////////////
////	DYNAMICALLY GENERATE UPGRADEWIZARD MODULE FILE LIST
$uwFilesCurrent = findAllFiles('modules/UpgradeWizard/', array());
// handle 4.x to 4.5.x+ (no UpgradeWizard module)
if (count($uwFilesCurrent) < 5) {
    $uwFiles = array('modules/UpgradeWizard/language/en_us.lang.php', 'modules/UpgradeWizard/cancel.php', 'modules/UpgradeWizard/commit.php', 'modules/UpgradeWizard/commitJson.php', 'modules/UpgradeWizard/end.php', 'modules/UpgradeWizard/Forms.php', 'modules/UpgradeWizard/index.php', 'modules/UpgradeWizard/Menu.php', 'modules/UpgradeWizard/preflight.php', 'modules/UpgradeWizard/preflightJson.php', 'modules/UpgradeWizard/start.php', 'modules/UpgradeWizard/su_utils.php', 'modules/UpgradeWizard/su.php', 'modules/UpgradeWizard/systemCheck.php', 'modules/UpgradeWizard/systemCheckJson.php', 'modules/UpgradeWizard/upgradeWizard.js', 'modules/UpgradeWizard/upload.php', 'modules/UpgradeWizard/uw_ajax.php', 'modules/UpgradeWizard/uw_files.php', 'modules/UpgradeWizard/uw_main.tpl', 'modules/UpgradeWizard/uw_utils.php');
} else {
    $uwFilesCurrent = findAllFiles('ModuleInstall', $uwFilesCurrent);
    $uwFilesCurrent = findAllFiles('include/javascript/yui', $uwFilesCurrent);
    $uwFilesCurrent[] = 'HandleAjaxCall.php';
    $uwFiles = array();
    foreach ($uwFilesCurrent as $file) {
        $uwFiles[] = str_replace("./", "", clean_path($file));
    }
}
////	END DYNAMICALLY GENERATE UPGRADEWIZARD MODULE FILE LIST
///////////////////////////////////////////////////////////////////////////////
$uw_files = array('log4php.properties', 'include/utils/encryption_utils.php', 'include/Pear/Crypt_Blowfish/Blowfish.php', 'include/Pear/Crypt_Blowfish/Blowfish/DefaultKey.php', 'include/utils.php', 'include/language/en_us.lang.php', 'include/modules.php', 'include/Localization/Localization.php', 'install/language/en_us.lang.php', 'XTemplate/xtpl.php', 'include/database/DBHelper.php', 'include/database/DBManager.php', 'include/database/DBManagerFactory.php', 'include/database/MssqlHelper.php', 'include/database/MssqlManager.php', 'include/database/MysqlHelper.php', 'include/database/MysqlManager.php', 'include/database/DBManagerFactory.php');
$uw_files = array_merge($uw_files, $uwFiles);
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:31,代码来源:uw_files.php


示例16: findAllFiles

/**
* finds all files in the passed path, but skips select directories
* @param string dir Relative path
* @param array the_array Collections of found files/dirs
* @param bool include_dir True if we want to include directories in the
* returned collection
*/
function findAllFiles($dir, $the_array, $include_dirs = false, $skip_dirs = array(), $echo = false)
{
    // check skips
    foreach ($skip_dirs as $skipMe) {
        if (strpos(clean_path($dir), $skipMe) !== false) {
            return $the_array;
        }
    }
    $d = dir($dir);
    while ($f = $d->read()) {
        if ($f == "." || $f == "..") {
            // skip *nix self/parent
            continue;
        }
        if (is_dir("{$dir}/{$f}")) {
            if ($include_dirs) {
                // add the directory if flagged
                $the_array[] = clean_path("{$dir}/{$f}");
            }
            // recurse in
            $the_array = findAllFiles("{$dir}/{$f}/", $the_array, $include_dirs, $skip_dirs, $echo);
        } else {
            $the_array[] = clean_path("{$dir}/{$f}");
        }
    }
    rsort($the_array);
    return $the_array;
}
开发者ID:joomux,项目名称:jTips,代码行数:35,代码来源:functions.inc.php


示例17: getSources

 /**
  * getSources
  * Returns an Array of source entries found under the given directory
  * @param String $directory The directory to search
  * @return mixed $sources An Array of source entries
  */
 private static function getSources($directory = 'modules/Connectors/connectors/sources')
 {
     if (file_exists($directory)) {
         $files = array();
         $files = findAllFiles($directory, $files, false, 'config\\.php');
         $start = strrpos($directory, '/') == strlen($directory) - 1 ? strlen($directory) : strlen($directory) + 1;
         $sources = array();
         $sources_ordering = array();
         foreach ($files as $file) {
             require $file;
             $end = strrpos($file, '/') - $start;
             $source = array();
             $source['id'] = str_replace('/', '_', substr($file, $start, $end));
             $source['name'] = !empty($config['name']) ? $config['name'] : $source['id'];
             $source['enabled'] = true;
             $source['directory'] = $directory . '/' . str_replace('_', '/', $source['id']);
             $order = isset($config['order']) ? $config['order'] : 99;
             //default to end using 99 if no order set
             $instance = ConnectorFactory::getInstance($source['id']);
             $source['eapm'] = empty($config['eapm']) ? false : $config['eapm'];
             $mapping = $instance->getMapping();
             $modules = array();
             if (!empty($mapping['beans'])) {
                 foreach ($mapping['beans'] as $module => $mapping_entry) {
                     $modules[] = $module;
                 }
             }
             $source['modules'] = $modules;
             $sources_ordering[$source['id']] = array('order' => $order, 'source' => $source);
         }
         usort($sources_ordering, 'sources_sort_function');
         foreach ($sources_ordering as $entry) {
             $sources[$entry['source']['id']] = $entry['source'];
         }
         return $sources;
     }
     return array();
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:44,代码来源:ConnectorUtils.php


示例18: jimport

 * Website: www.jtips.com.au
 * @since 08 July 2009
 *
 * Description:
 *
 *
 */
global $jLang;
global $mosConfig_absolute_path;
if (isJoomla15()) {
    $dir = $mosConfig_absolute_path . DS . 'components' . DS . 'com_jtips' . DS . 'css' . DS;
    jimport('joomla.filesystem.folder');
    $files = JFolder::files($dir);
} else {
    $dir = $mosConfig_absolute_path . '/components/com_jtips/css/';
    $files = findAllFiles($dir);
}
// get the key of the index.html file
$flipped = array_flip($files);
unset($files[$flipped['index.html']]);
sort($files);
$filekeys = jTipsGetParam($_REQUEST, 'cid', array());
$key = array_shift($filekeys);
if (isJoomla15()) {
    jimport('joomla.filesystem.file');
    $content = JFile::read($dir . $files[$key]);
} else {
    $content = file_get_contents($dir . $files[$key]);
}
$title = $jLang['_ADMIN_STYLE_EDIT'];
$formData = array('fieldset' => array('legend' => '_ADMIN_STYLE_EDIT', 'fields' => array('label' => array('label' => '_ADMIN_STYLE_FILENAME', 'field' => array('type' => 'label', 'attributes' => array('value' => $files[$key], 'type' => 'label'))), 'content' => array('label' => '_ADMIN_STYLE_CONTENT', 'field' => array('type' => 'textarea', 'attributes' => array('style' => "width:100%;height:400px;", 'name' => 'jstyle'), 'text' => $content)), 'cid' => array('label' => '', 'field' => array('type' => 'hidden', 'attributes' => array('value' => $key, 'name' => 'cid', 'type' => 'hidden'))), 'filename' => array('label' => '', 'field' => array('type' => 'hidden', 'attributes' => array('value' => $files[$key], 'name' => 'filename', 'type' => 'hidden'))))));
开发者ID:joomux,项目名称:jTips,代码行数:31,代码来源:edit.php


示例19: unlinkTempFiles

 /**
  * deletes files created by unzipping a package
  */
 function unlinkTempFiles()
 {
     global $sugar_config;
     global $path;
     logThis('at unlinkTempFiles()');
     $tempDir = '';
     $sugar_config['upload_dir'] = 'cache/upload/';
     //if(isset($sugar_config['upload_dir']) && $sugar_config['upload_dir'] != null && $sugar_config['upload_dir']=='cache/upload/'){
     $tempDir = clean_path(getcwd() . '/' . $sugar_config['upload_dir'] . 'upgrades/temp');
     /*	}
     	else{
     		$uploadDir = getcwd()."/".'cache/upload/';
     		$tempDir = clean_path(getcwd().'/'.$uploadDir.'upgrades/temp');
     	}*/
     if (file_exists($tempDir) && is_dir($tempDir)) {
         $files = findAllFiles($tempDir, array(), false);
         rsort($files);
         foreach ($files as $file) {
             if (!is_dir($file)) {
                 logThis('unlinking [' . $file . ']', $path);
                 @unlink($file);
             }
         }
         // now do dirs
         $files = findAllFiles($tempDir, array(), true);
         foreach ($files as $dir) {
             if (is_dir($dir)) {
                 logThis('removing dir [' . $dir . ']', $path);
                 @rmdir($dir);
             }
         }
         $cacheFile = "modules/UpgradeWizard/_persistence.php";
         if (is_file($cacheFile)) {
             logThis("U 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP findFiles函数代码示例发布时间:2022-05-15
下一篇:
PHP find函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap