Download the PHP package bangbangda/wecomarchive without Composer

On this page you can find all versions of the php package bangbangda/wecomarchive. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wecomarchive

wecomarchive

English | 简体中文

📖 中国用户请查看 中文文档 →

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

Install with PIE: pie install bangbangda/wecomarchive

Features

Requirements

Installation

Method 1: PIE (Recommended)

PIE is the modern way to install PHP extensions.

Basic Installation (Automatic):

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:

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

Method 2: Manual Installation

  1. Download and extract the source:

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

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

If you want to use a custom SDK path:

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

  1. Enable the extension in php.ini:

Configuration

INI Setting Default Description
wecomarchive.sdk_lib_path /usr/local/lib/libWeWorkFinanceSdk_C.so Path to the WeCom SDK library

Usage

Basic Example

Multi-version Private Keys (Recommended)

WeCom supports rotating the chat-archive private key. Each chat item carries a publickey_ver field. Configure private_keys and use decryptChatItem() to let the extension auto-select the correct private key for each item:

If publickey_ver cannot be matched in private_keys, a clear exception is thrown naming the missing version.

Download Media Files

Using Proxy

Custom SDK Library Path

API Reference

WeComArchive Class

Constructor

Options:

Detection rule: a value is treated as raw PEM content if it spans multiple lines (PEM bodies always contain newlines, file paths do not) or starts with -----BEGIN. Single-line values without the PEM header are treated as a file path. This tolerates PEM exports that have leading metadata (e.g. Bag Attributes lines from openssl pkcs12). private_key and private_keys may both be set — the former acts as a fallback for decryptChatItem().

getChatData

Fetch chat messages.

Parameters:

Returns: JSON string with chat data

decryptData

Decrypt a chat message using the private_key provided at construction time.

Parameters:

Returns: Decrypted message as JSON string

Throws: WECOM_ERR_PRIKEY if no private_key was configured.

decryptChatItem

Decrypt one chatdata item, auto-selecting the private key from private_keys by its publickey_ver.

Parameters:

Returns: Decrypted message as JSON string

Throws:

getMediaData

Download media file content.

Parameters:

Returns: Binary content of the media file

getSdkVersion

Get the SDK version.

Error Codes

Code Constant Description
10000 WECOM_ERR_PARAM Parameter error
10001 WECOM_ERR_NETWORK Network error
10002 WECOM_ERR_PARSE Data parse failed
10003 WECOM_ERR_SYSTEM System error
10004 WECOM_ERR_ENCRYPT Encryption failed
10005 WECOM_ERR_FILEID Invalid file ID
10006 WECOM_ERR_DECRYPT Decryption failed
10007 WECOM_ERR_PRIKEY Private key not found
10008 WECOM_ERR_ENCKEY Encrypt key parse error
10009 WECOM_ERR_IP IP not allowed
10010 WECOM_ERR_EXPIRED Data expired
10011 WECOM_ERR_CERT Certificate error

License

PHP License 3.01


All versions of wecomarchive with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bangbangda/wecomarchive contains the following files

Loading the files please wait ...