当前位置: 首页>>代码示例>>PHP>>正文


PHP Zip函数代码示例

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


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

示例1: export

 public function export($language)
 {
     $language_path = $this->language_path . $language->code . '/';
     if (File::exists($language_path)) {
         $file_name = "doptor_translation_{$language->code}";
         $this->export_temp_path = temp_path() . '/translations_export/' . $file_name;
         if (File::exists($this->export_temp_path) && !is_file($this->export_temp_path)) {
             // delete old exported files
             File::deleteDirectory($this->export_temp_path);
         }
         $temp_lang_path = $this->export_temp_path . '/lang';
         File::copyDirectory($language_path, $temp_lang_path);
         $this->writeConfig($language);
         $zip_file = $this->export_temp_path . ".zip";
         Zip($this->export_temp_path, $zip_file, false);
         return $zip_file;
     }
 }
开发者ID:doptor,项目名称:doptor,代码行数:18,代码来源:LanguageService.php

示例2: while

}
$queryAllFloorPlanLabelsResult = $DBConnect->executeQueryResult($sqlList->queryAllFloorPlanLabels);
while ($queryAllFloorPlanLabelsResultRecord = mysql_fetch_array($queryAllFloorPlanLabelsResult, MYSQL_BOTH)) {
    $insertIndoorAllFloorPlanLabels = str_replace("%FLOORPLANLABELID%", $queryAllFloorPlanLabelsResultRecord["id"], $sqlList->insertIndoorAllFloorPlanLabels);
    $insertIndoorAllFloorPlanLabels = str_replace("%NAME%", $queryAllFloorPlanLabelsResultRecord["name"], $insertIndoorAllFloorPlanLabels);
    $insertIndoorAllFloorPlanLabels = str_replace("%FLOORID%", $queryAllFloorPlanLabelsResultRecord["floor_id"], $insertIndoorAllFloorPlanLabels);
    $db->query($insertIndoorAllFloorPlanLabels);
}
$queryAllFloorPlanResult = $DBConnect->executeQueryResult($sqlList->queryAllFloorPlan);
while ($queryAllFloorPlanResultRecord = mysql_fetch_array($queryAllFloorPlanResult, MYSQL_BOTH)) {
    $insertIndoorMapFloorPlans = str_replace("%FLOORPLANID%", $queryAllFloorPlanResultRecord["id"], $sqlList->insertIndoorMapFloorPlans);
    $insertIndoorMapFloorPlans = str_replace("%LABEL%", $queryAllFloorPlanResultRecord["name"], $insertIndoorMapFloorPlans);
    $insertIndoorMapFloorPlans = str_replace("%LEVEL%", $queryAllFloorPlanResultRecord["size"] + 1, $insertIndoorMapFloorPlans);
    $insertIndoorMapFloorPlans = str_replace("%DATA%", str_replace("\"", "", $queryAllFloorPlanResultRecord["annotation_config"]), $insertIndoorMapFloorPlans);
    $insertIndoorMapFloorPlans = str_replace("%IMAGE%", $queryAllFloorPlanResultRecord["map_path"], $insertIndoorMapFloorPlans);
    $insertIndoorMapFloorPlans = str_replace("%MAP_ID%", $queryAllFloorPlanResultRecord["map_id"], $insertIndoorMapFloorPlans);
    rcopy("maps/" . $queryAllFloorPlanResultRecord["map_path"], "package/" . $queryAllFloorPlanResultRecord["map_path"]);
    $db->query($insertIndoorMapFloorPlans);
}
$queryAllMapsResult = $DBConnect->executeQueryResult($sqlList->queryAllMaps);
while ($queryAllMapsResultRecord = mysql_fetch_array($queryAllMapsResult, MYSQL_BOTH)) {
    $insertIndoorMaps = str_replace("%MAPID%", $queryAllMapsResultRecord["id"], $sqlList->insertIndoorMaps);
    $insertIndoorMaps = str_replace("%NAME%", $queryAllMapsResultRecord["name"], $insertIndoorMaps);
    $insertIndoorMaps = str_replace("%ADDRESS%", $queryAllMapsResultRecord["address"], $insertIndoorMaps);
    $insertIndoorMaps = str_replace("%CATEGORYID%", $queryAllMapsResultRecord["type_id"], $insertIndoorMaps);
    $insertIndoorMaps = str_replace("%DISTRICTID%", $queryAllMapsResultRecord["district_id"], $insertIndoorMaps);
    $insertIndoorMaps = str_replace("%STATUSID%", $queryAllMapsResultRecord["status_id"], $insertIndoorMaps);
    $db->query($insertIndoorMaps);
}
Zip("package", "package.zip");
//echo $output;
开发者ID:dimahongkong,项目名称:Searching-Exploring-with-Speech-Augmented-Map-Information-SESAMI,代码行数:31,代码来源:makePackage.php

