当前位置: 首页>>代码示例>>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;未经允许,请勿转载。