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


PHP tar::addDirectory方法代码示例

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


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

示例1: date

//   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 (!empty($_POST['backupit'])) {
    if (!empty($_POST['gzip'])) {
        $suffix = '.gz';
    } else {
        $suffix = '';
    }
    $bkupfilename = RCMS_ROOT_PATH . 'backups/backup_' . date('H-i-s_d.m.Y') . '.tar' . $suffix;
    $backup = new tar();
    $backup->isGzipped = !empty($_POST['gzip']);
    $backup->filename = $bkupfilename;
    $path = getcwd();
    chdir(RCMS_ROOT_PATH);
    $backup->addDirectory('config', true);
    $backup->addDirectory('content', true);
    chdir($path);
    $backup->saveTar();
    rcms_showAdminMessage(__('Backup complete') . ' (' . basename($bkupfilename) . ')');
}
// Interface generation
$frm = new InputForm('', 'post', __('Backup data'));
$frm->addbreak(__('Backup data'));
$frm->hidden('backupit', '1');
$frm->addrow(__('To backup all your data from directories "config" and "content" press "Create backup" button. Speed of backup creation depends on size of your site. In order to be more secure we do not provide any backups management from there. You must download or delete backups using FTP or another way to reach /backups/ folder, because HTTP access for it was forbidden.'));
$frm->addrow(__('Pack file with gzip (uncheck if you experience problems)'), $frm->checkbox('gzip', '1', '', true));
$frm->show();
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:31,代码来源:backup.php


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