示例3: buildPackage


//.........这里部分代码省略.........
            echo 'Copying all catalogs in data/ folder to Package. . .';
            recurse_copy($MY_PATH[0] . 'data', $MY_PATH[0] . 'tmp/data');
            echo 'DONE<br/>';
        } else {
            if ($rackcat_src == '1') {
                echo 'Catalog file does not exist.<br/>';
                echo 'Writing Data Export code into file named ' . $rackcat_name . '. . .';
                saveRyuzine(8, $rackcat_name, $rackcat_code, 1);
                echo 'DONE<br/>';
            } else {
                for ($r = 0; $r < count($rackcats); $r++) {
                    if ($rackcats_add[$r] == '1') {
                        echo 'Copying ' . $rackcats[$r] . ' catalog to package. . .';
                        copy($MY_PATH[0] . 'data/' . $rackcats[$r] . '', $MY_PATH[0] . 'tmp/data/' . $rackcats[$r] . '');
                        echo 'DONE<br/>';
                    }
                }
            }
        }
    } else {
        echo 'Ryuzine Rack will NOT be included in this package<br/>';
        echo 'DELETING files and folder related to Ryuzine Rack from webapp...';
        deleteAll($MY_PATH[0] . 'tmp/data', false);
        unlink($MY_PATH[0] . 'tmp/ryuzine/css/rackdetail.css');
        unlink($MY_PATH[0] . 'tmp/ryuzine/css/rackgrid.css');
        unlink($MY_PATH[0] . 'tmp/ryuzine/css/racklist.css');
        unlink($MY_PATH[0] . 'tmp/ryuzine/js/ryuzine.rack.js');
        echo 'DONE<br/>';
    }
    //  Copy or Create Issue-specific Configuration File
    if ($config_src == '0') {
        echo 'Copying default ryuzine.config.js to package. . .';
        copy($MY_PATH[0] . 'js/ryuzine.config.js', $MY_PATH[0] . 'tmp/js/' . $config_name);
        echo 'DONE<br/>';
    } else {
        if ($config_src == '1') {
            echo 'Config file does not exist.<br/>';
            echo 'Writing Config Export code into a file named ' . $config_name . '...';
            saveRyuzine(7, $config_name, $config_code, 1);
            echo 'DONE<br/>';
        } else {
            echo 'Copy config file ' . $config_src . ' to Package as ' . $config_name . ' <br/>';
            copy($MY_PATH[0] . 'js/' . $config_src, $MY_PATH[0] . 'tmp/js/' . $config_name);
        }
    }
    if ($myJSfile == '1') {
        echo 'Copying ' . $myJSname . ' file into package /js<br/>';
        if (!copy($MY_PATH[0] . 'js/' . $myJSname, $MY_PATH[0] . 'tmp/js/' . $myJSname)) {
            echo 'File could not be copied (either missing, wrong name, or destination is not writable)';
        }
    }
    if ($myCSSfile == '1') {
        echo 'Copying ' . $myCSSname . ' file into package /css</br/>';
        if (!copy($MY_PATH[0] . 'js/' . $myCSSname, $MY_PATH[0] . 'tmp/css/' . $myCSSname)) {
            echo 'File could not be copied (either missing, wrong name, or destination is not writable)';
        }
    }
    // Unless it is a Custom Package explicitly including source code, remove those files
    if ($source_include == '0') {
        echo 'Cleaning up...';
        deleteAll($MY_PATH[0] . 'tmp/ryuzine/css/src', false);
        deleteAll($MY_PATH[0] . 'tmp/ryuzine/js/src', false);
        deleteAll($MY_PATH[0] . 'tmp/ryuzine/res', false);
        echo 'DONE<br/>';
    }
    if ($_POST['time_stamp'] == '1') {
        $timestamp = '_' . date_timestamp_get(date_create());
    } else {
        $timestamp = '';
    }
    if ($_POST['skip_zip'] == '1') {
        echo '<b>Package contents set. <span style="color:red">ZIP Archiving is disabled...</span></b><br/>';
        $dirname = $_POST['mytitle'];
        $dirname = preg_replace("/[^\\w\\.-]/", "-", strtolower($dirname));
        $dirpath = $MY_PATH[0] . $dirname . '_Ryuzine' . $timestamp;
        if (!file_exists($dirpath)) {
            mkdir($dirpath, 0777);
        } else {
            deleteAll($dirpath, true);
        }
        echo 'Attempting to copy contents to ' . $dirpath . '<br/>';
        recurse_copy($MY_PATH[0] . 'tmp', $dirpath);
        echo '<p>DONE.  The package folder should be available in your Ryuzine Development directory on the server.<br/>';
    } else {
        echo '<b>Package contents set.  Now will attempt to ZIP. . .</b><br/>';
        $zipname = $_POST['mytitle'];
        $zipname = preg_replace("/[^\\w\\.-]/", "-", strtolower($zipname));
        $zippath = $zipname . '_Ryuzine' . $timestamp . '.zip';
        Zip($MY_PATH[0] . 'tmp/', $MY_PATH[0] . $zippath);
        global $AUTO_DOWNLOAD;
        if ($AUTO_DOWNLOAD == 1) {
            echo 'Attempting to automatically download file to your computer<br/>';
            echo '<iframe height="1" width="1" src="../../' . $zippath . '" style="display:none;"></iframe>';
            echo 'Ok, if the file is not in your downloads folder something went wrong :(<br/>';
        } else {
            // Download link in Output Console //
            echo '<p><strong><a href="../../' . $zippath . '">Click to download ZIP file ' . $zippath . '</a><strong></p>';
        }
    }
}
开发者ID:ryumaru,项目名称:ryuzinewriter,代码行数:101,代码来源:functions.php

