PHPackages                             funnyitselmo/sail - 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. funnyitselmo/sail

AbandonedArchivedLibrary[Framework](/categories/framework)

funnyitselmo/sail
=================

Sail is a lightweight object-oriented micro-framework written in PHP to create quick and simple yet powerful APIs.

1.0.5(8y ago)235BSDPHP

Since Mar 24Pushed 4y agoCompare

[ Source](https://github.com/FunnyItsElmo/PHP-Sail)[ Packagist](https://packagist.org/packages/funnyitselmo/sail)[ RSS](/packages/funnyitselmo-sail/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)DependenciesVersions (7)Used By (0)

Sail \[Discontinued\]
=====================

[](#sail-discontinued)

[![Latest Stable Version](https://camo.githubusercontent.com/0d4a3446657b688a04e6546a5523cee955b15c79287210143f04c7bd2f809f8f/68747470733a2f2f706f7365722e707567782e6f72672f66756e6e79697473656c6d6f2f7361696c2f762f737461626c65)](https://packagist.org/packages/funnyitselmo/sail) [![Total Downloads](https://camo.githubusercontent.com/a71f2af241c4d4533badbba099ad0b39ab928e6fcf1b81244097e4acabdecec6/68747470733a2f2f706f7365722e707567782e6f72672f66756e6e79697473656c6d6f2f7361696c2f646f776e6c6f616473)](https://packagist.org/packages/funnyitselmo/sail) [![Latest Unstable Version](https://camo.githubusercontent.com/ad981be21267576a8f61d5c7b1108383b259d547628fb11db3d0460d724f024e/68747470733a2f2f706f7365722e707567782e6f72672f66756e6e79697473656c6d6f2f7361696c2f762f756e737461626c65)](https://packagist.org/packages/funnyitselmo/sail) [![License](https://camo.githubusercontent.com/618ac9c2eeb3a5c32c95aa84d7720095be14c47ae71ff1ff8c6749960b41222a/68747470733a2f2f706f7365722e707567782e6f72672f66756e6e79697473656c6d6f2f7361696c2f6c6963656e7365)](https://packagist.org/packages/funnyitselmo/sail)

Sail is a lightweight object-oriented micro-framework written in PHP to create quick and simple yet powerful APIs.

### Installation

[](#installation)

```
composer require funnyitselmo/sail

```

### Hello World

[](#hello-world)

```
use Sail\Sail;
use Sail\Tree;
use Sail\Middleware;
use Sail\Exceptions\NoSuchRouteException;
use Sail\Exceptions\NoMiddlewareException;
use Sail\Exceptions\NoCallableException;

require '../vendor/autoload.php';

/**
 * The very first step is to create the Sail object
 */
$sail = new Sail();

/**
 * This will display 'Hello World!' if you send a simple GET request
 * GET $sail->get()
 * POST $sail->post()
 * PUT $sail->put()
 * PATCH $sail->patch()
 * DELETE $sail->delete()
 * OPTIONS $sail->options()
 */
$sail->get('/', function  ($request, $response) {
        $response->setData('Hello World!');
});

/**
 * Lets create a new sub tree which will handle all request that start
 * with test or any other route we will specifiy later
 * NOTE: Sail also extends Tree
 */
class TestTree extends Tree {

        public function build () {

                $this->get('/', function  ($request, $response) {
                        $response->setData('You can see me if you request /test');
                });

                //everything that is in curly braces is a variable
                $this->get('/{id}', function  ($request, $response, $id) {
                        $data = array('I can also handle variables! request /test/42', '{id} is ' . $id);

                        $response->setHeaders(array(
                                'Content-Type' => 'application/json'
                         ));

                        $response->setData(json_encode($data));
                });

        }

}

/**
 * It is time to create our first middleare.
 */
class AuthMiddleware implements Middleware {

        public function call() {
                //check if the user is allowed to view the route
                return true;
        }

}

/**
 * The following code part adds the route test to the router.
 * The Route links to a tree and just passes the request if the
 * middleware, in this case the AuthMiddleware, allows the request.
 */
$sail->tree('/test', new AuthMiddleware(), new TestTree());

/**
 * Now we just need to run the code and catch the
 * perhaps occurring exceptions
 */
try {
        $sail->run();
} catch (NoSuchRouteException $e) {
        echo $e->getMessage();
} catch (NoMiddlewareException $e) {
        echo $e->getMessage();
} catch (NoCallableException $e) {
        echo $e->getMessage();
}
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~94 days

Recently: every ~118 days

Total

6

Last Release

3226d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/127d003d34737368b88b42e4701561eece94729cbcf89615fe460b1173fc3ef8?d=identicon)[FunnyItsElmo](/maintainers/FunnyItsElmo)

---

Top Contributors

[![spravil](https://avatars.githubusercontent.com/u/979130?v=4)](https://github.com/spravil "spravil (4 commits)")

---

Tags

apiframeworkmicrorouterlightweightrestful

### Embed Badge

![Health badge](/badges/funnyitselmo-sail/health.svg)

```
[![Health](https://phpackages.com/badges/funnyitselmo-sail/health.svg)](https://phpackages.com/packages/funnyitselmo-sail)
```

###  Alternatives

[slim/slim

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs

12.2k49.9M1.3k](/packages/slim-slim)[phprest/phprest

PHP Rest Framework.

3049.3k](/packages/phprest-phprest)

PHPackages © 2026

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