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


PHP kFile::deleteFile方法代碼示例

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


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

示例1: execute

    public function execute()
    {
        $this->forceSystemAuthentication();
        $this->basePath = "/content/dynamic/";
        $dynamicRoot = myContentStorage::getFSContentRootPath() . $this->basePath;
        if ($this->getRequest()->getMethod() == sfRequest::POST) {
            $origFilename = basename($_FILES['Filedata']['name']);
            $fullPath = $dynamicRoot . $origFilename;
            move_uploaded_file($_FILES['Filedata']['tmp_name'], $fullPath);
            chmod($fullPath, 0777);
            return $this->renderText("ok");
        } else {
            if ($this->getRequest()->getMethod() == sfRequest::DELETE) {
                $filename = basename($_REQUEST['fileName']);
                kFile::deleteFile($dynamicRoot . $filename);
                return $this->renderText("ok");
            }
        }
        $this->files = kFile::dirListExtended($dynamicRoot, false);
        $this->extraHead = <<<EOT
\t\t<style type="text/css">
\t\t\ttable{ font-size:1.2em; width:100%; margin:40px 0 0 0; }
\t\t\ttable thead{ font-size:1.4em; }
\t\t\t\ttable thead td{ border-bottom:1px solid #444; margin-bottom:20px; }
\t\t\ttable tbody td{ padding:2px 0; color:#ccc; }
\t\t\t\ttable tbody td b{ font-weight:normal; cursor:default; }
\t\t\t\ttable tbody td span.btn{ margin-right:12px;}
\t\t\tdiv#helper{ display:none; position:absolute; left:0; width:250px; }
\t\t\tdiv#helper img{ float:right; max-width:250px; }
\t\t</style>
EOT;
    }
開發者ID:DBezemer,項目名稱:server,代碼行數:32,代碼來源:uploadAction.class.php

示例2: removeIndicator

 public function removeIndicator()
 {
     // delete any of the indicators available
     $indicator_list = kFile::recursiveDirList(self::$s_indicator_path, true, false, $this->pattern);
     if (count($indicator_list) > 0) {
         kFile::deleteFile($indicator_list[0]);
     }
     if (count($indicator_list) > 100) {
         // many file indicator - no real reason to leave them all
         for ($i = 1; $i < 50; $i++) {
             kFile::deleteFile($indicator_list[$i]);
         }
     }
 }
開發者ID:GElkayam,項目名稱:server,代碼行數:14,代碼來源:myFileIndicator.class.php


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