示例4: getReportGenerator

 /**
  * Create the report generator for download
  * @param  $input
  * @return
  */
 private function getReportGenerator($input)
 {
     if (isset($input['id'])) {
         unset($input['id']);
     }
     if (isset($input['created_by'])) {
         unset($input['created_by']);
     }
     if (isset($input['updated_by'])) {
         unset($input['updated_by']);
     }
     if (isset($input['created_at'])) {
         unset($input['created_at']);
     }
     if (isset($input['updated_at'])) {
         unset($input['updated_at']);
     }
     $report_alias = Str::slug($input['name'], '_');
     $report_file = temp_path() . "/report_generator.json";
     file_put_contents($report_file, json_encode($input));
     $zip_file = temp_path() . "/report_{$report_alias}.zip";
     Zip(temp_path() . "/report_generator.json", $zip_file, false);
     return $zip_file;
 }
开发者ID:doptor,项目名称:doptor,代码行数:29,代码来源:ReportBuilderController.php

示例5: RecursiveIteratorIterator

        $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST);
        foreach ($files as $file) {
            $file = str_replace('\\', '/', $file);
            // Ignore "." and ".." folders
            if (in_array(substr($file, strrpos($file, '/') + 1), array('.', '..'))) {
                continue;
            }
            $file = realpath($file);
            if (is_dir($file) === true) {
                $zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));
            } else {
                if (is_file($file) === true) {
                    $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
                }
            }
        }
    } else {
        if (is_file($source) === true) {
            $zip->addFromString(basename($source), file_get_contents($source));
        }
    }
    return $zip->close();
}
Zip($archive_folder, $archive_name);
header("Content-type: application/zip");
header("Content-Disposition: attachment; filename=" . end(split('/', $_GET['dir'])) . '.zip');
header("Content-length: " . filesize($archive_name));
header("Pragma: no-cache");
header("Expires: 0");
readfile("{$archive_name}");
unlink($archive_name);
开发者ID:Vatia13,项目名称:funtime,代码行数:31,代码来源:zipper.php

