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


PHP removeFile函数代码示例

本文整理汇总了PHP中removeFile函数的典型用法代码示例。如果您正苦于以下问题:PHP removeFile函数的具体用法?PHP removeFile怎么用?PHP removeFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: _deleteImageCaptcha

 private function _deleteImageCaptcha($resutls)
 {
     foreach ($resutls as $capcha) {
         removeFile(BASEPATH . '../public/capchas/' . $capcha->captcha_time . ".jpg");
         $this->db->delete($this->_table, array("captcha_id" => $capcha->captcha_id));
     }
 }
开发者ID:duongbaphuc1,项目名称:newcanho,代码行数:7,代码来源:capcha_model.php

示例2: com_install

function com_install()
{
    global $cloneManifest, $mainframe, $cloneParent;
    $session =& JFactory::getSession();
    $si = new SubInstaller();
    $ret = $si->install();
    $errorArray = $si->getError();
    $session->set('jsn_install_error', $errorArray);
    $document =& $cloneManifest->document;
    $version =& $document->getElementByPath('version');
    $edition =& $document->getElementByPath('edition');
    $version = $version->data();
    $edition = str_replace(' ', '_', JString::strtolower($edition->data()));
    $packageFile = JPATH_ROOT . DS . 'tmp' . DS . 'jsn_imageshow_' . $edition . '_' . $version . '_install.zip';
    $packageExtDir = $cloneParent->getPath('source');
    $flagInstallation = false;
    $disable = '';
    $resultCheckManifestFile = checkManifestFileExist();
    if ($resultCheckManifestFile == true) {
        $objUpgradeHelper = new JSNUpgradeHelper($cloneManifest);
        $objUpgradeHelper->executeUpgrade();
        $objUpgradeDBUtil = new JSNISUpgradeDBUtil($cloneManifest);
        $objUpgradeDBUtil->executeUpgradeDB();
    }
    if (!$cloneParent->copyManifest()) {
        $cloneParent->abort(JText::_('Component') . ' ' . JText::_('Install') . ': ' . JText::_('Could not copy setup file'));
        return false;
    }
    removeFile($packageFile);
    removeFolder($packageExtDir);
    $mainframe->redirect('index.php?option=com_imageshow&controller=installer&task=installcore');
}
开发者ID:sangkasi,项目名称:joomla,代码行数:32,代码来源:install.imageshow.php

示例3: delete

 function delete($id)
 {
     $customer = $this->getById($id);
     if (!empty($customer)) {
         removeFile(BASEPATH . "../public/images/upload/" . $customer['image']);
         return $this->db->delete($this->_table, array('id' => $id));
     }
     return FALSE;
 }
开发者ID:duongbaphuc1,项目名称:newcanho,代码行数:9,代码来源:news_model.php

示例4: delete

 function delete($id)
 {
     $customer = $this->getById($id);
     if (!empty($customer)) {
         removeFile(BASEPATH . "../public/images/products/" . $customer['logo']);
         return $this->db->delete("products", array('id' => $id));
     }
     return FALSE;
 }
开发者ID:duongbaphuc1,项目名称:newcanho,代码行数:9,代码来源:products_model.php

示例5: edit

 function edit($data, $code)
 {
     $array = array();
     $array['content_en'] = $data['content_en'];
     $array['content_vi'] = $data['content_vi'];
     // upload image logo
     $image_logo = uploadFile("image", BASEPATH . "../public/images/statics/");
     if (!empty($image_logo['file_name'])) {
         $array['image'] = $image_logo['file_name'];
         removeFile(BASEPATH . "../public/images/statics/" . $_POST['old_image']);
     }
     return $this->db->update('static_contents', $array, array('code' => $code));
 }
开发者ID:duongbaphuc1,项目名称:newcanho,代码行数:13,代码来源:staticcontent_model.php

示例6: route

 public function route()
 {
     $action = 'upload';
     if (isset($_GET['action'])) {
         $action = $_GET['action'];
     }
     //routing for different tasks
     switch ($action) {
         case 'upload':
             if (!empty($_FILES)) {
                 $this->upload();
             }
             break;
         case 'remove':
             $filename = $_GET['name'];
             removeFile($filename);
             break;
         case 'show':
             showFiles();
             break;
     }
 }
开发者ID:kc22033,项目名称:afhdev,代码行数:22,代码来源:Dropzone.php

示例7: deldir

