本文整理汇总了PHP中delete_folder函数的典型用法代码示例。如果您正苦于以下问题:PHP delete_folder函数的具体用法?PHP delete_folder怎么用?PHP delete_folder使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了delete_folder函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upload_multi_file
/**
* [upload multi file]
* @param $source [Đường dẫn nơi chứa file upload]
* @param $folder [Tên thư mục sẽ tạo khi upload]
*/
function upload_multi_file($source, $folder)
{
$flag = true;
if (isset($_FILES['images']['name']) && $_FILES['images']['name'] != null) {
// Check folder
// Create folder
if (!is_dir($source . $folder)) {
mkdir($source . $folder, 0770);
} else {
delete_folder($source . $folder);
mkdir($source . $folder, 0770);
}
// Check type file image
foreach ($_FILES['images']['type'] as $key => $value) {
$type = substr($value, 6);
if ($type == "png" || $type == "jpeg" || $type == "jpg") {
//Loop through each file
for ($i = 0; $i < count($_FILES['images']['name']); $i++) {
$tmpPath = $_FILES['images']['tmp_name'][$i];
$images = $_FILES['images']['name'][$i];
if ($tmpPath != null) {
$path = $source . $folder . "/";
move_uploaded_file($tmpPath, $path . $images);
}
}
} else {
$flag = false;
die("Type {$type} not support !!!");
}
}
} else {
$flag = false;
}
return $flag;
}
示例2: delete_multi_folder
/**
* Delete multi folder
* @param array $data [các folder cần xóa]
* @param string $path [dường dẫn tới nơi chứa folder cần xóa]
*/
function delete_multi_folder($data = array(), $path)
{
if ($data) {
foreach ($data as $value) {
delete_folder($path . $value);
}
}
}
示例3: delete
function delete($folderID)
{
$result = false;
if ($folderID != "") {
include '../access.php';
$access = checkAccess('n', 't');
if ($access) {
$user = new User();
$username = $user->getUsername();
include "../includes/bookmarks.php";
if (f_belongs_to($folderID, $username, "../")) {
$resultArr = delete_folder($folderID, $username, "../");
$result = $resultArr['success'];
}
}
}
return $result;
}
示例4: showMedia
showMedia($dirPath);
break;
case "newdir":
if (ini_get('safe_mode') == "On") {
mosRedirect("index2.php?option=com_media&listdir=" . $_POST['dirPath'], T_("Directory creation not allowed while running in SAFE MODE as this can cause problems."));
} else {
create_folder($foldername, $dirPath);
}
showMedia($dirPath);
break;
case "delete":
delete_file($delFile, $listdir);
showMedia($listdir);
break;
case "deletefolder":
delete_folder($delFolder, $listdir);
showMedia($listdir);
break;
case "list":
listImages($listdir);
break;
default:
showMedia($listdir);
break;
}
function delete_file($delfile, $listdir)
{
global $mosConfig_absolute_path;
$del_image = $mosConfig_absolute_path . "/images/stories" . $listdir . "/" . $delfile;
unlink($del_image);
}
示例5: delete_folder
function delete_folder($folder)
{
$dir = @opendir($folder);
while ($item = readdir($dir)) {
if (is_dir("{$folder}/{$item}")) {
if ($item != '.' && $item != '..') {
delete_folder("{$folder}/{$item}");
}
} else {
@unlink("{$folder}/{$item}");
}
}
closedir($dir);
@rmdir($folder);
}
示例6: updateFolder
/**
* Delete or create a filder
*
* @param boolean $set <b>true</b> Create a folder
* <b>false</b> Delete the folder
*/
public function updateFolder($set)
{
if ($this->hasFolder() && !$set) {
delete_folder($this->hasFolder(), true);
}
if (!$this->hasFolder() && $set) {
create_folder(_("Dateiordner der Gruppe:") . ' ' . $this->name, _("Ablage für Ordner und Dokumente dieser Gruppe"), $this->id, 15);
}
}
示例7: delete_file
delete_file("application/models/stock_model.php");
delete_file("application/modules_core/admin/views/admin_login.php");
delete_file("application/modules_core/admin/views/admin_signin_fail.php");
delete_file("application/modules_core/admin/views/welcome.php");
delete_file("application/modules_core/appointment/views/addfromfollowup.php");
delete_file("application/modules_core/appointment/views/editAvailableApp.php");
delete_file("application/modules_core/appointment/views/edit.php");
delete_file("application/modules_core/appointment/views/add.php");
delete_file("application/modules_core/appointment/views/addApp.php");
delete_file("application/modules_core/appointment/views/CancelAppointment.php");
delete_file("application/modules_core/contact/controllers/contact.php");
delete_folder("application/modules_core/contact/controllers");
delete_file("application/modules_core/contact/views/add.php");
delete_file("application/modules_core/contact/views/browse.php");
delete_file("application/modules_core/contact/views/edit.php");
delete_folder("application/modules_core/contact/views");
execute_sql_file("sql/013.sql", $dbprefix, $con);
$current_version = '0.1.3';
}
if ($current_version == '0.1.3') {
display_information("Upgrading from 0.1.3 to 0.1.4");
execute_sql_file("sql/014.sql", $dbprefix, $con);
//Delete not required files
delete_file("application/modules_core/patient/views/add_patient.php");
delete_file("application/modules_core/patient/views/add_patient_old.php");
delete_file("application/modules_core/patient/views/edit.php");
delete_file("application/modules_core/patient/views/visit_view.php");
delete_file("application/modules_core/payment/views/advance_payment.php");
$current_version = '0.1.4';
}
if ($current_version == '0.1.4') {
示例8: array
$response = array('error' => 0, 'folder_id' => $folder_id, 'folders' => $folders);
} else {
$response = array('error' => 1, 'error_message' => $folder_id);
}
echo $json_encoder->encode($response);
exit;
}
// delete folder
if ($site->user->user_id && $site->fdat['op'] == 'delete_folder' && (int) $site->fdat['folder_id']) {
verify_form_token();
include_once $class_path . 'adminpage.inc.php';
include_once $class_path . 'custom.inc.php';
include_once $class_path . 'lgpl/Services_JSON.class.php';
$json_encoder = new Services_JSON();
$folder_id = (int) $site->fdat['folder_id'];
$delete_message = delete_folder($folder_id);
if ($delete_message === true) {
$response = array('error' => 0);
} else {
$response = array('error' => 1, 'error_message' => $delete_message);
}
echo $json_encoder->encode($response);
exit;
}
// edit folder
if ($site->user->user_id && $site->fdat['op'] == 'edit_folder' && (int) $site->fdat['folder_id'] && $site->fdat['name']) {
verify_form_token();
include_once $class_path . 'adminpage.inc.php';
include_once $class_path . 'custom.inc.php';
include_once $class_path . 'lgpl/Services_JSON.class.php';
$json_encoder = new Services_JSON();
示例9: delete_folder
<?php
/**
*
* delete folder page, the site deletes a folder
*
* @author Patrick Lockley
* @version 1.0
* @copyright Copyright (c) 2008,2009 University of Nottingham
* @package
*/
require_once '../../../config.php';
include "../folder_library.php";
delete_folder(mysql_real_escape_string($_POST['folder_id']));
示例10: IsPriv
}
if(isset($_GET["chgperms-js"])){chgperms_js();exit;}
if(isset($_POST["chgperms-file"])){chgperms_file();exit;}
if(isset($_GET["remove-file-js"])){remove_file_js();exit;}
if(isset($_POST["remove-file"])){remove_file();exit;}
if(isset($_GET["popup"])){popup();exit;}
if(isset($_GET["browse-folder"])){browse_folder();exit;}
if(isset($_GET["folder-infos"])){folder_infos();exit;}
if(isset($_GET["top-bar"])){top_bar();exit;}
if(isset($_GET["file-info"])){file_info();exit;}
if(isset($_GET["download-file"])){download_file();exit;}
if(isset($_GET["create-folder"])){create_folder();exit;}
if(isset($_GET["delete-folder"])){delete_folder();exit;}
if(isset($_GET["share-folder"])){share_folder();exit;}
if(isset($_GET["unshare-rsync"])){rsync_unshare();exit;}
if(isset($_GET["upload-file"])){upload_file_popup();exit;}
if(isset($_GET["form-upload"])){upload_file_iframe();exit;}
if( isset($_GET['TargetpathUploaded']) ){upload_form_perform();exit();}
if(isset($_GET["loupe-js"])){loupe_js();exit;}
if(isset($_GET["loupe-popup"])){loupe_popup();exit;}
js();
function IsPriv(){
if(!is_object($GLOBALS["USERMENUS"])){$users=new usersMenus();$GLOBALS["USERMENUS"]=$users;}else{$users=$GLOBALS["USERMENUS"];}
$users=new usersMenus();
示例11: delete_folder
<?php
/**
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
* The Apereo Foundation licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
*
* delete folder page, the site deletes a folder
*
* @author Patrick Lockley
* @version 1.0
* @package
*/
require_once '../../../config.php';
include "../folder_library.php";
delete_folder($_POST['folder_id']);
示例12: delete_folder
function delete_folder($path)
{
if (!is_dir($path)) {
return false;
}
foreach (scandir($path) as $item) {
if ($item != '.' && $item != '..') {
if (is_file($path . '/' . $item)) {
unlink($path . '/' . $item);
} elseif (is_dir($path . '/' . $item)) {
delete_folder($path . '/' . $item);
}
}
}
if (is_dir($path)) {
rmdir($path);
}
if (is_dir($path)) {
return false;
} else {
return true;
}
}
示例13: get_tree_xml
// this is the status flag I use to check if the actions where sucessful
if (isset($_GET['getTreeXML'])) {
echo get_tree_xml();
return;
}
if (isset($_GET['createdir'])) {
// creates a directory
$status = create_dir($dir, $enable_folder_creation, $fix_utf8);
} else {
if (isset($_GET['renamedir'])) {
// Rename a directory
$status = rename_dir($dir, $enable_folder_rename, $fix_utf8);
} else {
if (isset($_GET['deletedir'])) {
// the check if the file can be deleted is done before - if it is not possible we never get here!
$status = delete_folder($dir, $enable_folder_deletion, $fix_utf8);
}
}
}
// needed for browsing - we check if a [..] is possible - it is never allowed to go higher as the defined root!
$show_root = isset($_SESSION["TFU_ROOT_DIR"]) ? $dir != $_SESSION["TFU_ROOT_DIR"] : false;
if (isset($_GET['changedir'])) {
// Change a directory
$dir = change_folder($dir, $show_root, $enable_folder_browsing, $exclude_directories);
}
// needed for browsing - we check again because folder could have changed!
$show_root = isset($_SESSION["TFU_ROOT_DIR"]) ? $dir != $_SESSION["TFU_ROOT_DIR"] : false;
// Read all files and folders
$size = read_dir($dir, $myFiles, $myDirs, $fix_utf8, $exclude_directories, $sort_files_by_date);
// Sort files and folders
sort_data($myFiles, $myDirs, $sort_files_by_date);
示例14: createQuestion
//wurde Code fuer Loeschen von Ordnern ubermittelt (=id+"_d_"), wird entsprechende Funktion aufgerufen
if ($open_cmd == 'd') {
if ( ($count = doc_count($open_id)) ){
$question = createQuestion(sprintf(_('Der ausgewählte Ordner enthält %s Datei(en). Wollen Sie den Ordner wirklich löschen?'), $count), array('open' => $open_id.'_rd_'));
} else {
delete_folder($open_id, true);
$open_id = $folder_tree->getParents($open_id);
$open_id = $open_id[0];
$folder_tree->init();
}
}
//Loeschen von Ordnern im wirklich-ernst Mode
if ($open_cmd == 'rd') {
delete_folder($open_id, true);
$open_id = $folder_tree->getParents($open_id);
$open_id = $open_id[0];
$folder_tree->init();
}
//wurde Code fuer Loeschen von Dateien ubermittelt (=id+"_fd_"), wird erstmal nachgefragt
if ($open_cmd == 'fd') {
$query = "SELECT filename, {$_fullname_sql['full']} AS fullname, username
FROM dokumente
LEFT JOIN auth_user_md5 USING (user_id)
LEFT JOIN user_info USING (user_id)
WHERE dokument_id = ?";
$statement = DBManager::get()->prepare($query);
$statement->execute(array($open_id));
$result = $statement->fetch();
示例15: delete_folder
function delete_folder($tmp_path)
{
if (!is_writeable($tmp_path) && is_dir($tmp_path)) {
chmod($tmp_path, 0777);
}
$handle = opendir($tmp_path);
while ($tmp = readdir($handle)) {
if ($tmp != '..' && $tmp != '.' && $tmp != '') {
if (is_writeable($tmp_path . DS . $tmp) && is_file($tmp_path . DS . $tmp)) {
unlink($tmp_path . DS . $tmp);
} elseif (!is_writeable($tmp_path . DS . $tmp) && is_file($tmp_path . DS . $tmp)) {
chmod($tmp_path . DS . $tmp, 0666);
unlink($tmp_path . DS . $tmp);
}
if (is_writeable($tmp_path . DS . $tmp) && is_dir($tmp_path . DS . $tmp)) {
delete_folder($tmp_path . DS . $tmp);
} elseif (!is_writeable($tmp_path . DS . $tmp) && is_dir($tmp_path . DS . $tmp)) {
chmod($tmp_path . DS . $tmp, 0777);
delete_folder($tmp_path . DS . $tmp);
}
}
}
closedir($handle);
rmdir($tmp_path);
if (!is_dir($tmp_path)) {
return true;
} else {
return false;
}
}