一个关于php操作svn的功能类

最近项目有需求需要定期svn更新项目,并打包成下载包供下载,参考了网上的一些相关代码后写了如下一个用来进行svn操作的小组件

关于php进行zip打包的组件:http://blog.csdn.net/meeeen7/article/details/78297467

关于php进行download下载的组件:http://blog.csdn.net/meeeen7/article/details/78297528

define('SVN_USERNAME','');
define('SVN_PASSWORD','');

class svnUtil   {

    /**
     * List directory entries in the repository
     *
     * @param string a specific project repository path
     * @return bool true, if validated successfully, otherwise false
     */
    static public function ls($repository)  {
        $command = "svn ls " . $repository;
        $output  = svnUtil::runCmd($command);
        $output  = implode("<br>", $output);
        if (strpos($output, 'non-existent in that revision')) {
            return false;
        }

        return "<br>" . $command . "<br>" . $output;
    }

    /**
     * Duplicate something in working copy or repository, remembering history
     *
     * @param $src
     * @param $dst
     * @param $comment string specify log message
     * @return bool true, if copy successfully, otherwise return the error message
     *
     * @todo comment need addslashes for svn commit
     */
    static public function copy($src, $dst, $comment)   {
        $command = "svn cp $src $dst -m '$comment'";
        $output  = svnUtil::runCmd($command);
        $output  = implode("<br>", $output);

        if (strpos($output, 'Committ
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
小资源 希望能给初学者一些帮助 更新依赖包 yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers patch 安装mysql /usr/sbin/groupadd mysql /usr/sbin/useradd -g mysql mysql tar zxvf mysql-5.5.7-rc.tar.gz cd mysql-5.5.7-rc ./configure --prefix=/usr/local/webserver/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=partition,innobase,myisammrg make && make install chmod +w /usr/local/webserver/mysql chown -R mysql:mysql /usr/local/webserver/mysql cd ../ 创建目录 mkdir -p /data0/mysql/3306/data/ mkdir -p /data0/mysql/3306/binlog/ mkdir -p /data0/mysql/3306/relaylog/ chown -R mysql:mysql /data0/mysql/ 以mysql用户帐号的身份建立数据表: /usr/local/webserver/mysql/bin/mysql_install_db --basedir=/usr/local/webserver/mysql --datadir=/data0/mysql/3306/data --user=mysql vi /data0/mysql/3306/my.cnf 输入 [client] character-set-server = utf8 port = 3306 socket = /tmp/mysql.sock [mysqld] character-set-server = utf8 replicate-ignore-db = mysql replicate-ignore-db = test replicate-ignore-db = information_schema user = mysql port = 3306 之后请参考资料

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值