function deldir($dir)
{
    //先删除目录下的文件:
    $dh = opendir($dir);
    while ($file = readdir($dh)) {
        if ($file != "." && $file != "..") {
            $fullpath = $dir . "/" . $file;
            if (!is_dir($fullpath)) {
                removeFile($fullpath);
            } else {
                deldir($fullpath);
            }
        }
    }
    closedir($dh);
    //删除当前文件夹:
    if (rmdir($dir)) {
        return true;
    } else {
        return false;
    }
}
开发者ID:hzshark,项目名称:cloudharddisk,代码行数:22,代码来源:basic.class.php

示例8: delete

 function delete($id)
 {
     $realestate = $this->getById($id);
     if (!empty($realestate)) {
         if ($realestate['image'] != "") {
             $images = explode("&fieldbreak;", $realestate['image']);
             foreach ($images as $img) {
                 removeFile(BASEPATH . "../upload/@files/" . $img);
             }
         }
         $this->db->delete('tags_estate', array('real_id' => $id));
         return $this->db->delete($this->_table, array('id' => $id));
     }
     return FALSE;
 }
开发者ID:duongbaphuc1,项目名称:newcanho,代码行数:15,代码来源:realestate_model.php

示例9: refreshUsersInfo

/**
 * ===> The rest of functions is for XML version only. <===
 * Update user's status
 * @comment - Refreshed
 */
