本文整理汇总了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));
}
}
示例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');
}
示例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;
}
示例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;
}
示例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));
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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");
}
示例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();
}
示例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();
示例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');
示例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);
}
}
示例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;
}
示例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;