PHPackages                             textalk/php-sai - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. textalk/php-sai

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

textalk/php-sai
===============

1.1.0(11y ago)04.4k↓71.4%[1 PRs](https://github.com/Textalk/php-SAI/pulls)1PHP

Since Mar 13Pushed 10y ago7 watchersCompare

[ Source](https://github.com/Textalk/php-SAI)[ Packagist](https://packagist.org/packages/textalk/php-sai)[ RSS](/packages/textalk-php-sai/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (2)Versions (6)Used By (1)

php-SAI
=======

[](#php-sai)

Stand-Alone Interfaces and example implementations for PHP. Ideal for stubbing or mocking individual PHP functionality without depending on any lib or framework.

So far, includes interfaces to stub:

- cURL extension
- Request
- Response
- System

Usage
-----

[](#usage)

1. Add it as a dependency in require in composer.json: `"textalk/php-sai": "1.0"`
2. Let your applications bootstrap instantiate a system-implementation: `$curl = new SAI\System\Curl;`
3. Require a SAI instance in classes needing to call curl, system methods, get info from the request or affect the response: `public function myFooBar(SAI\Curl $curl) {…`
4. Use the SAI instance for the calls: `$ch = $curl->init('http://example.com/');`;
5. Use the mock-classes in test: `$curl = new SAI\Mock\Curl;`

Developer install
-----------------

[](#developer-install)

```
# Will get composer, install dependencies and run tests
make test
```

Changelog
---------

[](#changelog)

1.1.0

- Added SAI\\Response::setResponseCode.
- Added unit tests for SAI\\Mock\\Response.

1.0.0 - **BREAKING CHANGE**

- Namespaced to SAI:
    - `SAI_CurlInterface` -&gt; `SAI\Curl`
    - `SAI_CurlStub` -&gt; `SAI\Mock\Curl`
    - `SAI_Curl` -&gt; `SAI\System\Curl`
- Licence and copyright clarified.
- Added interface, mock and implementation for Request, Response and System.

0.1.3

- Added composer and packagist.

Licence
-------

[](#licence)

PHP-SAI is free software under the ISC License.

Copyright (c) 2012, Martin Büttner Copyright (c) 2015, Textalk AB

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~34 days

Total

3

Last Release

4061d ago

Major Versions

0.1.3 → 1.0.02015-05-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/239677ac812c8b17c82d1b925b90c6caffa1b5ddf01c332a3479b5fe37e890c1?d=identicon)[fiddur](/maintainers/fiddur)

---

Top Contributors

[![m-ender](https://avatars.githubusercontent.com/u/1846708?v=4)](https://github.com/m-ender "m-ender (12 commits)")[![fiddur](https://avatars.githubusercontent.com/u/148166?v=4)](https://github.com/fiddur "fiddur (2 commits)")[![mbuettner](https://avatars.githubusercontent.com/u/19902179?v=4)](https://github.com/mbuettner "mbuettner (1 commits)")[![swedieman](https://avatars.githubusercontent.com/u/7912311?v=4)](https://github.com/swedieman "swedieman (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/textalk-php-sai/health.svg)

```
[![Health](https://phpackages.com/badges/textalk-php-sai/health.svg)](https://phpackages.com/packages/textalk-php-sai)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
