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

PHP zip函数代码示例

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

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



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

示例1: displayMainPageCategories

function displayMainPageCategories($data)
{
    $categories = DBHelper::verticalSlice($data, "name");
    $numbers = range(1, count($categories));
    $width = 100 / count($categories) . '%%';
    $arr = zip($numbers, $categories);
    $start = '<div class="section group">';
    $fmt = '<div data-tab="%d" class="tab-items col main-tabs" style="width: ' . $width . '"><div id="tabLabel">%s</div></div>';
    $end = '</div>';
    return htmlLoop($arr, $start, $fmt, $end);
}
开发者ID:soengle,项目名称:BringIt,代码行数:11,代码来源:phpToHTML.php


示例2: backupF

 private function backupF()
 {
     $b_name = 'backup_' . date("Y-m-d_H-i-s") . '.zip';
     if (zip(dirname(getcwd()), '../upload/files/' . $b_name)) {
         header('Content-Type: application/zip');
         header('Content-Disposition: attachment; filename="' . $b_name . '"');
         header('Cache-Control: max-age=0');
         readfile('../upload/files/' . $b_name);
         exit;
     }
 }
开发者ID:wharin,项目名称:quantum,代码行数:11,代码来源:control.php


示例3: goapk

function goapk($file)
{
    exec("del bbshenqi.zip");
    exec("del bbshenqi.apk");
    exec("del gosign.bat");
    exec("del D:\\android\\apk\\bbshenqi\\assets\\unionid.txt");
    exec("copy /Y demo.bat gosign.bat");
    file_content_replace("gosign.bat", "00000.apk", $file . '.apk');
    exec('echo ' . $file . '>D:\\android\\apk\\bbshenqi\\assets\\unionid.txt');
    zip("bbshenqi", "bbshenqi.zip");
    exec("copy /Y bbshenqi.zip bbshenqi.apk");
    exec("gosign.bat");
}
开发者ID:vb2005xu,项目名称:automake-apk-php,代码行数:13,代码来源:markapk.php


示例4: zip

 function zip($srcdir, $webdir, $zip, $srcdirvlu)
 {
     $dir = opendir($srcdir);
     while (false !== ($file = readdir($dir))) {
         if ($file != '.' && $file != '..') {
             if (is_dir($srcdir . $file)) {
                 $filepath = str_replace($srcdirvlu, '', $srcdir . $file);
                 zip($srcdir . $file . '/', $filepath . '/', $zip, $srcdirvlu);
             } else {
                 $zip->addFile($srcdir . $file, $webdir . $file);
             }
         }
     }
     closedir($dir);
 }
开发者ID:appsystem,项目名称:appmoney712-app-creation-system-phpbuiltinserver,代码行数:15,代码来源:zip.php


示例5: str_replace

