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


PHP Releases::cleanReleaseName方法代码示例

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


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

示例1: foreach

             } else {
                 $groupID = -1;
                 foreach ($nzbInfo->groups as $group) {
                     $group = (string) $group;
                     if (array_key_exists($group, $siteGroups)) {
                         $groupID = $siteGroups[$group];
                         $groupName = $group;
                         break;
                     }
                 }
                 if ($groupID == -1) {
                     $retval .= "Missing Group for NZB : " . $browserpostednames[$nzbFile] . " - " . join(", ", $nzbInfo->groups) . "<br/>";
                     continue;
                 }
                 $relguid = md5(uniqid());
                 $name = $releases->cleanReleaseName(str_replace(".nzb", "", $browserpostednames[$nzbFile]));
                 $catId = $cat->determineCategory($groupName, $name);
                 $relid = $releases->insertRelease($name, $nzbInfo->filecount, $groupID, $relguid, $catId, "", date("Y-m-d H:i:s", $nzbInfo->postedlast), $nzbInfo->poster, "", $page->site);
                 $db->exec(sprintf("update releases set totalpart = %d, size = %s, completion = %d, GID=%s where ID = %d", $nzbInfo->filecount, $nzbInfo->filesize, $nzbInfo->completion, $db->escapeString($nzbInfo->gid), $relid));
                 $nzbfilename = $nzb->getNZBPath($relguid, $page->site->nzbpath, true);
                 $fp = _gzopen($nzbfilename, "w");
                 if ($fp) {
                     gzwrite($fp, $nzbInfo->toNzb());
                     gzclose($fp);
                     $retval .= sprintf(" Imported %s<br/>", $name);
                 }
             }
         }
     }
 }
 $page->smarty->assign('output', $retval);
开发者ID:scriptzteam,项目名称:newzNZB-premium-indexer,代码行数:31,代码来源:nzb-import.php

示例2: sprintf

 if ($groupID == -1) {
     echo sprintf("%0" . $digits . "d %.2f%% Error : Missing group %s - Group(%s)\n", $items - $num, $num / $items * 100, $nzbFile, str_replace("alt.binaries.", "a.b.", implode(",", $nzbInfo->groups)));
     if ($movefiles) {
         if (!file_exists($nogrouppath)) {
             mkdir($nogrouppath);
         }
         if (!file_exists($nogrouppath . basename($nzbFile))) {
             rename($nzbFile, $nogrouppath . basename($nzbFile));
         }
         $missinggroups = array_merge($missinggroups, $nzbInfo->groups);
     }
     continue;
 } else {
     if ($usefilename) {
         $relguid = md5(uniqid());
         $name = $releases->cleanReleaseName(str_replace(".nzb", "", basename($nzbFile)));
         $catId = $cat->determineCategory($groupName, $name);
         $relid = $releases->insertRelease($name, $nzbInfo->filecount, $groupID, $relguid, $catId, "", date("Y-m-d H:i:s", $nzbInfo->postedlast), $nzbInfo->poster, "", $page->settings);
         $db->queryExec(sprintf("update releases set totalpart = %d, size = %s, completion = %d, GID=%s where id = %d", $nzbInfo->filecount, $nzbInfo->filesize, $nzbInfo->completion, $db->escapeString($nzbInfo->gid), $relid));
         $nzbfilename = $nzb->getNZBPath($relguid, $page->settings->getSetting('nzbpath'), true);
         $fp = gzopen($nzbfilename, "w");
         if ($fp) {
             gzwrite($fp, $nzbInfo->toNzb());
             gzclose($fp);
             echo sprintf("%0" . $digits . "d %.2f%% Imported %s\n", $items - $num, $num / $items * 100, $name);
             if ($movefiles) {
                 if (!file_exists($importedpath)) {
                     mkdir($importedpath);
                 }
                 if (!file_exists($importedpath . basename($nzbFile))) {
                     rename($nzbFile, $importedpath . basename($nzbFile));
开发者ID:engine9-,项目名称:newznab-tmux,代码行数:31,代码来源:import.php


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