PHPackages                             xp-framework/scriptlet - 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. [Framework](/categories/framework)
4. /
5. xp-framework/scriptlet

AbandonedArchivedLibrary[Framework](/categories/framework)

xp-framework/scriptlet
======================

Scriptlets for the XP Framework

v9.2.2(7y ago)169.4k↓28.6%32BSD-3-ClausePHPPHP &gt;=5.6.0

Since Jan 10Pushed 7y ago14 watchersCompare

[ Source](https://github.com/xp-framework/scriptlet)[ Packagist](https://packagist.org/packages/xp-framework/scriptlet)[ Docs](http://xp-framework.net/)[ RSS](/packages/xp-framework-scriptlet/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (51)Used By (2)

Scriptlets for the XP Framework
===============================

[](#scriptlets-for-the-xp-framework)

[![Build Status on TravisCI](https://camo.githubusercontent.com/f87288bedd4ad3edd6b6920b78844ea8026ad5f8c6396946bd090252c1267b73/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f78702d6672616d65776f726b2f7363726970746c65742e706e67)](http://travis-ci.org/xp-framework/scriptlet)[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)[![Required PHP 5.6+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-5_6plus.png)](http://php.net/)[![Supports PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.png)](http://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/8a86befb6cc941864a4d469f36801031f6c1503596202f7ba85b125364a5dc45/68747470733a2f2f706f7365722e707567782e6f72672f78702d6672616d65776f726b2f7363726970746c65742f76657273696f6e2e706e67)](https://packagist.org/packages/xp-framework/scriptlet)

Everything that runs in the web in the XP Framework, is a scriptlet, at the beginning. Every higher-class API is derived from the simple `HttpScriptlet` class: `RestScriptlet`, `WorkflowScriptlet`, ...

The HttpScriptlet class
-----------------------

[](#the-httpscriptlet-class)

The `scriptlet.HttpScriptlet` class is the base class for any so-called scriptlet. A scriptlet is something that can serve HTTP requests.

The simplest form of answering an HTTP request in XP Framework goes like this:

```
namespace com\example\web;

class HelloScriptlet extends \scriptlet\HttpScriptlet {

  /**
   * Perform GET request
   *
   * @param  scriptlet.Request $request
   * @param  scriptlet.Response $response
   * @throws scriptlet.ScriptletException
   */
  public function doGet($request, $response) {
    $response->write(sprintf('

        Hello World scriptlet

          Hello %s

      ',
      htmlspecialchars($request->getParam('name', 'World'))
    ));
  }
}
```

This code generates a HTML page that shows a headline "Hello World" or "Hello $something" when something was given as GET-parameter "name".

Override `doPost()` or any of the other methods named after HTTP request types to serve these request types, as well.

Running it
----------

[](#running-it)

Use the `xp web` runner to serve your scriptlet:

```
$ xp web com.example.web.HelloScriptlet
[xpws-dev#7312] running localhost:8080 @ /path/to/web/project - Press  to exit
```

Now open  in your browser.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 83.9% 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 ~28 days

Recently: every ~58 days

Total

47

Last Release

2824d ago

Major Versions

v2.0.1 → v6.0.22015-02-12

v6.3.2 → v7.0.02016-02-01

v7.0.1 → v8.0.02016-02-21

v8.4.6 → v9.0.02017-06-19

7.0.0.x-dev → v9.2.12018-07-15

PHP version history (3 changes)v6.0.0PHP &gt;=5.4.0

v6.3.0PHP &gt;=5.5.0

v9.0.0PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/07d18d882c8b4aaf3466432f64018214f2771eda333202175431ee7233795376?d=identicon)[thekid](/maintainers/thekid)

---

Top Contributors

[![thekid](https://avatars.githubusercontent.com/u/696742?v=4)](https://github.com/thekid "thekid (14448 commits)")[![kiesel](https://avatars.githubusercontent.com/u/127769?v=4)](https://github.com/kiesel "kiesel (2390 commits)")[![ohinckel](https://avatars.githubusercontent.com/u/717217?v=4)](https://github.com/ohinckel "ohinckel (335 commits)")[![johannes85](https://avatars.githubusercontent.com/u/470531?v=4)](https://github.com/johannes85 "johannes85 (19 commits)")[![Stormwind](https://avatars.githubusercontent.com/u/836872?v=4)](https://github.com/Stormwind "Stormwind (13 commits)")[![andstefiul](https://avatars.githubusercontent.com/u/798415?v=4)](https://github.com/andstefiul "andstefiul (5 commits)")[![kusnier](https://avatars.githubusercontent.com/u/726429?v=4)](https://github.com/kusnier "kusnier (5 commits)")[![guel1973](https://avatars.githubusercontent.com/u/4669852?v=4)](https://github.com/guel1973 "guel1973 (4 commits)")[![beorgler](https://avatars.githubusercontent.com/u/2027220?v=4)](https://github.com/beorgler "beorgler (4 commits)")[![treuter](https://avatars.githubusercontent.com/u/1067905?v=4)](https://github.com/treuter "treuter (3 commits)")[![ppetermann](https://avatars.githubusercontent.com/u/69334?v=4)](https://github.com/ppetermann "ppetermann (1 commits)")

---

Tags

phprequestresponsescriptletswebxp-frameworkmodulexp

### Embed Badge

![Health badge](/badges/xp-framework-scriptlet/health.svg)

```
[![Health](https://phpackages.com/badges/xp-framework-scriptlet/health.svg)](https://phpackages.com/packages/xp-framework-scriptlet)
```

###  Alternatives

[xp-framework/compiler

XP Compiler

2026.0k9](/packages/xp-framework-compiler)

PHPackages © 2026

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