{"id":16827057,"url":"https://github.com/deminy/php-bsdiff","last_synced_at":"2025-04-11T03:43:27.905Z","repository":{"id":151093253,"uuid":"528285779","full_name":"deminy/php-bsdiff","owner":"deminy","description":"The bsdiff extension for PHP.","archived":false,"fork":false,"pushed_at":"2024-12-27T20:11:27.000Z","size":74,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T01:44:09.934Z","etag":null,"topics":["bsdiff","bspatch","php","php-extension"],"latest_commit_sha":null,"homepage":"https://pecl.php.net/bsdiff","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deminy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-24T05:56:48.000Z","updated_at":"2024-12-27T20:04:57.000Z","dependencies_parsed_at":"2023-11-30T21:26:14.063Z","dependency_job_id":"66ce85a1-de59-4db8-a88a-cf0be1be5b0e","html_url":"https://github.com/deminy/php-bsdiff","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deminy%2Fphp-bsdiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deminy%2Fphp-bsdiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deminy%2Fphp-bsdiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deminy%2Fphp-bsdiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deminy","download_url":"https://codeload.github.com/deminy/php-bsdiff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339289,"owners_count":21087213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bsdiff","bspatch","php","php-extension"],"created_at":"2024-10-13T11:19:30.645Z","updated_at":"2025-04-11T03:43:27.889Z","avatar_url":"https://github.com/deminy.png","language":"C","readme":"# php-bsdiff\n\n[![Build Status](https://github.com/deminy/php-bsdiff/actions/workflows/ci.yml/badge.svg)](https://github.com/deminy/php-bsdiff/actions/workflows/ci.yml)\n[![PHP version](https://img.shields.io/badge/php-%3E%3D%207.2-8892BF.svg)](https://github.com/deminy/php-bsdiff)\n\n`bsdiff` is a PHP extension to build and apply patches to binary files.\n\nThis PHP extension is based on [the bsdiff and bspatch libraries][1] maintained by Matthew Endsley. The original algorithm\nand implementation was developed by Colin Percival. The algorithm is detailed in Colin's paper, [Naïve Differences of Executable Code][1].\nFor more information, visit his website at \u003chttp://www.daemonology.net/bsdiff/\u003e.\n\n---\n\n## Requirements\n\n* PHP 7.2 to PHP 8.x\n* BZip2 1.0+\n* Linux, macOS, or Windows\n\n## Installation\n\n## Install via PECL\n\n```bash\npecl install bsdiff\n\n# or, if you want to install it without the prompts (i.e., using default installation option(s)):\nyes '' | pecl install bsdiff\n```\n\nIn case BZip2 can't be found automatically, use option `with-bz2` to specify the installation directory of BZip2. e.g.,\n\n```bash\npecl install -D 'with-bz2=\"/usr/local/opt/bzip2\"' bsdiff # If BZip2 is installed via Homebrew on MacOS.\n```\n\n## Manual Installation\n\n```bash\nphpize\n./configure\nmake\nmake test\nmake install\n```\n\nOnce done, add the following line to your `php.ini` file:\n\n```ini\nextension=bsdiff.so\n```\n\nIn case BZip2 can't be found automatically, use option `--with-bz2` to specify the installation directory of BZip2. e.g.,\n\n```bash\n./configure --with-bz2=/usr/local/opt/bzip2 # If BZip2 is installed via Homebrew on MacOS.\n```\n\n## Usage\n\nThere are two PHP functions added by the extension:\n\n```php\n/**\n  * @throws \\BsdiffException If there is any error happens.\n  */\nfunction bsdiff_diff(string $old_file, string $new_file, string $diff_file): void {}\n\n/**\n  * @throws \\BsdiffException If there is any error happens.\n  */\nfunction bsdiff_patch(string $old_file, string $new_file, string $diff_file): void {}\n```\n\nHere is an example on how to use the extension:\n\n```php\n\u003c?php\n$old_file  = '/path/to/the/old/file';\n$new_file  = '/path/to/the/new/file';\n$diff_file = '/path/to/the/diff/file';\n\n// To create the diff file.\ntry {\n    bsdiff_diff($old_file, $new_file, $diff_file);\n} catch (BsdiffException $e) {\n    // Handle the exception.\n}\n\n// To apply the diff file.\n$patched_file = '/path/to/the/patched/file';\ntry {\n    bsdiff_patch($old_file, $patched_file, $diff_file);\n} catch (BsdiffException $e) {\n    // Handle the exception.\n}\n// File $patched_file will have exactly the same content as file $new_file.\n```\n\n---\n\n## License\n\n[The PHP license](LICENSE).\n\n[1]: https://github.com/mendsley/bsdiff\n[2]: http://www.daemonology.net/papers/bsdiff.pdf\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeminy%2Fphp-bsdiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeminy%2Fphp-bsdiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeminy%2Fphp-bsdiff/lists"}