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


PHP rcms_delete_files函数代码示例

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


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

示例1: save_cache

 function save_cache()
 {
     $this->CONTENT = ob_get_contents();
     //Записываем буфер в переменную
     rcms_delete_files($this->dir_cache . "/" . $this->hash_code);
     file_write_contents($this->dir_cache . "/" . $this->hash_code, $this->CONTENT);
 }
开发者ID:Parashutik,项目名称:ReloadCMS,代码行数:7,代码来源:cache.php

示例2: rcms_delete_files

function rcms_delete_files($file, $recursive = false, $wildcard = false)
{
    if ($recursive) {
        if ($wildcard) {
            $els = rcms_scandir(dirname($file), basename($file));
        } else {
            $els = rcms_scandir($file);
        }
        foreach ($els as $el) {
            rcms_delete_files($file . '/' . $el, true);
        }
    }
    if (!$wildcard) {
        if (is_dir($file)) {
            return rmdir($file);
        } else {
            return unlink($file);
        }
    } else {
        $els = rcms_scandir(dirname($file), basename($file));
        foreach ($els as $el) {
            if (is_dir(dirname($file) . '/' . $el)) {
                rmdir(dirname($file) . '/' . $el);
            } else {
                unlink(dirname($file) . '/' . $el);
            }
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:reloadcms-svn,代码行数:29,代码来源:filesystem.php

示例3: fupload_delete

function fupload_delete($file, $dir = FILES_PATH)
{
    if (is_file($dir . $file)) {
        rcms_delete_files($dir . $file);
        return true;
    } else {
        return false;
    }
}
开发者ID:Parashutik,项目名称:ReloadCMS,代码行数:9,代码来源:file-uploads.php

示例4: deleteSms

 /**
  * Deletes SMS from local queue
  * 
  * @param string $filename Existing sms filename
  * 
  * @return int 0 - ok, 1 - deletion unsuccessful, 2 - file not found 
  */
 public function deleteSms($filename)
 {
     if (file_exists(self::QUEUE_PATH . $filename)) {
         rcms_delete_files(self::QUEUE_PATH . $filename);
         $result = 0;
         if (file_exists(self::QUEUE_PATH . $filename)) {
             $result = 1;
         }
     } else {
         $result = 2;
     }
     return $result;
 }
开发者ID:nightflyza,项目名称:Ubilling,代码行数:20,代码来源:api.usms.php

示例5: ucm_delete

function ucm_delete($id)
{
    $filename = basename($id) . '.ucm';
    if (!is_file(DF_PATH . $filename)) {
        return false;
    }
    if (rcms_delete_files(DF_PATH . $filename)) {
        $config = file_get_contents(CONFIG_PATH . 'menus.ini');
        $config = preg_replace('/[0-9]* = "ucm:' . $id . '"\\s/i', '', $config);
        file_write_contents(CONFIG_PATH . 'menus.ini', $config);
        return true;
    } else {
        return false;
    }
}
开发者ID:Parashutik,项目名称:ReloadCMS,代码行数:15,代码来源:ucm.php

示例6: ucm_delete

function ucm_delete($id, $dir = MENU_MODULES_PATH)
{
    $id = basename($id);
    $workdir = $dir . 'ucm.' . $id;
    if (is_dir($workdir)) {
        if (rcms_delete_files($workdir, true)) {
            $config = file_get_contents(CONFIG_PATH . 'menus.ini');
            $config = preg_replace('/[0-9]* = "ucm.' . $id . '"\\s/i', '', $config);
            if (!file_write_contents(CONFIG_PATH . 'menus.ini', $config)) {
                return 6;
            }
            return 0;
        } else {
            return 4;
        }
    } else {
        return 4;
    }
}
开发者ID:BackupTheBerlios,项目名称:reloadcms-svn,代码行数:19,代码来源:ucm.php

示例7: upload_avatar

function upload_avatar()
{
    global $avatars_path;
    global $system;
    global $avatar_h;
    global $avatar_w;
    if (isset($_POST['upload_avatar']) and $_POST['upload_avatar'] == "true" and is_images($_FILES['avatar']['name'])) {
        $avarez = getimagesize($_FILES['avatar']['tmp_name']);
        $img = $avarez[2];
        switch ($img) {
            case "1":
                $img = 'gif';
                break;
            case "2":
                $img = 'jpg';
                break;
            case "3":
                $img = 'png';
                break;
            default:
                $img = 'Too big - deleted!';
                break;
        }
        //show_window(__('Uploaded images'),'width = '.$avarez[0].' px, '.'height = '.$avarez[1].' px, '.' image: '.$img,'center');
        if ($avarez[0] <= "{$avatar_w}" and $avarez[1] <= "{$avatar_h}") {
            $uploadfile = $avatars_path . $system->user['username'];
            $exttmp = strtolower(substr(strrev($_FILES['avatar']['name']), 0, 4));
            $ext = $exttmp;
            $ext[0] = $exttmp[2];
            $ext[2] = $exttmp[0];
            $ext = substr($ext, 0, 3);
            $tmpupl = $uploadfile;
            $uploadfile = $uploadfile . '.' . $ext;
            if ($ext == 'gif' and $img != 'Too big - deleted!') {
                if (file_exists($tmpupl . '.jpg')) {
                    rcms_delete_files($tmpupl . '.jpg');
                }
                if (file_exists($tmpupl . '.png')) {
                    rcms_delete_files($tmpupl . '.png');
                }
            }
            if ($ext == 'jpg' and $img != 'Too big - deleted!') {
                if (file_exists($tmpupl . '.gif')) {
                    rcms_delete_files($tmpupl . '.gif');
                }
                if (file_exists($tmpupl . '.png')) {
                    rcms_delete_files($tmpupl . '.png');
                }
            }
            if ($ext == 'png' and $img != 'Too big - deleted!') {
                if (file_exists($tmpupl . '.gif')) {
                    rcms_delete_files($tmpupl . '.gif');
                }
                if (file_exists($tmpupl . '.jpg')) {
                    rcms_delete_files($tmpupl . '.jpg');
                }
            }
            if (@move_uploaded_file($_FILES['avatar']['tmp_name'], $uploadfile)) {
                show_window(__('Result'), __('Avatar filesuccessfully uploaded'), 'center');
                $config_ext = parse_ini_file(CONFIG_PATH . 'adminpanel.ini');
                if ($config_ext['chmod_on']) {
                    chmod($uploadfile, octdec($config_ext['chmod']));
                    return $_FILES['avatar']['name'];
                }
            } else {
                show_window(__('Result'), __('Your avatar don\'t meet our requirements'), 'center');
            }
        }
    } else {
        show_window(__('Result'), __('Your avatar don\'t meet our requirements'), 'center');
    }
}
开发者ID:Parashutik,项目名称:ReloadCMS,代码行数:72,代码来源:api.avatars.php

示例8: parse_ini_file

}
$installer = parse_ini_file(CONFIG_PATH . 'installer.ini', true);
$uninstaller = parse_ini_file(CONFIG_PATH . 'uninstaller.ini', true);
// Delete installing modules
if (!empty($_POST['delete'])) {
    $result = '';
    foreach ($_POST['delete'] as $filename => $cond) {
        $filename = basename($filename);
        if (!empty($cond)) {
            $name = explode('_', $filename);
            if (empty($_POST['patch'][$uninstaller[$name[0]]['filename']])) {
                $files = explode(',', $uninstaller[$name[0]]['files']);
                foreach ($files as $file) {
                    $file = RCMS_ROOT_PATH . $file;
                    if (is_file($file) && $file != "." && $file != "..") {
                        rcms_delete_files($file);
                        $result .= __('File removed') . ': ' . $file . '<br/>';
                    }
                    if (is_dir($file) && $file != "." && $file != "..") {
                        if (@rmdir($file)) {
                            $result .= __('Directory removed') . ': ' . $file . '<br/>';
                        }
                    }
                }
                if ($file != './') {
                    $result .= __('File removed') . ': ' . $file . '<br/>';
                } else {
                    $result .= '------------------------------------------------------<br/>' . __('Module removed') . ': ' . $name[0] . '<br/><br/>';
                }
                if (is_file($installerPath . $filename)) {
                    $installer[$name[0]] = $uninstaller[$name[0]];
开发者ID:Parashutik,项目名称:ReloadCMS,代码行数:31,代码来源:uninstaller.php

示例9: gzfile_write_contents

function gzfile_write_contents($file, $text, $mode = 'w+')
{
    set_time_limit(0);
    if (!IGNORE_LOCK_FILES && is_file($file . '.lock')) {
        return false;
    }
    $fp = fopen($file . '.lock', 'w+');
    fwrite($fp, 'lock');
    fclose($fp);
    if ($fp = gzopen($file, $mode)) {
        if (!empty($text) && !gzwrite($fp, $text)) {
            return false;
        }
        gzclose($fp);
    } else {
        return false;
    }
    rcms_delete_files($file . '.lock');
    return true;
}
开发者ID:Parashutik,项目名称:ReloadCMS,代码行数:20,代码来源:filesystem.php

示例10: poll_remove

function poll_remove()
{
    if (!is_file(DATA_PATH . 'poll.dat')) {
        return 13;
    }
    if (!($file = @unserialize(@file_get_contents(DATA_PATH . 'poll.dat')))) {
        return false;
    }
    if (!is_file(DATA_PATH . 'poll.old.dat')) {
        $old = array();
    } else {
        $old = @unserialize(@file_get_contents(DATA_PATH . 'poll.old.dat'));
    }
    unset($file['ips']);
    $old[] = $file;
    file_write_contents(DATA_PATH . 'poll.old.dat', serialize($old));
    rcms_delete_files(DATA_PATH . 'poll.dat');
    return 0;
}
开发者ID:BackupTheBerlios,项目名称:reloadcms-svn,代码行数:19,代码来源:poll.php

示例11: curlang

if ($system->current_point == '__MAIN__') {
    if ($system->checkForRight('HELP')) {
        $lang = curlang();
        $help_dir = DATA_PATH . 'help/' . $lang;
        $module = get('edit');
        $file = $help_dir . '/' . $module;
        if (!is_dir(DATA_PATH . 'help/')) {
            mkdir(DATA_PATH . 'help/', 0777);
        }
        if (!is_dir($help_dir)) {
            mkdir($help_dir, 0777);
        }
        if (!empty($_GET['delete'])) {
            $dfile = $help_dir . '/' . get('delete');
            if (rcms_delete_files($dfile)) {
                show_window(__('Result'), __('File removed'));
            } else {
                show_window(__('Result'), __('Error occurred') . ':' . $dfile);
            }
        }
        if (!empty($_POST['save']) && !empty($module)) {
            file_write_contents($file, $_POST['help_edit']);
            show_window(__('Result'), __('File updated') . '. ' . __('Show') . ' — ' . show_help($module));
        }
        if (!empty($module)) {
            $result = file_exists($file) ? file_get_contents($file) : '';
            $frm = new InputForm('', 'post', __('Submit'));
            $frm->hidden('save', '1');
            $frm->addrow('', $frm->textarea('help_edit', $result, 55, 15) . tinymce_selector('help_edit'), 'top');
            $result = $frm->show(true);
开发者ID:Parashutik,项目名称:ReloadCMS,代码行数:30,代码来源:index.php

示例12: articles_delete_category

function articles_delete_category($id, $dir = ARTICLES_PATH)
{
    if (!is_dir($dir . $id)) {
        return 12;
    }
    $catprefix = $dir . $id . '/';
    $articles = rcms_scandir($dir);
    foreach ($articles as $article) {
        if (is_dir($catprefix . $article)) {
            articles_delete($id, $article, $dir);
        }
    }
    rcms_delete_files($catprefix, true);
    return 0;
}
开发者ID:BackupTheBerlios,项目名称:reloadcms-svn,代码行数:15,代码来源:articles.php

示例13: removeImage

 function removeImage($filename)
 {
     $this->unregisterInIndex($filename);
     if (is_file(GALLERY_IMAGES_DIR . $filename)) {
         rcms_delete_files(GALLERY_IMAGES_DIR . $filename);
     }
     if (is_file(GALLERY_COMMENTS_DIR . $filename . '.dat')) {
         rcms_delete_files(GALLERY_COMMENTS_DIR . $filename . '.dat');
     }
     if (is_file(GALLERY_THUMBS_DIR . $filename . '.jpg')) {
         rcms_delete_files(GALLERY_THUMBS_DIR . $filename . '.jpg');
     }
     return true;
 }
开发者ID:Parashutik,项目名称:ReloadCMS,代码行数:14,代码来源:api.gallery.php

示例14: base64_decode

 }
 //downloading mysql dump
 if (wf_CheckGet(array('download'))) {
     if (cfr('ROOT')) {
         $filePath = base64_decode($_GET['download']);
         zb_DownloadFile($filePath);
     } else {
         show_error(__('Access denied'));
     }
 }
 //deleting dump
 if (wf_CheckGet(array('deletedump'))) {
     if (cfr('ROOT')) {
         $deletePath = base64_decode($_GET['deletedump']);
         if (file_exists($deletePath)) {
             rcms_delete_files($deletePath);
             log_register('BACKUP DELETE `' . $deletePath . '`');
             rcms_redirect('?module=backups');
         } else {
             show_error(__('Not existing item'));
         }
     } else {
         show_error(__('Access denied'));
     }
 }
 function web_AvailableDBBackupsList()
 {
     $backupsPath = DATA_PATH . 'backups/sql/';
     $availbacks = rcms_scandir($backupsPath);
     $result = __('No existing DB backups here');
     if (!empty($availbacks)) {
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:31,代码来源:index.php

示例15: opendir

////////////////////////////////////////////////////////////////////////////////
//   Copyright (C) 2004 ReloadCMS Development Team                            //
//   http://reloadcms.sf.net                                                  //
//                                                                            //
//   This program is distributed in the hope that it will be useful,          //
//   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     //
//                                                                            //
//   This product released under GNU General Public License v2                //
////////////////////////////////////////////////////////////////////////////////
if (isset($_POST['deletebackupility'])) {
    $d = opendir(BACKUP_PATH);
    while ($f = readdir($d)) {
        if (is_file(BACKUP_PATH . $f)) {
            rcms_delete_files(BACKUP_PATH . $f);
        }
    }
    closedir($d);
}
if (!empty($_POST['backupit'])) {
    $bkupfilename = './backups/backup_' . date('H-i-s_d.m.Y') . '.tar.gz';
    $bkp = new gzip_file($bkupfilename);
    $bkp->set_options(array('basedir' => RCMS_ROOT_PATH, 'overwrite' => 1, 'level' => 9));
    $bkp->add_files('config');
    $bkp->add_files('content');
    $bkp->create_archive();
    $frm = new InputForm("", "post", $lang['admincp']['general']['backup']['getit']);
    $frm->addbreak($lang['admincp']['general']['backup']['done']);
    $frm->hidden('getit', basename($bkupfilename));
    $frm->show();
开发者ID:BackupTheBerlios,项目名称:reloadcms-svn,代码行数:30,代码来源:general.bkp.php


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