function refreshUsersInfo($sId = "", $sMode = 'all')
{
    global $aXmlTemplates;
    global $sModule;
    $iUpdateInterval = (int) getSettingValue($sModule, "updateInterval");
    $iIdleTime = $iUpdateInterval * 3;
    $iDeleteTime = $iUpdateInterval * 6;
    $iCurrentTime = time();
    //--- refresh current user's track ---//
    getResult("UPDATE `" . MODULE_DB_PREFIX . "CurrentUsers` SET `Status`='" . USER_STATUS_OLD . "', `When`='" . $iCurrentTime . "' WHERE `ID`='" . $sId . "' AND `Status`<>'" . USER_STATUS_KICK . "' AND (`Status` NOT IN('" . USER_STATUS_NEW . "', '" . USER_STATUS_TYPE . "', '" . USER_STATUS_ONLINE . "') || (" . $iCurrentTime . "-`When`)>" . $iUpdateInterval . ") LIMIT 1");
    //--- refresh other users' states ---//
    getResult("UPDATE `" . MODULE_DB_PREFIX . "CurrentUsers` SET `When`=" . $iCurrentTime . ", `Status`='" . USER_STATUS_IDLE . "' WHERE `Status`<>'" . USER_STATUS_IDLE . "' AND `When`<=(" . ($iCurrentTime - $iIdleTime) . ")");
    getResult("DELETE FROM `" . MODULE_DB_PREFIX . "RoomsUsers` WHERE `Status`='" . ROOM_STATUS_DELETE . "' AND `When`<=(" . ($iCurrentTime - $iDeleteTime) . ")");
    $rFiles = getResult("SELECT `files`.`ID` AS `FileID` FROM `" . MODULE_DB_PREFIX . "Messages` AS `files` INNER JOIN `" . MODULE_DB_PREFIX . "CurrentUsers` AS `users` WHERE `files`.`Recipient`=`users`.`ID` AND `files`.`Type`='file' AND `users`.`Status`='" . USER_STATUS_IDLE . "' AND `users`.`When`<=" . ($iCurrentTime - $iDeleteTime));
    while ($aFile = mysql_fetch_assoc($rFiles)) {
        removeFile($aFile['FileID']);
    }
    //--- delete idle users, whose track was not refreshed more than delete time ---//
    getResult("DELETE FROM `" . MODULE_DB_PREFIX . "CurrentUsers`, `" . MODULE_DB_PREFIX . "RoomsUsers` USING `" . MODULE_DB_PREFIX . "CurrentUsers`, `" . MODULE_DB_PREFIX . "RoomsUsers` WHERE `" . MODULE_DB_PREFIX . "CurrentUsers`.`ID`=`" . MODULE_DB_PREFIX . "RoomsUsers`.`User` AND `" . MODULE_DB_PREFIX . "CurrentUsers`.`Status`='" . USER_STATUS_IDLE . "' AND `" . MODULE_DB_PREFIX . "CurrentUsers`.`When`<=" . ($iCurrentTime - $iDeleteTime));
    //--- delete old rooms ---//
    getResult("DELETE FROM `" . MODULE_DB_PREFIX . "Rooms`, `" . MODULE_DB_PREFIX . "RoomsUsers` USING `" . MODULE_DB_PREFIX . "Rooms`,`" . MODULE_DB_PREFIX . "RoomsUsers` WHERE `" . MODULE_DB_PREFIX . "Rooms`.`ID`=`" . MODULE_DB_PREFIX . "RoomsUsers`.`Room` AND `" . MODULE_DB_PREFIX . "Rooms`.`Status`='" . ROOM_STATUS_DELETE . "' AND `" . MODULE_DB_PREFIX . "Rooms`.`When`<=(" . ($iCurrentTime - $iDeleteTime) . ")");
    //--- delete empty rooms ---//
    if (getSettingValue($sModule, "removeRooms") == TRUE_VAL) {
        $aIds = getAdminIds();
        $sIds = count($aIds) > 0 ? " AND `OwnerID` NOT IN (" . implode(',', $aIds) . ")" : "";
        $rResult = getResult("SELECT DISTINCT(`Room`) FROM `" . MODULE_DB_PREFIX . "RoomsUsers`");
        $aFullRooms = array();
        $iCount = mysql_num_rows($rResult);
        for ($i = 0; $i < $iCount; $i++) {
            $aFullRoom = mysql_fetch_assoc($rResult);
            $aFullRooms[] = $aFullRoom['Room'];
        }
        $sFullRooms = count($aFullRooms) > 0 ? "`ID` NOT IN(" . implode(',', $aFullRooms) . ") AND " : "";
        getResult("UPDATE `" . MODULE_DB_PREFIX . "Rooms` SET `Status`='" . ROOM_STATUS_DELETE . "', `When`=" . $iCurrentTime . " WHERE " . $sFullRooms . "`OwnerID`<>0" . $sIds);
    }
    //--- delete old messages ---//
    getResult("DELETE FROM `" . MODULE_DB_PREFIX . "Messages` WHERE `Type`='text' AND `When`<=(" . ($iCurrentTime - $iDeleteTime) . ")");
    //--- Get information about users in the chat ---//
    switch ($sMode) {
        case 'update':
            $rRes = getResult("SELECT ccu.`ID` AS `ID`, ccu.`Nick` AS `Nick`, ccu.`Sex` AS `Sex`, ccu.`Age` AS `Age`, ccu.`Desc` AS `Desc`, ccu.`Photo` AS `Photo`, ccu.`Profile` AS `Profile`, ccu.`Status` AS `Status`, ccu.`Online` AS `Online`, rp.`Type` AS `Type` FROM `" . MODULE_DB_PREFIX . "Profiles` AS rp, `" . MODULE_DB_PREFIX . "CurrentUsers` AS ccu WHERE rp.`ID`=ccu.`ID` ORDER BY ccu.`When`");
            while ($aUser = mysql_fetch_assoc($rRes)) {
                if ($aUser['ID'] == $sId && !($aUser['Status'] == USER_STATUS_KICK || $aUser['Status'] == USER_STATUS_TYPE)) {
                    continue;
                }
                switch ($aUser['Status']) {
                    case USER_STATUS_NEW:
                        $sContent .= parseXml($aXmlTemplates['user'], $aUser['ID'], $aUser['Status'], $aUser['Nick'], $aUser['Sex'], $aUser['Age'], stripslashes($aUser['Desc']), $aUser['Photo'], $aUser['Profile'], $aUser['Type'], $aUser['Online']);
                        break;
                    case USER_STATUS_TYPE:
                        $sContent .= parseXml($aXmlTemplates['user'], $aUser['ID'], $aUser['Status'], $aUser['Type']);
                        break;
                    case USER_STATUS_ONLINE:
                        $sContent .= parseXml($aXmlTemplates['user'], $aUser['ID'], $aUser['Status'], $aUser['Type'], $aUser['Online']);
                        break;
                    case USER_STATUS_IDLE:
                    case USER_STATUS_KICK:
                        $sContent .= parseXml($aXmlTemplates['user'], $aUser['ID'], $aUser['Status']);
                        break;
                }
            }
            break;
        case 'all':
            $iRunTime = isset($_REQUEST['_t']) ? floor($_REQUEST['_t'] / 1000) : 0;
            $iCurrentTime -= $iRunTime;
            $rRes = getResult("SELECT ccu.`ID` AS `ID`, ccu.`Nick` AS `Nick`, ccu.`Sex` AS `Sex`, ccu.`Age` AS `Age`, ccu.`Desc` AS `Desc`, ccu.`Photo` AS `Photo`, ccu.`Profile` AS `Profile`, ccu.`Online` AS `Online`, rp.`Type` AS `Type`, (" . $iCurrentTime . "-`ccu`.`Start`) AS `Time` FROM `" . MODULE_DB_PREFIX . "Profiles` AS rp, `" . MODULE_DB_PREFIX . "CurrentUsers` AS ccu WHERE rp.`ID`=ccu.`ID` AND ccu.`Status` NOT IN ('" . USER_STATUS_IDLE . "', '" . USER_STATUS_KICK . "') AND rp.`Banned`='" . FALSE_VAL . "' ORDER BY ccu.`When`");
            while ($aUser = mysql_fetch_assoc($rRes)) {
                $sContent .= parseXml($aXmlTemplates['user'], $aUser['ID'], USER_STATUS_NEW, $aUser['Nick'], $aUser['Sex'], $aUser['Age'], stripslashes($aUser['Desc']), $aUser['Photo'], $aUser['Profile'], $aUser['Type'], $aUser['Online'], $aUser['Time']);
            }
            break;
    }
    return makeGroup($sContent, "users");
}
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:78,代码来源:functions.inc.php