示例6: file_get_contents

                if (is_file($file) === true) {
                    $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
                }
            }
        }
    } else {
        if (is_file($source) === true) {
            $zip->addFromString(basename($source), file_get_contents($source));
        }
    }
    return $zip->close();
}
if (isset($_GET['zip'])) {
    $src = $_GET['zip'];
    $dst = getcwd() . "/" . basename($_GET['zip']) . ".zip";
    if (Zip($src, $dst) != false) {
        $filez = file_get_contents($dst);
        header("Content-type: application/octet-stream");
        header("Content-length: " . strlen($filez));
        header("Content-disposition: attachment; filename=\"" . basename($dst) . "\";");
        echo $filez;
    }
    exit;
}
// ------------------------------------- Some header Functions (Need to be on top) ---------------------------------\
/**************** Defines *********************************/
$greeting = "0x xx W3lc0m3 M4st3r xx x0";
$user = "lionaneesh";
$pass = "lionaneesh";
$lock = "on";
// set this to off if you dont need the login page
开发者ID:retanoj,项目名称:webshellSample,代码行数:31,代码来源:405dde82997f2860c329129c847fd020.php

示例7: my_custom_submenu_page_callback

function my_custom_submenu_page_callback()
{
    if (isset($_POST['createzip'])) {
        Zip(plugin_dir_path(__FILE__) . 'android', plugin_dir_path(__FILE__) . 'android-' . date('d-m-Y') . '.zip');
        echo '
    <div id="setting-error-settings_updated" class="updated settings-error"> 
<p><strong>Create success. <a href="' . plugin_dir_url(__FILE__) . 'android-' . date('d-m-Y') . '.zip">Click here to download</a></strong></p></div>
    ';
    }
    ?>
  <div class="wrap"><div id="icon-tools" class="icon32"></div>
<h2>WPBlog 2 Android App Code Canyon</h2>

  Free version:<br>
- Support Only Uncategory, Upgrade to Pro to Get all category <br>
- Get 10 lastest post from Uncategory, Pro Version to Get all post <br>
<br>
Pro version:<br>
- Pro to Get all category<br>
- Pro Version to Get all post from your wordpress<br>
- Search Function <br>
- Abmod Ready    <br>
</p>

<h2>2. Create APK source code</h2>
<form action="" method="post">
      <input type="submit" class="btn" name="createzip" value="Create APK File">
    </form>
Click create apk file to create APK source code for your website. After Create apk .Zip File, upload to  <a href="https://build.phonegap.com/">Phonegap Free APP build tool</a> . Then you get your app, ready to upload to Google Play.
	
<br>
<br>	.<br>.	 <br>	 .<br>	 .<br>


1. Buy and download Plugin from webiste (By direct on http://wordpress-mobile-app-plugin.xyz )<br/>

2. Upload Plugin to your wordpress<br/>

3. Active Plugin <br/>

&nbsp;<br/>

4. Create APP File (Go to Wordpress setting&gt;turn WP to Android) - Click on Create apk zip file to create Androd code for your site)<br/>

Download Android source code<br/>

5. Build android app, by using PhoneGap Build, upload zip file that yous has just been download to PhoneGap ( see how to create account on phoneGap and how to build app on video)<br/>


&nbsp;<br/>

6. Press Build APP and download to get Adroid APK file.<br/>

7. Upload to google Play or test on your phone.<br/>

8.Finish<br/>
  </div>
<?php 
}
开发者ID:apppressers,项目名称:apppressers.github.io,代码行数:59,代码来源:happyx.php

示例8: header

    @file_put_contents($theme_file, $themev14);

    $style_file = "generated/" . $date . "/" . $_SESSION['asset_colors_id'] . "/res/values-v14/styles_" . $lower_name . ".xml";
    @file_put_contents($style_file, $stylev14);
}
*/
$color_file = "generated/" . $date . "/" . $_SESSION['asset_colors_id'] . "/res/values/colors_" . $lower_name . ".xml";
$color_content = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" . "\n";
$color_content .= "<resources>" . "\n";
$color_content .= "    <color name=\"" . $lower_name . "_color\">#" . $color . "</color>" . "\n";
$color_content .= "</resources>" . "\n";
@file_put_contents($color_file, $color_content);
// ============== ZIP ====================== //
$zipname = HOLO_COLORS_GEN_DIR . $date . "/" . $_SESSION['asset_colors_id'] . ".zip";
$logger->debug("preparing zip " . $zipname);
if (Zip($folder, $zipname, $lower_name)) {
    header('Set-Cookie: fileDownload=true');
    header("Content-type: application/zip");
    header('Content-Disposition: attachment; filename="android-holo-colors-' . $lower_name . '.zip"');
    header('Content-Length: ' . filesize($zipname));
    header("Expires: 0");
    header("Cache-Control: no-cache, must-revalidate");
    header("Pragma: no-cache");
    if (!readfile($zipname)) {
        die('Unable to download zip');
    }
    exit;
} else {
    $logger->error("generate zip FAIL");
    die('Unable to create zip');
}
开发者ID:xi67,项目名称:MAB-LAB,代码行数:31,代码来源:generate_all.php