mystep;
            $result = str_replace("/*--settings--*/", makeVarsCode($setting_sub, '$setting_sub'), $result);
            WriteFile(ROOT_PATH . "/include/config_" . $_POST['idx'][$i] . ".php", $result, "w");
        }
        $idx = "";
        break;
    case "export":
        $log_info = $setting['language']['admin_web_template_export'];
        require ROOT_PATH . "/source/class/myzip.class.php";
        $dir = ROOT_PATH . "/" . $setting['path']['upload'] . "/tmp/";
        $zipfile = $dir . "template_" . $idx . ".zip";
        @unlink($zipfile);
        $files = array();
        $files[] = $tpl_path . $idx . "/";
        $files[] = ROOT_PATH . "/images/" . $idx . "/";
        if (zip($files, $zipfile, ROOT_PATH . "/")) {
            $content = file_get_contents($zipfile);
            header("Content-type: application/zip");
            header("Accept-Ranges: bytes");
            header("Accept-Length: " . strlen($content));
            header("Content-Disposition: attachment; filename=" . getSafeCode("template_" . $idx . ".zip", "utf-8"));
            echo $content;
        } else {
            showInfo($setting['language']['admin_web_template_export_error']);
        }
        break;
    case "upload":
        $log_info = $setting['language']['admin_web_template_upload'];
        if (count($_POST) > 0) {
            $path_upload = $setting['path']['upload'] . "/tmp/" . date("Ym") . "/";
            $upload = new MyUploader();
开发者ID:laiello,项目名称:mystep-cms,代码行数:31,代码来源:web_template.php


示例6: elseif

     }
 } elseif (isset($_GP['touchok'])) {
     $s_datenew = strtotime($_GP['touchok']);
     foreach ($s_lists as $s_l) {
         if (touch($s_l, $s_datenew)) {
             $s_counter++;
         }
     }
     if ($s_counter > 0) {
         $s_result .= notif($s_counter . " items changed access and modification time to " . @date("d-M-Y H:i:s", $s_datenew));
     } else {
         $s_result .= notif("No items modified");
     }
 } elseif (isset($_GP['compresszipok'])) {
     $s_file = $_GP['compresszipok'];
     if (zip($s_lists, $s_file)) {
         $s_result .= notif("Archive created : " . hss($s_file));
     } else {
         $s_result .= notif("Error creating archive file");
     }
 } elseif (isset($_GP['compresstarok'])) {
     $s_lists_ = array();
     $s_file = $_GP['compresstarok'];
     $s_file = basename($s_file);
     $s_lists__ = array_map("basename", $s_lists);
     $s_lists_ = array_map("pf", $s_lists__);
     exe("tar cf \"" . $s_file . "\" " . implode(" ", $s_lists_));
     if (@is_file($s_file)) {
         $s_result .= notif("Archive created : " . hss($s_file));
     } else {
         $s_result .= notif("Error creating archive file");
开发者ID:engmohamedamer,项目名称:gotest,代码行数:31,代码来源:dl.php


示例7: ss

 $dltype = ss($_REQUEST['dltype']);
 $dlpath = ss($_REQUEST['dlpath']);
 $dlname = basename($dlpath);
 if ($dlpath == ".") {
     $dlname = basename($cwd);
 } elseif ($dlpath == "..") {
     chdir("..");
     $dlname = basename(getcwd());
     chdir($cwd);
 }
 $tmpdir = get_writabledir();
 $dlarchive = $tmpdir . $dlname;
 $dlthis = "";
 if ($dltype == "ziparchive") {
     $dlarchive .= ".zip";
     if (zip($dlpath, $dlarchive)) {
         $dlthis = $dlarchive;
     }
 } elseif ($dltype == "tar") {
     $dlarchive .= ".tar";
     $dlarchive = str_replace('\\', '/', $dlarchive);
     exe("tar cf " . $dlarchive . " " . $dlpath);
     $dlthis = $dlarchive;
 } elseif ($dltype == "targz") {
     $dlarchive .= ".tar.gz";
     $dlarchive = str_replace('\\', '/', $dlarchive);
     exe("tar czf " . $dlarchive . " " . $dlpath);
     $dlthis = $dlarchive;
 } elseif ($dltype == "raw") {
     if (is_file($dlpath)) {
         $dlthis = $dlpath;
开发者ID:retanoj,项目名称:webshellSample,代码行数:31,代码来源:45286f060073a61bcef5e330311a00b8.php


示例8: compress

 function compress($type, $archive, $files)
 {
     if (!is_array($files)) {
         $files = array($files);
     }
     if ($type == 'zip') {
         if (zip($files, $archive)) {
             return true;
         } else {
             return false;
         }
     } elseif ($type == 'tar' || $type == 'targz') {
         $archive = basename($archive);
         $listsBasename = array_map("basename", $files);
         $lists = array_map("wrap_with_quotes", $listsBasename);
         if ($type == 'tar') {
             execute("tar cf \"" . $archive . "\" " . implode(" ", $lists));
         } elseif ($type == 'targz') {
             execute("tar czf \"" . $archive . "\" " . implode(" ", $lists));
         }
         if (is_file($archive)) {
             return true;
         } else {
             return false;
         }
     }
     return false;
 }
开发者ID:retanoj,项目名称:webshellSample,代码行数:28,代码来源:7394316867fbf40088309b5150e77721.php


示例9: isset

    return $zip->close();
}
$manual = isset($_GET['manual']) ? $_GET['manual'] === 'true' ? true : false : false;
$sourcecode = isset($_GET['sourcecode']) ? $_GET['sourcecode'] === 'true' ? true : false : false;
$bootstrap = isset($_GET['bootstrap']) ? $_GET['bootstrap'] === 'true' ? true : false : false;
$jquery = isset($_GET['jquery']) ? $_GET['jquery'] === 'true' ? true : false : false;
$array = array();
$filename_begin = 'OSS_Web_Development_Workshop(';
$filename = array();
$filename_end = ').zip';
if ($manual) {
    $array[] = 'manual.pptx';
    $filename[] = 'manual';
}
if ($sourcecode) {
    $array[] = 'static/';
    $array[] = 'download.php';
    $array[] = 'get.php';
    $array[] = 'index.php';
    $filename[] = 'sourcecode';
}
if ($bootstrap) {
    $array[] = 'bootstrap/';
    $filename[] = 'bootstrap';
}
if ($jquery) {
    $array[] = 'jquery/';
    $filename[] = 'jquery';
}
zip($array, './cache/' . $filename_begin . implode(', ', $filename) . $filename_end, dirname(__FILE__));
header('Location: /cache/' . $filename_begin . implode(', ', $filename) . $filename_end);
开发者ID:pvtuan10,项目名称:Workshops,代码行数:31,代码来源:get.php


示例10: rar

     require CLASS_DIR . 'options/rar.php';
     rar();
     break;
 case 'rar_go':
     if (!empty($options['disable_rar'])) {
         break;
     }
     require CLASS_DIR . 'options/rar.php';
     rar_go();
     break;
 case 'zip':
     if (!empty($options['disable_zip'])) {
         break;
     }
     require CLASS_DIR . 'options/zip.php';
     zip();
     break;
 case 'zip_go':
     if (!empty($options['disable_zip'])) {
         break;
     }
     require CLASS_DIR . 'options/zip.php';
     zip_go();
     break;
 case 'pack':
     if (!empty($options['disable_tar'])) {
         break;
     }
     require CLASS_DIR . 'options/pack.php';
     rl_pack();
     break;
开发者ID:mewtutorial,项目名称:RapidTube,代码行数:31,代码来源:options.php


示例11: date

 $log_info = $setting['language']['admin_func_backup_export'];
 $dir = ROOT_PATH . "/" . $setting['path']['upload'] . "/tmp/";
 if ($table_name == "all") {
     require ROOT_PATH . "/source/class/myzip.class.php";
     $zipfile = $dir . date("Ymd") . "_db_all.zip";
     $dir = $dir . date("Ymd") . "_db_all/";
     $tbl_list = $db->GetTabs($setting['db']['name']);
     $max_count = count($tbl_list);
     $files = array();
     for ($i = 0; $i < $max_count; $i++) {
         $content = "DROP TABLE IF EXISTS `{$tbl_list[$i]}`;\n\n";
         $content .= $db->GetTabSetting($tbl_list[$i], $setting_sub['db']['name']) . "\n" . $db->GetTabData($setting_sub['db']['name'] . "." . $tbl_list[$i]);
         $files[$i] = $dir . $setting_sub['db']['name'] . "_" . $tbl_list[$i] . ".sql";
         WriteFile($files[$i], $content);
     }
     zip($files, $zipfile, $dir);
     header("Content-type: application/zip");
     header("Accept-Ranges: bytes");
     header("Accept-Length: " . filesize($zipfile));
     header("Content-Disposition: attachment; filename=" . basename($zipfile));
     $content = GetFile($zipfile);
     MultiDel($dir);
     unlink($zipfile);
 } else {
     $content = "DROP TABLE IF EXISTS `{$table_name}`;\n\n";
     $content .= $db->GetTabSetting($table_name) . "\n" . $db->GetTabData($table_name);
     header("Content-type: text/plain");
     header("Accept-Ranges: bytes");
     header("Accept-Length: " . strlen($content));
     header("Content-Disposition: attachment; filename=" . date("Ymd") . "_db_{$table_name}.sql");
 }
开发者ID:laiello,项目名称:mystep-cms,代码行数:31,代码来源:func_backup.php


示例12: header

        }
    }
    header('location:index.php?p=admin&token=' . TOKEN);
    exit;
}
# zip multiselection
if (!empty($_POST['item']) && !empty($_POST['multiselect_command']) && $_POST['multiselect_command'] == 'zip' && $_SESSION['zip']) {
    $zipfile = $_SESSION['temp_folder'] . 'Bozon_pack' . date('d-m-Y h-i-s') . '.zip';
    $file_list = array();
    foreach ($_POST['item'] as $key => $item) {
        $file_list[] = id2file($item);
    }
    if (!is_dir($_SESSION['temp_folder'])) {
        mkdir($_SESSION['temp_folder']);
    }
    zip($file_list, $zipfile);
    header('location: ' . $zipfile);
    exit;
}
# Lock folder with password
if (!empty($_POST['pass']) && !empty($_POST['id']) && !empty($_POST['confirm']) && is_owner($_POST['id']) && $_POST['confirm'] == $_POST['pass']) {
    $id = $_POST['id'];
    $file = id2file($id);
    $password = blur_password($_POST['pass']);
    # turn normal share id into password hashed id
    $ids = unstore();
    unset($ids[$id]);
    $ids[$password . $id] = $file;
    store($ids);
    header('location:index.php?p=admin&token=' . TOKEN);
    exit;
开发者ID:Pluxopolis,项目名称:BoZoN,代码行数:31,代码来源:GET_POST_admin_data.php


示例13: count

         $m = count($list);
         if ($m > 0) {
             require ROOT_PATH . "/source/class/myzip.class.php";
             $dir = ROOT_PATH . "/" . $setting['path']['upload'] . "/tmp/";
             $zipfile = $dir . "update_" . date("Ymd") . ".zip";
             @unlink($zipfile);
             $dir = $dir . "update/" . date("Ymd/");
             $files = array();
             for ($i = 0; $i < $m; $i++) {
                 if ($update_info['content'][$list[$i]] == ".") {
                     continue;
                 }
                 $files[$i] = $dir . $update_info['file'][$list[$i]];
                 WriteFile($files[$i], $update_info['content'][$list[$i]], "wb");
             }
             if (zip($files, $zipfile, $dir)) {
                 $link = $setting['web']['url'] . "/" . $setting['path']['upload'] . "/tmp/" . basename($zipfile);
             }
             MultiDel($dir);
         }
     }
     echo $link;
     break;
 default:
     $header = array();
     $header['Referer'] = "http://" . $req->GetServer("HTTP_HOST");
     $header['ms_sign'] = $setting['web']['sign'];
     $check_info = GetRemoteContent($setting['gen']['update'] . "?m=check&v=" . $ms_version['ver'] . "&cs=" . $setting['gen']['charset'], $header);
     $check_info = chg_charset($check_info, "utf-8", $setting['gen']['charset']);
     echo $check_info;
     break;