示例10: clearTempImage

/**
 * 清除当前2小时以前的临时图片
 * @param string $dir 目录路径
 * @return void
 */
function clearTempImage($path = '')
{
    global $_FANWE;
    if ($path == '') {
        $_FANWE['clear_image_count'] = 0;
    }
    $max_time = mktime(date('H') - 2, 0, 0, date('m'), date('d'), date('Y')) - date('Z');
    $basepath = FANWE_ROOT . 'public/upload/temp/';
    $paths = array();
    if ($path != '') {
        $currentpath = str_replace($basepath, '', $path);
        $paths = explode('/', $currentpath);
        $year = (int) $paths[0];
        $month = isset($paths[1]) ? (int) $paths[1] : 1;
        $day = isset($paths[2]) ? (int) $paths[2] : 1;
        $hours = isset($paths[3]) ? (int) $paths[3] : 0;
        $day_time = mktime($hours, 0, 0, $month, $day, $year) - date('Z');
        if ($max_time <= $day_time) {
            return;
        }
        $currentpath .= '/';
    } else {
        $currentpath = '';
    }
    $dir = $basepath . $currentpath;
    $directory = dir($dir);
    while ($entry = @$directory->read()) {
        if ($_FANWE['clear_image_count'] >= 50) {
            break;
        }
        if ($entry != '.' && $entry != '..') {
            $filename = $dir . $entry;
            if (is_dir($filename)) {
                clearTempImage($filename);
                @rmdir($filename);
            }
            if (is_file($filename)) {
                removeFile($filename);
                $_FANWE['clear_image_count']++;
            }
        }
    }
    $directory->close();
}
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:49,代码来源:global.func.php

示例11: validate

