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


PHP file::removedir方法代码示例

本文整理汇总了PHP中file::removedir方法的典型用法代码示例。如果您正苦于以下问题:PHP file::removedir方法的具体用法?PHP file::removedir怎么用?PHP file::removedir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在file的用法示例。


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

示例1: removedir

 function removedir($dir)
 {
     if (is_dir($dir) && !is_link($dir)) {
         if ($dh = opendir($dir)) {
             while (($sf = readdir($dh)) !== false) {
                 if ('.' == $sf || '..' == $sf) {
                     continue;
                 }
                 file::removedir($dir . '/' . $sf);
             }
             closedir($dh);
         }
         return rmdir($dir);
     }
     return @unlink($dir);
 }
开发者ID:meiwenhui,项目名称:hdwiki,代码行数:16,代码来源:file.class.php

示例2: make_clean

 function make_clean()
 {
     file::removedir(UPGRADE_PATH . $this->package['release_code']);
     unlink(UPGRADE_PATH . $this->package['release_code'] . '.zip');
     return true;
 }
开发者ID:meiwenhui,项目名称:hdwiki,代码行数:6,代码来源:upgrade.class.php

示例3: douninstall

 function douninstall()
 {
     $plugin = $this->db->fetch_by_field('plugin', 'pluginid', $this->get[2]);
     if (!$plugin) {
         $this->message($this->view->lang['pluginNotExist']);
     }
     $identifier = $plugin['identifier'];
     $this->loadplugin($identifier);
     $_ENV["{$identifier}"]->uninstall();
     @file::removedir(HDWIKI_ROOT . "/plugins/{$identifier}");
     $_ENV['plugin']->remove_plugin($this->get[2]);
     $this->cache->removecache('plugin');
     $this->message($this->view->lang['pluginAddrName'] . $plugin[identifier] . $this->view->lang['pluginunInstallSuccess'], 'index.php?admin_plugin-list');
 }
开发者ID:meiwenhui,项目名称:hdwiki,代码行数:14,代码来源:admin_plugin.php

示例4: doinstall

 function doinstall()
 {
     if (isset($this->get[2]) && is_numeric($this->get[2])) {
         $style_download_url = $this->setting['app_url'] . "/hdapp.php?action=download&type=template&install=1&id=" . $this->get[2] . "&url=" . WIKI_URL;
         $zipcontent = @util::hfopen($style_download_url);
         $tmpdir = HDWIKI_ROOT . '/data/tmp/';
         file::forcemkdir($tmpdir);
         $tmpname = $tmpdir . util::random(6) . '.zip';
         file::writetofile($tmpname, $zipcontent);
         require HDWIKI_ROOT . "/lib/zip.class.php";
         require HDWIKI_ROOT . "/lib/xmlparser.class.php";
         $zip = new zip();
         if (!$zip->chk_zip) {
             $this->message($this->view->lang['styleInstallNoZlib'], '');
         }
         $ziplist = @$zip->get_List($tmpname);
         if (!(bool) $ziplist) {
             @unlink($tmpname);
             $this->message($this->view->lang['styleZipFail'], 'BACK');
         }
         $theme_name = $_ENV['theme']->get_theme_name($ziplist);
         @$zip->Extract($tmpname, $tmpdir);
         @unlink($tmpname);
         //move file
         $syle_path = $tmpdir . 'hdwiki';
         if (is_dir(HDWIKI_ROOT . '/style/' . $theme_name)) {
             @file::removedir($syle_path);
             $this->message($this->view->lang['stylePathRepeat'], 'BACK');
         }
         @file::copydir($syle_path, HDWIKI_ROOT);
         @file::removedir($syle_path);
         //save db
         $style_xml = HDWIKI_ROOT . '/style/' . $theme_name . '/desc.xml';
         if (!is_file($style_xml)) {
             $this->message($this->view->lang['styleXmlNotExist'], 'BACK');
         }
         $xmlnav = $_ENV['theme']->read_xml($theme_name);
         $style['name'] = $xmlnav['name'];
         $style['copyright'] = $xmlnav['copyright'];
         $style['path'] = $theme_name;
         $stylecon = $_ENV['theme']->add_check_style($style['path']);
         if ($stylecon == null) {
             $_ENV['theme']->add_style($style);
             $this->cache->removecache('style');
             $this->message($this->view->lang['styleInstallSuccess'], 'BACK');
         } else {
             $this->message($this->view->lang['styleDbPathRepeat'], 'index.php?admin_theme');
         }
     } else {
         $this->message($this->view->lang['commonParametersInvalidTip'], 'index.php?admin_theme');
     }
 }
开发者ID:meiwenhui,项目名称:hdwiki,代码行数:52,代码来源:admin_theme.php


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