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

PHP hashToFile函数代码示例

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

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



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

示例1: run

 public function run()
 {
     require_once 'ModuleInstall/PackageManager/PackageManager.php';
     $pm = new PackageManager();
     $packages = $pm->getinstalledPackages(array('module'));
     foreach ($packages as $pack) {
         if (strpos($pack['name'], 'SugarCRM Upgrader') !== false) {
             $uh = new UpgradeHistory();
             $uh->name = $pack['name'];
             $history = $uh->checkForExisting($uh);
             $this->filesToRemove[] = "custom/Extension/application/Ext/Include/{$history->id_name}.php";
             $history->delete();
             $this->fileToDelete($this->filesToRemove);
             $this->log("Useless files of {$pack['name']} v{$pack['version']} removed");
         }
     }
     foreach ($pm->getPackagesInStaging() as $pack) {
         if (strpos($pack['name'], 'SugarCRM Upgrader') !== false) {
             $file = UploadStream::getFSPath(hashToFile($pack['file']));
             $this->fileToDelete($file);
             foreach (array('manifest', 'icon') as $meta) {
                 $this->fileToDelete(pathinfo($file, PATHINFO_DIRNAME) . '/' . pathinfo($file, PATHINFO_FILENAME) . "-{$meta}.php");
             }
         }
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:26,代码来源:8_RemoveWebUpgrader.php


示例2: remove

 function remove()
 {
     $json = getJSONobj();
     $file = '';
     if (isset($_REQUEST['file'])) {
         $file = urldecode(hashToFile($_REQUEST['file']));
     }
     $GLOBALS['log']->debug("FILE TO REMOVE: " . $file);
     if (!empty($file)) {
         unlink($file);
         foreach (array("manifest", "icon") as $meta) {
             $this->rmMetaFile($file, $meta);
         }
     }
     echo 'result = ' . $json->encode(array('result' => 'true'));
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:16,代码来源:PackageController.php


示例3: disable_copy

 function disable_copy()
 {
     //when we disable we want to copy the -restore files back into the file system
     //but we should check the version in the module install against the version on the file system
     //if they match then we can copy the file back, but otherwise we should ask the user.
     //		$GLOBALS['log']->debug('ModuleInstaller.php->disable_copy()');
     if (isset($GLOBALS['mi_overwrite_files']) && $GLOBALS['mi_overwrite_files']) {
         //		$GLOBALS['log']->debug('ModuleInstaller.php->disable_copy():mi_overwrite_files=true');
         if (!empty($this->installdefs['copy'])) {
             //				$GLOBALS['log']->debug('ModuleInstaller.php->disable_copy(): installdefs not empty');
             foreach ($this->installdefs['copy'] as $cp) {
                 $cp['to'] = clean_path(str_replace('<basepath>', $this->base_dir, $cp['to']));
                 $backup_path = clean_path(remove_file_extension(urldecode(hashToFile($_REQUEST['install_file']))) . "-restore/" . $cp['to']);
                 // bug 16966 tyoung - replaced missing assignment to $backup_path
                 //check if this file exists in the -restore directory
                 //					$GLOBALS['log']->debug("ModuleInstaller.php->disable_copy(): backup_path=".$backup_path);
                 if (file_exists($backup_path)) {
                     //since the file exists, then we want do an md5 of the install version and the file system version
                     $from = str_replace('<basepath>', $this->base_dir, $cp['from']);
                     //if(is_file($from) && md5_file($from) == md5_file($cp['to'])){
                     //since the files are the same then we can safely move back from the -restore
                     //directory into the file system
                     $GLOBALS['log']->debug("DISABLE COPY:: FROM: " . $backup_path . " TO: " . $cp['to']);
                     $this->copy_path($backup_path, $cp['to']);
                     /*}else{
                     			//since they are not equal then we need to prompt the user
                     		}*/
                 }
                 //fi
             }
             //rof
         }
         //fi
     }
     //fi
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:36,代码来源:ModuleInstaller.php


示例4: unset

require_once 'modules/Administration/UpgradeWizardCommon.php';
require_once 'include/SugarSmarty/plugins/function.sugar_csrf_form_token.php';
unset($_SESSION['rebuild_relationships']);
unset($_SESSION['rebuild_extensions']);
// process commands
if (empty($_REQUEST['install_file'])) {
    die($mod_strings['LBL_UPGRADE_WIZARD_FILE_NOT_SPEC']);
}
if (!isset($_REQUEST['mode']) || $_REQUEST['mode'] == "") {
    die($mod_strings['LBL_UPGRADE_WIZARD_NO_MODE_SPEC']);
}
if (!file_exists($base_tmp_upgrade_dir)) {
    mkdir($base_tmp_upgrade_dir, 0755, true);
}
$unzip_dir = mk_temp_dir($base_tmp_upgrade_dir);
$install_file = hashToFile($_REQUEST['install_file']);
$hidden_fields = "";
$new_lang_name = "";
$new_lang_desc = "";
$mode = $_REQUEST['mode'];
$hidden_fields .= "<input type=hidden name=\"mode\" value=\"{$mode}\"/>";
$hidden_fields .= smarty_function_sugar_csrf_form_token(array(), $smarty);
$install_type = UpgradeWizardCommon::getInstallType($install_file);
$version = "";
$previous_version = "";
$show_files = true;
$zip_from_dir = ".";
$zip_to_dir = ".";
$zip_force_copy = array();
$license_file = $unzip_dir . '/LICENSE';
$readme_file = $unzip_dir . '/README.txt';
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:31,代码来源:UpgradeWizard_prepare.php


示例5: copy

                    copy($manifest_file, $target_manifest);
                    $GLOBALS['ML_STATUS_MESSAGE'] = $base_filename . $mod_strings['LBL_UW_UPLOAD_SUCCESS'];
                } else {
                    $GLOBALS['ML_STATUS_MESSAGE'] = $mod_strings['ERR_UW_UPLOAD_ERROR'];
                }
            } else {
                unlinkTempFiles();
                die($mod_strings['ERR_UW_NO_MANIFEST']);
            }
        }
    } else {
        if ($run == $mod_strings['LBL_UW_BTN_DELETE_PACKAGE']) {
            if (!empty($_REQUEST['install_file'])) {
                die($mod_strings['ERR_UW_NO_UPLOAD_FILE']);
            }
            $delete_me = hashToFile($delete_me);
            $checkFile = strtolower($delete_me);
            if (substr($delete_me, -4) != ".zip" || substr($delete_me, 0, 9) != "upload://" || strpos($checkFile, "..") !== false || !file_exists($checkFile)) {
                die("<span class='error'>File is not a zipped archive.</span>");
            }
            if (unlink($delete_me)) {
                // successful deletion?
                echo "Package {$delete_me} has been removed.<br>";
            } else {
                die("Problem removing package {$delete_me}.");
            }
        }
    }
}
if ($view == "module") {
    print getClassicModuleTitle($mod_strings['LBL_MODULE_NAME'], array($mod_strings['LBL_MODULE_LOADER_TITLE']), false);
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:31,代码来源:UpgradeWizard.php


示例6: remove

 function remove()
 {
     $json = getJSONobj();
     $file = '';
     if (isset($_REQUEST['file'])) {
         $file = urldecode(hashToFile($_REQUEST['file']));
     }
     $GLOBALS['log']->debug("FILE TO REMOVE: " . $file);
     if (!empty($file)) {
         unlink($file);
     }
     echo 'result = ' . $json->encode(array('result' => 'true'));
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:13,代码来源:PackageController.php


示例7: testhashToFile

 public function testhashToFile()
 {
     //execute the method and test if it returns expected values
     //test with invalid hash.
     $actual = hashToFile('');
     $this->assertFalse($actual);
     //test with a newly generated hash
     $hash = fileToHash('config.php');
     $actual = hashToFile($hash);
     $this->assertSame('config.php', $actual);
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:11,代码来源:fileUtilsTest.php


示例8: remove

 function remove()
 {
     require_once 'include/json_config.php';
     $json_config = new json_config();
     $json = getJSONobj();
     $file = '';
     if (isset($_REQUEST['file'])) {
         $file = hashToFile($_REQUEST['file']);
     }
     $GLOBALS['log']->debug("FILE TO REMOVE: " . $file);
     if (!empty($file)) {
         unlink($file);
     }
     echo 'result = ' . $json->encode(array('result' => 'true'));
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:15,代码来源:PackageController.php



注:本文中的hashToFile函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP hash_algos函数代码示例发布时间:2022-05-15
下一篇:
PHP hashPassword函数代码示例发布时间: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