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


PHP Archive::compress方法代碼示例

本文整理匯總了PHP中Archive::compress方法的典型用法代碼示例。如果您正苦於以下問題:PHP Archive::compress方法的具體用法?PHP Archive::compress怎麽用?PHP Archive::compress使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Archive的用法示例。


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

示例1: PhpCompress

 /**
  * Create archive using php function and return the path
  *
  * @param  string  $dir    target dir
  * @param  array   $files  files names list
  * @param  string  $name   archive name
  * @param  array   $arc    archiver options
  * @return string|bool
  */
 protected function PhpCompress($dir, $files, $name, $archiver)
 {
     include 'Archive.php';
     $path = $this->_joinPath($dir, $name);
     $archive = new Archive($path);
     //add files
     foreach ($files as $file) {
         $add_path = $this->_joinPath($dir, $file);
         $archive->Add($add_path, $file);
     }
     $archive->compress();
     return $path;
 }
開發者ID:stegrams,項目名稱:Typesetter,代碼行數:22,代碼來源:FinderVolumeLocalFileSystem.class.php

示例2: download

	public function download($comic, $language = 'en', $volume = 0, $chapter = "", $subchapter = 0, $team = 0, $joint = 0, $pagetext = 'page', $page = 1) {
		if(!get_setting('fs_dl_enabled'))
			show_404();
		$comice = new Comic();
		$comice->where('stub', $comic)->get();
		if ($comice->result_count() == 0) {
			set_notice('warn', 'This comic doesn\'t exist.');
		}

		if ($chapter == "") {
			redirect('/reader/comic/' . $comic);
		}

		$chaptere = new Chapter();
		$chaptere->where('comic_id', $comice->id)->where('language', $language)->where('volume', $volume)->where('chapter', $chapter)->order_by('subchapter', 'ASC');

		if (!is_int($subchapter) && $subchapter == 'page') {
			$current_page = $team;
		}
		else {
			$chaptere->where('subchapter', $subchapter);

			if ($team == 'page')
				$current_page = $joint;
			else {
				if ($team != 0) {
					$teame = new Team();
					$teame->where('stub', $team)->get();
					$chaptere->where('team_id', $teame->id);
				}

				if ($joint == 'page')
					$current_page = $pagetext;

				if ($joint != 0) {
					$chaptere->where('joint_id', $joint);
				}
			}
		}

		if (!isset($current_page)) {
			if ($page != 1)
				$current_page = $page;
			else
				$current_page = 1;
		}

		$chaptere->get();
		if ($chaptere->result_count() == 0) {
			show_404();
		}
		
		$archive = new Archive();
		$url = $archive->compress($chaptere);
		redirect($url);
	}
開發者ID:Nakei,項目名稱:FoOlSlide,代碼行數:56,代碼來源:reader.php

示例3: download

 public function download($comic, $language = 'en', $volume = null, $chapter = null, $subchapter = 0)
 {
     if (!get_setting('fs_dl_enabled')) {
         show_404();
     }
     $comice = new Comic();
     $comice->where('stub', $comic)->get();
     if ($comice->result_count() == 0) {
         set_notice('warn', 'This comic does not exist.');
     }
     $archive = new Archive();
     $result = $archive->compress($comice, $language, $volume, $chapter, $subchapter);
     if ($this->input->is_cli_request()) {
         echo $result["server_path"] . PHP_EOL;
     } else {
         redirect($result["url"]);
     }
 }
開發者ID:KasaiDot,項目名稱:FoOlSlide,代碼行數:18,代碼來源:reader.php


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