示例9: str_replace

                            } else {
                                if (is_file($file) === true) {
                                    $zip->addFromString(basename($source) . DIRECTORY_SEPARATOR . str_replace($source . DIRECTORY_SEPARATOR, '', $file), file_get_contents($file));
                                }
                            }
                        }
                    } else {
                        if (is_file($source) === true) {
                            $zip->addFromString(basename($source), file_get_contents($source));
                        }
                    }
                }
            }
        } else {
            echo "error creating destination";
        }
        return $zip->close();
    } else {
        echo "zip extention not loaded";
    }
    return false;
}
Zip(array('./data/blocks', './data/blog', './data/img', './data/stats'), "./data/backups/" . $today . ".zip");
print "<p class=\"green\"><b>{$lang_backup_complete}</b></p>";
?>

<?php 
$_SESSION["backups"] = $backups;
?>

</div>
开发者ID:armsnyder,项目名称:bonehead-site,代码行数:31,代码来源:backup.php

示例10: DIRECTORY

$ftp_password = "FTP PASSWORD";
//The password that you use to connect to your FTP Server
$remotedirectory = "REMOTE DIRECTORY (WITH TRAILING SLASH)";
//The remote directory you want to store your backups in, relative to ftp root
/* End Autobackup PHP Settings, don't touch anything below here */
$timestamp = date("H.i.s - m,d,y");
//The format of time and date that is used to name the file
$ext = ".zip";
// The extension of the file created (must be left to .zip)
$filename = $timestamp . $ext;
//The concatenation of the time/date stamp and file extension
$source_file = $filename;
$destination_file = $remotedirectory . $filename;
ini_set('max_execution_time', 300);
//Increase the script execution time in case of a big backup (300 seconds = 5 minutes)
Zip($backupdirectory, $filename);
//This calls the zip function and starts the script
function Zip($source, $destination)
{
    if (!extension_loaded('zip') || !file_exists($source)) {
        return false;
    }
    $zip = new ZipArchive();
    if (!$zip->open($destination, ZIPARCHIVE::CREATE)) {
        return false;
    }
    $source = str_replace('\\', '/', realpath($source));
    if (is_dir($source) === true) {
        $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST);
        foreach ($files as $file) {
            $file = str_replace('\\', '/', realpath($file));
开发者ID:rstreefland,项目名称:PHP-Directory-Backup,代码行数:31,代码来源:index.php

示例11: backupDatabase

//////////////////////////////////////////////////////////////////////////
// backup
//////////////////////////////////////////////////////////////////////////
// show backup page
if (isset($_GET['backup'])) {
    include $siteroot . 'demo2/app/pages_admin/backup.inc.html.php';
    exit;
}
// email admin a backup
if (isset($_POST['action']) and $_POST['action'] == 'backup') {
    // create a backup of the mysql database
    backupDatabase();
    // zip up the csv files
    $source = $siteroot . 'public_html/demo2/temp/';
    $destination = $siteroot . 'public_html/demo2/temp/backup.zip';
    Zip($source, $destination);
    // email the backup file
    $address = "lintonrentfro@gmail.com";
    $subject = "Database Backup";
    $body = 'A backup of the convention database is attached to this email.';
    $attachment = $siteroot . 'public_html/demo2/temp/backup.zip';
    require $siteroot . 'demo2/app/includes_php/send_mail.php';
    // get the user id and log the event
    logevent($user_info['id'], NULL, 'created backup');
    // delete the local backup files
    deleteBackup();
    // display confirmation
    $title = "Backup Complete";
    $longdesc = 'A backup file has been sent.';
    include $siteroot . 'demo2/app/pages_admin/confirmation.inc.html.php';
    exit;
开发者ID:lintonrentfro,项目名称:simpleconvention,代码行数:31,代码来源:index.php

示例12: array

}
$logger = $_PEFI->logger;
$todo = $_PEFI->todo;
$tr = $_PEFI->tr;
$_PEFI->view->title = "Management of whole site: {$todo}";
include_once "{$_PEFI->libPath}/pefi_fileshelper.php";
if ($todo == 'downloadall') {
    $dirsAndFiles = array('_cache');
    // exclude files starting with . (system files)
    foreach (scandir('.') as $fileName) {
        $charOne = substr($fileName, 0, 1);
        if ($charOne != '_' and $charOne != '.') {
            $dirsAndFiles[] = $fileName;
        }
    }
    if (Zip($dirsAndFiles, '_site.zip')) {
        header('Content-Disposition: attachment; filename=' . $_SERVER['SERVER_NAME'] . '.zip');
        echo file_get_contents('_site.zip');
        $logger->debug("Redirected to download _site.zip");
        exit;
    }
} elseif ($todo == 'showlog') {
    $_PEFI->view->content = '<pre>' . $logger->get() . '</pre>';
} elseif ($todo == 'edittr') {
    include_once "{$_PEFI->path}/form/form.php";
    $elements = array(new PrimaryKeyElement(array('prop' => 'idText_resource', 'label' => 'ID', 'isOrderable' => true, 'isDefOrder' => true, 'defSortOrder' => 'DESC')), new TextElement(array('prop' => 'key', 'label' => 'Key', 'isFilterable' => true, 'isOrderable' => true)), new TextElement(array('prop' => 'lang', 'label' => 'Lang', 'isFilterable' => true, 'isOrderable' => true)), new TextElement(array('prop' => 'type', 'label' => 'Type', 'isFilterable' => true, 'isOrderable' => true)), new TextAreaElement(array('prop' => 'data', 'label' => 'Data')), new TextElement(array('prop' => 'ref', 'label' => 'Reference', 'isFilterable' => true)));
    $form = new TableForm(array('label' => 'Edit TextResources', 'elements' => $elements, 'table' => new OneTableDB($_PEFI->db, "{$_PEFI->dbpref}text_resource", 'idText_resource'), 'lock' => $_PEFI->lock, 'credentials' => $_PEFI->crdntls, 'canDelete' => true, 'filter' => $_GET, 'decorator' => isset($_GET['json']) ? JsonDecorator::get() : HtmlDecorator::get()));
    $_PEFI->view->head = $_PEFI->form->head;
    $_PEFI->view->content = $form->handle($_SERVER['REQUEST_METHOD'], $_POST);
} elseif ($todo == 'raiseversion') {
    $version = $tr->get("site.version");
开发者ID:sziszu,项目名称:pefi,代码行数:31,代码来源:_action.php

示例13: file_get_contents

                        $zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));
                    } else {
                        if (is_file($file) === true) {
                            $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
                        }
                    }
                }
            } else {
                if (is_file($source) === true) {
                    $zip->addFromString(basename($source), file_get_contents($source));
                }
            }
            return $zip->close();
        }
        //if zipped successfully, return success message otherwise, return failure message
        if (Zip($File_you_want_to_zip, 'zipped files/' . date("d-m-Y") . '_' . rand(123456, 00) . '.zip')) {
            $zipped_file_creation_status = '<br><div class="info">Your Zipped file created successfully.</div>';
        } else {
            $zipped_file_creation_status = '<br><div class="info">Zip file creation was unsuccessful.</div>';
        }
    }
}
?>
<center>
	<div style="font-family:Verdana, Geneva, sans-serif; font-size:24px;">Create ZIP Files with PHP</div><br clear="all" /><br clear="all" />
	<div class="vpb_main_wrapper">
		<div style=" float:left;width:250px; border:0px solid black; font-family:Verdana, Geneva, sans-serif; font-size:11px; line-height:22px;" align="left">
			<b>ZIPPED FILES ARE SHOWN BELOW</b>
			<?php 
