承接 laposta/laposta-api-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

laposta/laposta-api-php

Composer 安装命令:

composer require laposta/laposta-api-php

包简介

Laposta api, free api to laposta.nl

README 文档

README

Build Coverage Packagist Version PHP Version License

A PHP library for interacting with the Laposta API, compatible with PSR-18 and PSR-17 standards.

Requirements

To use the Laposta API, the following is required:

  • PHP >= 8.1
  • cURL PHP extension
  • JSON PHP extension

Composer Installation

The easiest way to install this library is by requiring it via Composer:

composer require laposta/laposta-api-php

Manual Installation (Version-Scoped, Recommended)

This is the recommended manual installation path for WordPress and other plugin ecosystems. Multiple plugins may bundle different PSR-7 versions and different releases of laposta-api-php in the same runtime. The version-scoped build avoids both kinds of collisions by prefixing vendor dependencies and rewriting the public namespace to a release-specific value.

  1. Download the version-scoped zip:
  2. Extract it into your plugin (or another shared location).
  3. Load the version-scoped autoloader:
require_once __DIR__ . '/laposta-api-version-scoped/autoload.php';

The namespace suffix is derived from the release semantic version by concatenating major, minor, and patch. For example, release 2.3.0 exposes LapostaApi230\Laposta.

$laposta = new LapostaApi230\Laposta('your_api_key');

This build prefixes vendor dependencies under LapostaApi230\Vendor\*, so no global Psr\* symbols are introduced. The version-scoped build is intended for the default HTTP client; if you need to inject your own PSR-18/17/7 implementations, use the Composer distribution instead.

Manual Installation (Scoped, Compatibility Option)

This distribution only scopes vendor dependencies and keeps the public LapostaApi\* namespace unchanged. It is mainly useful if you need a stable namespace for compatibility and you know only one Laposta library version will be loaded in the runtime.

  1. Download the scoped zip:
  2. Extract it into your plugin (or another shared location).
  3. Load the scoped autoloader:
require_once __DIR__ . '/laposta-api-scoped/autoload.php';

This build prefixes vendor dependencies under LapostaApi\Vendor\*, but it does not isolate the public LapostaApi\* namespace across plugin versions.

Manual Installation (Unscoped, Not Recommended)

This path should only be used if you fully control the runtime and do not have other plugins/libraries that might define Psr\* symbols. In WordPress and other plugin ecosystems, use the version-scoped build above.

To use the unscoped bundle, include the autoloader:

require_once("/path/to/laposta-api-php/standalone/autoload.php");

Quick Example

$laposta = new LapostaApi\Laposta('your_api_key');
$member = $laposta->memberApi()->create($listId, ['email' => 'test@example.com', 'ip' => '123.123.123.123']);

Examples

This project includes a set of real, runnable examples organized by API resource (e.g., list, campaign, member).
Each example demonstrates a specific API operation and can be run via PHP CLI.
See examples/README.md for setup instructions and an overview of the available examples.

Extensibility

This library is built around PHP standards (PSR-18/17) and is designed to be flexible.
You can inject your own HTTP client and factories (e.g. Guzzle, Nyholm, Symfony components) via the constructor:

$laposta = new LapostaApi\Laposta(
    'your_api_key',
    httpClient: new \GuzzleHttp\Client(), // implements PSR-18
    requestFactory: ...,
    responseFactory: ...,
    streamFactory: ...,
    uriFactory: ...
);

If no client or factories are provided, the library uses its own lightweight implementations by default.

API Documentation

For the full API reference, see https://api.laposta.nl/doc.

Changelog

See CHANGELOG.md for a complete list of changes.

License

This library is open-sourced software licensed under the MIT license.

laposta/laposta-api-php 适用场景与选型建议

laposta/laposta-api-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 71.32k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2013 年 12 月 02 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「api」 「newsletter」 「email」 「marketing」 「email-marketing」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 laposta/laposta-api-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 laposta/laposta-api-php 我们能提供哪些服务?
定制开发 / 二次开发

基于 laposta/laposta-api-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 71.32k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 22
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 4
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-12-02