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


PHP FileHandler::get_downloads_folder方法代码示例

本文整理汇总了PHP中FileHandler::get_downloads_folder方法的典型用法代码示例。如果您正苦于以下问题:PHP FileHandler::get_downloads_folder方法的具体用法?PHP FileHandler::get_downloads_folder怎么用?PHP FileHandler::get_downloads_folder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileHandler的用法示例。


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

示例1: __construct

 public function __construct($post, $audio_only, $outfilename = False, $vformat = False)
 {
     $this->config = (require dirname(__DIR__) . '/config/config.php');
     $fh = new FileHandler();
     $this->download_path = $fh->get_downloads_folder();
     if ($this->config["log"]) {
         $this->log_path = $fh->get_logs_folder();
     }
     $this->audio_only = $audio_only;
     $this->urls = explode(",", $post);
     if (!$this->check_requirements($audio_only)) {
         return;
     }
     if ($outfilename) {
         $this->outfilename = $outfilename;
     }
     if ($vformat) {
         $this->vformat = $vformat;
     }
     foreach ($this->urls as $url) {
         if (!$this->is_valid_url($url)) {
             $this->errors[] = "\"" . $url . "\" is not a valid url !";
         }
     }
     if (isset($this->errors) && count($this->errors) > 0) {
         $_SESSION['errors'] = $this->errors;
         return;
     }
     if ($this->config["max_dl"] == 0) {
         $this->do_download();
     } elseif ($this->config["max_dl"] > 0) {
         if ($this->background_jobs() >= 0 && $this->background_jobs() < $this->config["max_dl"]) {
             $this->do_download();
         } else {
             $this->errors[] = "Simultaneous downloads limit reached !";
         }
     }
     if (isset($this->errors) && count($this->errors) > 0) {
         $_SESSION['errors'] = $this->errors;
         return;
     }
 }
开发者ID:timendum,项目名称:Youtube-dl-WebUI,代码行数:42,代码来源:Downloader.php

示例2:

					</div>
				</div>
					
			</form>
			<br>
			<div class="row">
				<div class="col-lg-6">
					<div class="panel panel-info">
						<div class="panel-heading"><h3 class="panel-title">Info</h3></div>
						<div class="panel-body">
							<p>Free space : <?php 
echo $file->free_space();
?>
</b></p>
							<p>Download folder : <?php 
echo $file->get_downloads_folder();
?>
</p>
						</div>
					</div>
				</div>
				<div class="col-lg-6">
					<div class="panel panel-info">
						<div class="panel-heading"><h3 class="panel-title">Help</h3></div>
						<div class="panel-body">
							<p><b>How does it work ?</b></p>
							<p>Simply paste your video link in the field and click "Download"</p>
							<p><b>With which sites does it work?</b></p>
							<p><a href="http://rg3.github.io/youtube-dl/supportedsites.html">Here's</a> a list of the supported sites</p>
							<p><b>How can I download the video on my computer?</b></p>
							<p>Go to <a href="./list.php">List of files</a> -> choose one -> right click on the link -> "Save target as ..." </p>
开发者ID:timendum,项目名称:Youtube-dl-WebUI,代码行数:31,代码来源:index.php

示例3: foreach

 :</h2>
			<table class="table table-striped table-hover ">
				<thead>
					<tr>
						<th style="min-width:800px; height:35px">Title</th>
						<th style="min-width:80px">Size</th>
						<th style="min-width:110px">Delete link</th>
					</tr>
				</thead>
				<tbody>
			<?php 
    $i = 0;
    $totalSize = 0;
    foreach ($files as $f) {
        echo "<tr>";
        echo "<td><a href=\"" . $file->get_downloads_folder() . '/' . $f["name"] . "\" download>" . $f["name"] . "</a></td>";
        echo "<td>" . $f["size"] . "</td>";
        echo "<td><a href=\"./list.php?delete={$i}&type={$t}\" class=\"btn btn-danger btn-sm\">Delete</a></td>";
        echo "</tr>";
        $i++;
    }
    ?>
				</tbody>
			</table>
			<br/>
			<br/>
		<?php 
} else {
    if (isset($t) && ($t === 'v' || $t === 'm')) {
        echo "<br><div class=\"alert alert-warning\" role=\"alert\">No {$type} !</div>";
    } else {
开发者ID:mwgg,项目名称:Youtube-dl-WebUI,代码行数:31,代码来源:list.php


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