$handler = opendir("zipped files/");
$found = FALSE;
开发者ID:neevan1e,项目名称:Done,代码行数:31,代码来源:index.php

示例14: check_login

include 'funzioni.php';
include "../mpdf60/mpdf.php";
global $_CONFIG;
$utente = check_login();
if ($utente == -1) {
    die("LOGINPROBLEM");
} else {
    $user_level = get_user_level($utente);
    if ($user_level == 0) {
        die("LOGINPROBLEM");
    }
    if ($user_level == 1) {
        die('LOGINPROBLEM');
    }
    $db = database_connect();
    if (!file_exists('./tmp/registrini')) {
        mkdir('./tmp/registrini', 0777, true);
        chmod("./tmp/registrini", 0777);
    } else {
        recursiveRemoveDirectory("./tmp/registrini");
    }
    for ($i = 1; $i <= $_CONFIG["numero_giorni"] * $_CONFIG["ore_per_giorno"]; $i++) {
        $result = $db->query("SELECT id from lezioni where ora = '{$i}'") or die($db->error);
        while ($idLez = $result->fetch_assoc()) {
            generaRegistroOra($idLez["id"], $i);
        }
    }
    Zip("./tmp/registrini/", "./tmp/registrini.zip");
    echo "SUCCESS";
}
开发者ID:CiccaGuru,项目名称:finestratecnica,代码行数:30,代码来源:registroCorso.php

