PHPackages                             bangbangda/wecomarchive - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. bangbangda/wecomarchive

ActivePhp-ext

bangbangda/wecomarchive
=======================

PHP extension for WeCom (WeChat Work) Chat Archive functionality. Provides object-oriented interface to fetch chat messages, decrypt content, and download media files.

v1.0.0(4mo ago)00PHP-3.01CPHP &gt;=8.0

Since Jan 7Pushed 4mo agoCompare

[ Source](https://github.com/bangbangda/wecomarchive)[ Packagist](https://packagist.org/packages/bangbangda/wecomarchive)[ Docs](https://github.com/bangbangda/wecomarchive)[ RSS](/packages/bangbangda-wecomarchive/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

wecomarchive
============

[](#wecomarchive)

English | **[简体中文](README_CN.md)**

> 📖 **中国用户请查看 [中文文档](README_CN.md) →**

PHP extension for WeCom (WeChat Work) Chat Archive functionality.

> **Install with [PIE](https://github.com/php/pie)**: `pie install bangbangda/wecomarchive`

Features
--------

[](#features)

- **Automatic SDK Download**: WeCom SDK is automatically downloaded during installation
- **Object-Oriented Interface**: Clean, modern PHP API for chat archive operations
- **Full Functionality**: Fetch messages, decrypt content, download media files
- **Flexible Configuration**: Support for custom SDK paths and proxy settings

Requirements
------------

[](#requirements)

- PHP &gt;= 8.0
- Linux (x86\_64 or ARM64)
- OpenSSL &gt;= 1.1.0

Installation
------------

[](#installation)

### Method 1: PIE (Recommended)

[](#method-1-pie-recommended)

[PIE](https://github.com/php/pie) is the modern way to install PHP extensions.

**Basic Installation (Automatic):**

```
# Install PIE if you haven't already
composer global require php/pie

# Install the extension (SDK will be downloaded automatically)
pie install bangbangda/wecomarchive
```

The WeCom SDK will be **automatically downloaded** during installation to `/usr/local/lib/`.

**Advanced Configuration:**

If you need to customize the SDK path or the automatic download fails:

```
# Specify custom SDK library path
pie install bangbangda/wecomarchive --with-wecomarchive-sdk-path=/custom/lib/path

# Then manually download SDK to your custom path
vendor/bin/download-sdk.sh --path /custom/lib/path
```

**Note:** If automatic download fails due to permission issues, you may need to run:

```
# Download SDK manually with sudo
sudo ./scripts/download-sdk.sh
```

### Method 2: Manual Installation

[](#method-2-manual-installation)

1. Download and extract the source:

```
git clone https://github.com/bangbangda/wecomarchive.git
cd wecomarchive
```

2. Build the extension (SDK will be downloaded automatically during configure):

```
phpize
./configure
make
sudo make install
```

**The WeCom SDK will be automatically downloaded to `/usr/local/lib/` during the `./configure` step.**

If you want to use a custom SDK path:

```
phpize
./configure --with-wecomarchive-sdk-path=/custom/lib/path
make
sudo make install
```

If automatic download fails, you can manually download the SDK first:

```
chmod +x scripts/download-sdk.sh
./scripts/download-sdk.sh
# Or with custom path
./scripts/download-sdk.sh --path /custom/path
```

3. Enable the extension in php.ini:

```
extension=wecomarchive.so
wecomarchive.sdk_lib_path=/usr/local/lib/libWeWorkFinanceSdk_C.so
```

Configuration
-------------

[](#configuration)

INI SettingDefaultDescription`wecomarchive.sdk_lib_path``/usr/local/lib/libWeWorkFinanceSdk_C.so`Path to the WeCom SDK libraryUsage
-----

[](#usage)

### Basic Example

[](#basic-example)

```
