ubuntu中用php按时间段导出netbeans6.9更改过的文件!

本文介绍了如何在Ubuntu环境中使用PHP按时间段导出NetBeans 6.9中修改过的文件。通过调整NetBeans的本地历史记录设置,将保存天数改为30天,然后利用export.sh脚本来删除更新文件夹中的旧文件,并将改动过的文件复制到指定位置。该方法有助于跟踪和管理项目中的文件变更。
摘要由CSDN通过智能技术生成

ubuntu中用php按时间段导出netbeans6.9更改过的文件!


用netbeans改了哪些文件,你还记得吗?一个一个地记,也太麻烦了。好在netbeans已经为你记住了,你可以在netbeans修改一下文件历史时间,默认是7天 。工具->选项->其它->本地历史记录。在“保存本地历史文件[30]天数”这里,我填写为30天。如果你的项目比较长,可以把天数改大一点。

您很可能需要安装unzip。如果你使用windows,你可能要改一下function ISO_8859_1_To_ANSI( $src)里面的内容,因为linux的目录是这样的"/linux-apps/www",windows是这样的"C:\www"


三个目录说明:

/media/linux-apps/www/wudimei.com    假如这是我的网站的项目文件夹,里面是我的源代码

/media/linux-apps/www/wudimei.com_update  这个是要放我修改过的文件。

/home/rong/.netbeans/6.9/var/filehistory   这个是netbeans的修改记录文件

我的目的就是要把修改过的文件放到wudimei.com_update这个文件夹中。


<?php
/***
 * export history files between start datetime given and end from netbeans
 * 
 * @author  admin@wudimei.com
 * @homepage http://wudimei.com/yangqingrong
 */
error_reporting(E_ALL);
ini_set("display_errors",1);


function read ($length='255')
{
   if (!isset ($GLOBALS['StdinPointer']))
   {
      $GLOBALS['StdinPointer'] = fopen ("php://stdin","r");
   }
   $line = fgets ($GLOBALS['StdinPointer'],$length);
   return trim ($line);
}





class FileHistoryExport
{
    public $projectDirectory;
    public $destDirectory;
    public $historyLocation;
    public $data; //md5_key src_path, history_dir
    public function __construct(  $projectDirectory ,$destDirectory, $historyLocation )
    {
        $this->projectDirectory = $projectDirectory;
        $this->destDirectory = $destDirectory;
        $this->historyLocation = $historyLocation;
        $this-&g
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值