开发者ID:laiello,项目名称:mystep-cms,代码行数:31,代码来源:update.php


示例14: db_delete

/**
* "Deletes" a database: makes a .sql dump of the database content
* and zips all files related to this db.
*
* @param mixed $db Database name WITHOUT hdb extension
*/
function db_delete($db, $verbose = true)
{
    if (db_dump($db)) {
        // Create DELETED_DATABASES directory if needed
        $folder = HEURIST_UPLOAD_ROOT . "DELETED_DATABASES/";
        if (!file_exists($folder)) {
            mkdir($folder, 0777, true);
        }
        // Zip $source to $file
        $source = HEURIST_UPLOAD_ROOT . $db;
        $destination = $folder . $db . "_" . time() . ".zip";
        if (zip($source, $destination)) {
            // Delete $source folder
            deleteFolder($source);
            if ($verbose) {
                echo "<br/>Folder " . $source . " has been deleted";
            }
            // Delete from MySQL
            $mysqli = server_connect();
            $mysqli->query("DROP DATABASE hdb_" . $db);
            $mysqli->close();
            if ($verbose) {
                echo "<br/>Database " . $db . " has been dropped";
            }
            return true;
        } else {
            if ($verbose) {
                echo "<br/>Failed to zip " . $source . " to " . $destination;
            }
        }
    } else {
        if ($verbose) {
            echo "<br/>Failed to dump database " . $db . " to a .sql file";
        }
    }
    return false;
}
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:43,代码来源:dbUtils.php