validate();
if (defined("VALIDATED")) {
    if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_LISTEN || $_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_LOGIN) {
        listenXML();
        if (STATS_ACTIVE && !LOGIN) {
            $STATS->ProcessAction(ST_ACTION_LOG_STATUS, array($INTERNAL[CALLER_SYSTEM_ID]));
        }
    } else {
        if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_INIT_UPLOAD) {
            initUpload();
        } else {
            if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_SEND_FILE) {
                receiveFile();
            } else {
                if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_REMOVE_FILE) {
                    removeFile();
                } else {
                    if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_SET_IDLE) {
                        require LIVEZILLA_PATH . "_lib/functions.internal.man.inc.php";
                        setIdle($_POST[POST_INTERN_SERVER_IDLE]);
                    } else {
                        if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_SEND_RESOURCES) {
                            require LIVEZILLA_PATH . "_lib/functions.internal.process.inc.php";
                            processUpdateReport();
                            processArchiveChats();
                            processResources();
                        } else {
                            if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_REPORTS) {
                                require LIVEZILLA_PATH . "_lib/functions.internal.process.inc.php";
                                require LIVEZILLA_PATH . "_lib/functions.internal.build.inc.php";
                                processUpdateReport();
开发者ID:beardon,项目名称:stillwaterlife-web,代码行数:31,代码来源:intern.php

示例12: uploadWizard

        $_REQUEST['section'] = 'documents';
        $_REQUEST['uploaded_file'] = $cid[0];
        $GLOBALS['section'] = 'documents';
        $GLOBALS['uploaded_file'] = $cid[0];
        include_once $_DOCMAN->getPath('includes', 'documents');
        break;
    case "upload":
        $step = JRequest::getInt('step', 1);
        $method = JRequest::getCmd('radiobutton', null, 'post');
        if (!$method) {
            $method = JRequest::getCmd('method', 'http');
        }
        uploadWizard($step, $method, $old_filename);
        break;
    case "remove":
        removeFile($cid);
        break;
    case "update":
        uploadWizard(2, 'http', $old_filename);
        break;
    case "show":
    default:
        showFiles();
}
function showFiles()
{
    global $option, $section;
    global $_DOCMAN;
    $database = JFactory::getDBO();
    $mainframe = JFactory::getApplication();
    $limit = $mainframe->getCfg('list_limit');
开发者ID:janssit,项目名称:www.ondernemenddiest.be,代码行数:31,代码来源:files.php

示例13: clearDir

/**
 * 清除指定目录下的文件
 * 
 * @param string $dir
 *        	目录路径
 * @return void
 */
function clearDir($dir, $is_del_dir = false)
{
    if (!file_exists($dir)) {
        return;
    }
    $directory = dir($dir);
    while ($entry = $directory->read()) {
        if ($entry != '.' && $entry != '..') {
            $filename = $dir . '/' . $entry;
            if (is_dir($filename)) {
                clearDir($filename, $is_del_dir);
            }
            if (is_file($filename)) {
                removeFile($filename);
            }
        }
    }
    $directory->close();
    if ($is_del_dir) {
        @rmdir($dir);
    }
}
开发者ID:Bingle-labake,项目名称:coollive.com.cn,代码行数:29,代码来源:common_helper.php

示例14: play

function play($file)
{
    $app = Slim\Slim::getInstance();
    $log = $app->getLog();
    $log->info("-> playFile: {$file}");
    $out = '';
    $info = pathinfo($file);
    $picture_extensions = array("jpg", "JPG", "png");
    $extension = $info['extension'];
    $title = basename($file, '.' . $extension);
    if (in_array($extension, $picture_extensions)) {
        //shell_exec ('cp ' . escapeshellarg($file) . ' /tmp/fim_current');
        $out = 'Not implemented';
    } else {
        exec('pgrep omxplayer.bin', $pids);
        if (empty($pids)) {
            @unlink(FIFO);
            posix_mkfifo(FIFO, 0777);
            chmod(FIFO, 0777);
            shell_exec('./etc/omx_runner.sh ' . escapeshellarg($file) . ' ' . getOmxplayerOptions());
            setCurrent($file);
            removeFile($file);
            setWatchdog('PLAY');
            $out = 'Now playing: ' . basename($title);
        } else {
            send('q');
            $out = play($file);
        }
    }
    return $out;
}
开发者ID:skubij,项目名称:omxplayer-ui,代码行数:31,代码来源:index.php

示例15: createNewFolder

$currentDirectory = $baseDirectory;
if ($relativeDirectory != '') {
    $currentDirectory .= "/" . $relativeDirectory . "/";
}
$column = $_POST['column'] ? $_POST['column'] : "name";
$order = $_POST['order'] ? $_POST['order'] : "ascending";
$message = "";
$errorMessage = "";
if ($task == "createFolder") {
    $message .= createNewFolder($currentDirectory, $newFolder);
}
if (isset($_POST['submitUpload'])) {
    $message .= uploadFile($_FILES["uploadFile"], $currentDirectory);
}
if ($task == "removeFile") {
    $message .= removeFile($currentDirectory, $deleteFile);
}
if ($task == "renameFile") {
    $message .= renameFile($currentDirectory, $renameFrom, $renameTo);
}
$directoryList = getDirectoryList($currentDirectory);
$fileList = getFileList($currentDirectory);
$navigationList["Fnow"] = str_replace('\\', '/', pFNOW);
$navigationList["base"] = $cfg['base_directory'];
$navigationList["relative"] = $relativeDirectory;
$navigationList["column"] = $column;
$navigationList["order"] = $order;
$navigationList["pathData"] = $def['DIRECTORY'];
$directoryListXML = setDirectoryListXML($currentDirectory, $navigationList, $directoryList, $fileList, $message);
$result = processTransformation($directoryListXML, pFNOW . "/xsl/directoryList.xsl");
print $result;
开发者ID:rgevaert,项目名称:ABCD,代码行数:31,代码来源:index.php


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