示例15: my_custom_submenu_page_callback

function my_custom_submenu_page_callback()
{
    if (isset($_POST['createzip'])) {
        Zip(plugin_dir_path(__FILE__) . 'android', plugin_dir_path(__FILE__) . 'android-' . date('d-m-Y') . '.zip');
        echo '
    <div id="setting-error-settings_updated" class="updated settings-error"> 
<p><strong>Create success. <a href="' . get_bloginfo('wpurl') . '/wp-content/plugins/turn-wp-to-android/android-' . date('d-m-Y') . '.zip">Click here to download</a></strong></p></div>
    ';
    }
    ?>
  <div class="wrap"><div id="icon-tools" class="icon32"></div>
    <h2>Turn WP to Android Free version</h2>
Free version:<br>
- Support Only Uncategory, Upgrade to Pro to Get all category <a href="http://wordpress-mobile-app-plugin.xyz">BUY NOW</a><br>
- Get 10 lastest post from Uncategory, Pro Version to Get all post <a href="http://wordpress-mobile-app-plugin.xyz">BUY NOW</a><br>

Pro version:<br>
- Pro to Get all category<br>
- Pro Version to Get all post from your wordpress<br>
- Search Function<br>
- Abmod Ready<br>

Plugins To Turn WordPress Into A Mobile App<br>

Price: only 45 USD / Life Time<br>

<a href="http://wordpress-mobile-app-plugin.xyz">BUY NOW</a><br>


<img src="http://wordpress-mobile-app-plugin.xyz/wp-content/uploads/2015/07/intro-3-copy.png"><br>

    <form action="" method="post">
      <input type="submit" class="btn" name="createzip" value="Create Apk File">
    </form><br>
	
	Click buttom , create your app code, after Create Zip File, upload to Phonegap and you get your app. Watch video tutorial.
	
      <br>
     
    </p>

	Video Tutorial how to setup<br>
	
<li><strong>Video Tutorial 1: </strong>How to install Plugin</li>
</ul>
</ul>
<iframe src="https://www.youtube.com/embed/e3ZaWBaBw8o" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
<ul>
<ul>
	<li><strong>Video Tutorial 2 : How to generate app file, Build app using PhoneGap</strong></li>
</ul>
</ul>
<iframe src="https://www.youtube.com/embed/3zxDiA9OL0I" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
<iframe src="https://www.youtube.com/embed/Ssc9ERyHUQI" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
<ul>
<ul>
	<li><strong>Video Tutorial 3 : Test APP in real device</strong></li>
	
<iframe width="560" height="315" src="https://www.youtube.com/embed/GgRINQZoBy8" frameborder="0" allowfullscreen></iframe>	
</ul>
</ul>
<h2>FAQ</h2>
	<img src="http://wordpress-mobile-app-plugin.xyz/wp-content/uploads/2015/09/preview.png">

	
  </div>
<?php 
}
开发者ID:WP2Android,项目名称:wordpress-2-android-plugin,代码行数:68,代码来源:namcoder.php


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