GithubHelp home page GithubHelp logo

phpdiff's Introduction

phpdiff

bsdiff for php extension 二进制差异包工具php扩展

  1. 对新旧两个文件的二进制对比,生成差异文件;
  2. 使用旧文件和差异包生成新文件

##Requirements(依赖环境)

bzip2 http://www.bzip.org/downloads.html

Download bzip2 and use make && make install

##Installation(安装PHP扩展)

  1. git clone https://github.com/EagleWu/phpdiff.git
  2. cd phpdiff
  3. phpize
  4. ./configure --with-php-config=/php-path/bin/php-config
  5. make && make install
  6. echo "extension=phpdiff.so" >> /php-path/etc/php.ini

##Usage(使用方法)

#####(bool) bsdiff(oldfile, newfile, diff.patch)

<?php

 //being create the diff.patch file
 bsdiff('oldfile.txt', 'newfile.txt', 'diff.patch');

#####(bool) bspatch(oldfile, newfile, diff.patch)

<?php

 //being create newfile with the above diff.patch
 bspatch('oldfile.txt', 'newfile_with_patch.txt', 'diff.patch');

##Try Demo(测试文件demo目录下)

eagle@Macbok-Pro:[~/Source/phpdiff]$tree demo/
demo/
├── diff.php
├── newfile.txt
├── oldfile.txt
└── patch.php

0 directories, 4 files

phpdiff's People

Contributors

wudi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.