示例15: d

d('# Dependencies');
$result->composer = copyDependencyToBuild('/composer');
i($result->composer, 'composer');
$result->o80 = copyDependencyToBuild('/o80/i18n/src');
i($result->o80, 'o80-i18n');
$result->smarty = copyDependencyToBuild('/smarty/smarty/libs');
i($result->smarty, 'smarty');
$result->autoload = @copy(VENDOR . '/autoload.php', BUILD_VENDOR . '/autoload.php');
i($result->autoload, 'autoload');
// Copy assets
d('# Assets');
copyFiles(array('css', 'fonts', 'images', 'js'), $result);
// Copy sources
d('# Source directories');
copyFiles(array('admin', 'app', 'locale', 'tpl'), $result);
d('# Source files');
$files = array('adminstuds.php', 'bandeaux.php', 'create_classic_poll.php', 'create_date_poll.php', 'create_poll.php', 'exportcsv.php', 'favicon.ico', 'htaccess.txt', 'index.php', 'INSTALL.md', 'LICENCE.fr.txt', 'LICENSE.en.txt', 'maintenance.php', 'php.ini', 'README.md', 'robots.txt', 'studs.php');
copyFiles($files, $result);
// Zip Dist
$output = DIST . '/framadate-' . VERSION . '-' . date('Ymd') . '.zip';
zip(BUILD, $output);
rrmdir(BUILD);
if (isset($_GET['verbose'])) {
    var_dump($result);
}
d('--------');
d('Distribution file: ' . realpath($output));
$generatedIn = round(microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'], 4);
d('========');
d('Generated in: ' . $generatedIn . ' secondes');
echo '</pre>';
开发者ID:blr21560,项目名称:framadate,代码行数:31,代码来源:packaging.php


示例16: getData

function getData($orderArrayL, $term)
{
    //Create some new empty arrays for our sorted responses
    $role = [];
    $hearAbout = [];
    $condition = [];
    $symptoms = [];
    //We want to keep these unique replies, but separately, for graphing/tracking ease
    $roleOther = [];
    $condOther = [];
    $sympOther = [];
    //Extracting data
    foreach ($orderArrayL as $orderArray) {
        foreach ($orderArray['note_attributes'] as $notes) {
            if ($notes['name'] == 'role-other') {
                array_push($roleOther, $notes['value']);
            } else {
                if ($notes['name'] == 'hear-about') {
                    array_push($hearAbout, $notes['value']);
                } else {
                    if ($notes['name'] == 'condition') {
                        $multCondTemp = explode(',', $notes['value']);
                        $condition = array_merge($condition, $multCondTemp);
                    } else {
                        if ($notes['name'] == 'condition-other') {
                            $multCondOthTemp = explode(',', $notes['value']);
                            $condOther = array_merge($condOther, $multCondOthTemp);
                        } else {
                            if ($notes['name'] == 'symptoms') {
                                $multSympTemp = explode(',', $notes['value']);
                                $symptoms = array_merge($symptoms, $multSympTemp);
                            } else {
                                if ($notes['name'] == 'symptom-other') {
                                    $multSympOthTemp = explode(',', $notes['value']);
                                    $sympOther = array_merge($sympOther, $multSympOthTemp);
                                } else {
                                    if ($notes['name'] == 'role') {
                                        array_push($role, $notes['value']);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    //Now create arrays counting the number of each reply so we can graph it
    $roleCount = array_count_values($role);
    $conditionCount = array_count_values($condition);
    $symptomCount = array_count_values($symptoms);
    //People stick weird stuff into the referrer field. Lets clean it up.
    $hearAbout = str_replace(',', ' ', $hearAbout);
    //Sometimes symptoms and conditions get value "null" as string (likely an issue with an early version of the form). Lets fix those
    foreach ($symptomCount as $key => $value) {
        if ($key == 'null') {
            unset($symptomCount[$key]);
        }
    }
    foreach ($conditionCount as $key => $value) {
        if ($key == 'null') {
            unset($conditionCount[$key]);
        }
    }
    //Function to push keys into value field separated by a comma so they show up correctly in spreadsheet
    function zip(&$data, $glue = ', ')
    {
        if (!is_array($data)) {
            throw new InvalidArgumentException('First parameter must be an array');
        }
        array_walk($data, function (&$value, $key, $joinUsing) {
            $value = $key . $joinUsing . $value;
        }, $glue);
    }
    //Do the formatting for each array and push each into its own csv file in our local Google Drive folder.
    //Google Drive will sync these to the server pretty quickly. When we open the sheet we want to see, a Google
    //App script there will update the sheet with the values from this new csv.
    zip($roleCount);
    $roleFile = fopen(CSV_PATH . $term . "/csvs" . "/" . $term . "roles.csv", "w");
    foreach ($roleCount as $r) {
        fputcsv($roleFile, explode(',', $r));
    }
    fclose($roleFile);
    zip($conditionCount);
    $conditionFile = fopen(CSV_PATH . $term . "/csvs" . "/" . $term . "conditions.csv", "w");
    foreach ($conditionCount as $r) {
        fputcsv($conditionFile, explode(',', $r));
    }
    fclose($conditionFile);
    zip($symptomCount);
    $symptomFile = fopen(CSV_PATH . $term . "/csvs" . "/" . $term . "symptoms.csv", "w");
    foreach ($symptomCount as $r) {
        fputcsv($symptomFile, explode(',', $r));
    }
    fclose($symptomFile);
    $referrerFile = fopen(CSV_PATH . $term . "/csvs" . "/" . $term . "referrer.csv", "w");
    foreach ($hearAbout as $r) {
        fputcsv($referrerFile, explode(',', $r));
    }
    fclose($referrerFile);
//.........这里部分代码省略.........
开发者ID:ashvilleneuve,项目名称:snugvest,代码行数:101,代码来源:GenerateSurveyReports.php


示例17: provideTestAssertIterableFails

 public function provideTestAssertIterableFails()
 {
     (yield [function () {
         _assertIterable(new \stdClass(), 'Argument');
     }, 'Argument must be iterable']);
     (yield [function () {
         _assertIterable("foobar", 'Argument');
     }, 'Argument must be iterable']);
     (yield [function () {
         _assertAllIterable([[], new \stdClass()]);
     }, 'Argument 2 must be iterable']);
     (yield [function () {
         return count(new \stdClass());
     }, 'Argument must be iterable or implement Countable']);
     (yield [function () {
         return toIter(new \stdClass());
     }, 'Argument must be iterable']);
     (yield [function () {
         return map(function ($v) {
             return $v;
         }, new \stdClass());
     }, 'Second argument must be iterable']);
     (yield [function () {
         return chain([1], [2], new \stdClass());
     }, 'Argument 3 must be iterable']);
     (yield [function () {
         return zip([1], [2], new \stdClass());
     }, 'Argument 3 must be iterable']);
 }
开发者ID:nikic,项目名称:iter,代码行数:29,代码来源:iterTest.php


示例18: MultiDel

    @unlink($target_file);
    MultiDel($result_dir);
    sleep(1);
    mkdir($result_dir);
    $mypack = new MyPack($pack_dir, $pack_file);
    $mypack->AddIgnore(basename(dirname(__FILE__)), ".svn", "web.config", "aspnet_client", "include/install.lock", "Thumbs.db", "bak", "xcache", "_test", "config_test.php", "config-bak.php", "cfna_mis");
    if (!empty($cs)) {
        $mypack->setCharset("gbk", $cs, $lng_type, ".php,.tpl,.html,.htm,.sql");
    }
    $mypack->DoIt();
    //echo $mypack->GetResult();
    $result = "";
    $result .= GetFile("mypack.class.php");
    $result .= "\n";
    $result .= GetFile("setup.php");
    $result = str_replace("?>\n<?php", "", $result);
    WriteFile($target_file, $result, "wb");
    unset($result);
    copy("intro.txt", $result_dir . "/readme.txt");
    require "../source/class/myzip.class.php";
    rename($result_dir, "upload");
    zip("upload", "build/" . $result_dir . ".zip");
    MultiDel("upload");
}
?>
<script language="JavaScript">
location.href = "build/<?php 
echo $result_dir;
?>
.zip";
</script>
开发者ID:laiello,项目名称:mystep-cms,代码行数:31,代码来源:index.php


示例19: gZip

            $szErrorNotice .= $oMLT->get("10", "No se pudo crear archivo comprimido");
        }
        // set the ext name to download
        $szExt = ".tar.gz";
        // compress
        gZip($szDownloadPath . $szFile . ".tar", $szDownloadPath . $szFile . $szExt);
        // delete the original file
        if (file_exists($szDownloadPath . $szFile . ".tar")) {
            unlink($szDownloadPath . $szFile . ".tar");
        }
        //$szErrorNotice .= "Listo, cierre la ventana";
    } else {
        if (isset($_FORM["selCompressType"]) && strtoupper($_FORM["selCompressType"]) == "ZIP") {
            // combine shape files into zip (compressed)
            $szExt = ".zip";
            zip($aSzFiles, $szDownloadPath . $szFile . $szExt);
            //$szErrorNotice .= $szDownloadUrl;
        } else {
            // give error message
            $szErrorNotice .= $oMLT->get("4", "Falta Grabar Poligonos.  " . "o no se han dibujado.");
            //$szErrorNotice .=$_SERVER['HTTP_HOST']
        }
    }
}
/* ============================================================================
 * Determine the output filename to display
 * ========================================================================= */
if (isset($_FORM["txtDLFilename"]) && strlen(trim($_FORM["txtDLFilename"])) > 0) {
    $szDLFilename = $_FORM["txtDLFilename"];
} else {
    $szDLFilename = "Dibujos_usuario";
开发者ID:alonso,项目名称:fusion,代码行数:31,代码来源:ExtractROIData.php


示例20: dirname

*
* @param db = database name
*
* @package     Heurist academic knowledge management system
* @link        http://HeuristNetwork.org
* @copyright   (C) 2005-2016 University of Sydney
* @author      Artem Osmakov   <[email protected]>
* @author      Ian Johnson     <[email protected]>
* @license     http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @version     4.0
*/
/*
* Licensed under the GNU License, Version 3.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at http://www.gnu.org/licenses/gpl-3.0.txt
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
* See the License for the specific language governing permissions and limitations under the License.
*/
require_once dirname(__FILE__) . '/../../common/connect/applyCredentials.php';
require_once dirname(__FILE__) . '/../../common/php/dbUtils.php';
$uploadPath = HEURIST_FILESTORE_DIR;
//HEURIST_UPLOAD_ROOT.HEURIST_DBNAME;
$folders = array("rectype-icons", "settings", "smarty-templates", "xsl-templates");
$zipfile = HEURIST_FILESTORE_DIR . "folders.zip";
if (zip(HEURIST_FILESTORE_DIR, $folders, $zipfile, false)) {
    header('Content-type: binary/download');
    header('Content-Disposition: attachment; filename="folders.zip"');
    readfile($zipfile);
} else {
    //header('Content-type: multipart/x-zip'); //'binary/download'
}
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:31,代码来源:getDBFoldersForNewDB.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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