PHPackages                             cmdlucas/siler-fork - 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. cmdlucas/siler-fork

ActiveLibrary[Framework](/categories/framework)

cmdlucas/siler-fork
===================

Siler is a set of general purpose high-level abstractions aiming an API for declarative programming in PHP.

v2.0.0(6y ago)08MITPHPPHP &gt;=7.2

Since Mar 22Pushed 6y agoCompare

[ Source](https://github.com/cmdlucas/siler)[ Packagist](https://packagist.org/packages/cmdlucas/siler-fork)[ RSS](/packages/cmdlucas-siler-fork/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (17)Versions (16)Used By (0)

 [![](siler.png)](siler.png)

[![Build Status](https://camo.githubusercontent.com/d8aa454c1ff032b68757f77ae2c5417c1c330c77c7cd886c3c648a4876128230/68747470733a2f2f7472617669732d63692e6f72672f6c656f636176616c63616e74652f73696c65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/leocavalcante/siler)[![Phan](https://camo.githubusercontent.com/180fb1eb931c08a0247907c5d0cf160078adb96b287123fcf428833819d4a0a1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068616e2d6c6576656c253230312d3963662e737667)](https://github.com/phan/phan)[![codecov](https://camo.githubusercontent.com/ceb189a8ca924c982fb7e443f357cb087d32954e995e1d7cb277472382f7c216/68747470733a2f2f636f6465636f762e696f2f67682f6c656f636176616c63616e74652f73696c65722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/leocavalcante/siler)[![Latest Stable Version](https://camo.githubusercontent.com/a9deda298649a6e38fcd13823efd986076adf7a59fff3bd91cb346a2d78c7f0f/68747470733a2f2f706f7365722e707567782e6f72672f6c656f636176616c63616e74652f73696c65722f762f737461626c65)](https://packagist.org/packages/leocavalcante/siler)[![Total Downloads](https://camo.githubusercontent.com/f92b1d2b5259c6d0992fc3af9fcf7752b31fb81a9d88ca678c494db5de2011ed/68747470733a2f2f706f7365722e707567782e6f72672f6c656f636176616c63616e74652f73696c65722f646f776e6c6f616473)](https://packagist.org/packages/leocavalcante/siler)[![License](https://camo.githubusercontent.com/5a298544dba1273e6f7f087e9e6de21f2e1f0d84dea82f061a6a1ba9a42a1a21/68747470733a2f2f706f7365722e707567782e6f72672f6c656f636176616c63616e74652f73696c65722f6c6963656e7365)](https://packagist.org/packages/leocavalcante/siler)[![SensioLabsInsight](https://camo.githubusercontent.com/fecf6dd4fd0a22065d59423116bccb41fd05deb296c18bbfd5a393906a940be3/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f37303366323333652d303733382d346266332d396434372d3039643363366465313962302f6d696e692e706e67)](https://insight.sensiolabs.com/projects/703f233e-0738-4bf3-9d47-09d3c6de19b0)

Siler is a set of general purpose high-level abstractions aiming an API for declarative programming in PHP.

### Note:

[](#note)

This is a fork of `leocavalcante/siler`. Please visit  to learn more about the package.

The only addition is the fact that this fork supports `type config decorator`. It will be taken down once the PR on `leocavalcante/siler` is merged.

- 💧 **Files and functions** as first-class citizens
- 🔋 **Zero dependency**, everything is on top of PHP built-in functions
- ⚡ **Blazing fast**, no additional overhead - [*benchmark*](https://github.com/kenjis/php-framework-benchmark#results)

Use with [Swoole](https://www.swoole.co.uk/)
--------------------------------------------

[](#use-with-swoole)

Flat files and plain-old PHP functions rocking on a production-grade, high-performance, scalable, concurrent and non-blocking HTTP server.

[Read the tutorial.](https://siler.leocavalcante.com/swoole)

Getting Started
---------------

[](#getting-started)

[![Join the chat at https://gitter.im/leocavalcante/siler](https://camo.githubusercontent.com/d7adce7c0f2f655d749c18b4692ccce9bced894608df6a6dd878450762006032/68747470733a2f2f6261646765732e6769747465722e696d2f6c656f636176616c63616e74652f73696c65722e737667)](https://gitter.im/leocavalcante/siler?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

### Installation

[](#installation)

```
$ composer require cmdlucas/siler-fork
```

That is it. Actually, Siler is a library, not a framework (maybe a micro-framework), the overall program flow of control is dictated by you. So, no hidden configs or predefined directory structures.

#### Or you can start by bootstrapping

[](#or-you-can-start-by-bootstrapping)

```
$ composer create-project siler/project hello-siler
```

It's a minimal project template, just with Siler and a convenient `serve` script:

```
$ cd hello-siler/
$ composer serve
```

### Hello World

[](#hello-world)

```
use Siler\Functional as λ;
use Siler\Route;

Route\get('/', λ\puts('Hello World'));
```

Nothing more, nothing less. You don't need even tell Siler to `run` or something like that.

As said before, Siler aims to use PHP files and functions as first-class citizens, so no Controllers here. If you want to call something more self-container instead of a Closure, you can simply give a PHP filename then Siler will require it for you.

index.php

```
use Siler\Route;

Route\get('/', 'pages/home.php');
```

pages/home.php

```
echo 'Hello World';
```

### Namespaces

[](#namespaces)

Siler doesn't try to be a fully-featured framework - don't even aim to be a framework - instead it embraces component based architectures and offers helper functions to work with this components under PHP namespaces.

#### Twig

[](#twig)

Is one of the libraries that has helpers functions making work with templates quite simple.

```
$ composer require twig/twig
```

```
use Siler\Functional as F;
use Siler\Route;
use Siler\Twig;

Twig\init('path/to/templates');
Route\get('/', F\puts(Twig\render('template.twig')));
```

#### Dotenv

[](#dotenv)

Siler also brings helper functions for [vlucas/phpdotenv](https://github.com/vlucas/phpdotenv), so you can easily acomplish [twelve-factor](https://12factor.net/) apps.

```
$ composer require vlucas/phpdotenv
```

.env

```
TWIG_DEBUG=true
```

index.php

```
use Siler\Dotenv;
use Siler\Route;
use Siler\Twig;

Dotenv\init('path/to/.env');
Twig\init('path/to/templates', 'path/to/templates/cache', Dotenv\env('TWIG_DEBUG'));
Route\get('/', 'pages/home.php');
```

#### Monolog

[](#monolog)

Monolog sends your logs to files, sockets, inboxes, databases and various web services. See the complete list of handlers [here](https://github.com/Seldaek/monolog/blob/master/doc/02-handlers-formatters-processors.md#handlers). Special handlers allow you to build advanced logging strategies.

```
$ composer require monolog/monolog
```

```
use Siler\Monolog as Log;

Log\handler(Log\stream(__DIR__.'/siler.log'));

Log\debug('debug', ['level' => 'debug']);
Log\info('info', ['level' => 'info']);
Log\notice('notice', ['level' => 'notice']);
Log\warning('warning', ['level' => 'warning']);
Log\error('error', ['level' => 'error']);
Log\critical('critical', ['level' => 'critical']);
Log\alert('alert', ['level' => 'alert']);
Log\emergency('emergency', ['level' => 'emergency']);
```

#### GraphQL

[](#graphql)

[A query language for your API](http://graphql.org/). Thanks to webonyx/graphql-php you can build you Schema from a type definitions string and thanks to Siler you can tie them to resolvers:

```
$ composer require webonyx/graphql-php
```

schema.graphql

```
type Query {
  message: String
}

type Mutation {
  sum(a: Int, b: Int): Int
}
```

index.php

```
use Siler\Graphql;
use Siler\Http\Response;

// Enable CORS for GraphiQL
Response\header('Access-Control-Allow-Origin', '*');
Response\header('Access-Control-Allow-Headers', 'content-type');

$typeDefs = file_get_contents('path/to/schema.graphql');

$resolvers = [
    'Query' => [
        'message' => 'foo',
    ],
    'Mutation' => [
        'sum' => function ($root, $args) {
            return $args['a'] + $args['b'];
        },
    ],
];

Graphql\init(Graphql\schema($typeDefs, $resolvers));
```

---

MIT 2019

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 97.1% 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 ~45 days

Recently: every ~29 days

Total

11

Last Release

2519d ago

Major Versions

v1.5.3 → v2.0.02019-06-22

PHP version history (2 changes)v1.0.0PHP &gt;=7.1

v1.5.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/ee321c6d8de2183c8fd0156667f641cfb4df889ec2d9f8f5561856bd20039aaf?d=identicon)[cmdlucas](/maintainers/cmdlucas)

---

Top Contributors

[![leocavalcante](https://avatars.githubusercontent.com/u/183722?v=4)](https://github.com/leocavalcante "leocavalcante (637 commits)")[![cmdlucas](https://avatars.githubusercontent.com/u/16733484?v=4)](https://github.com/cmdlucas "cmdlucas (3 commits)")[![trollboy](https://avatars.githubusercontent.com/u/1096923?v=4)](https://github.com/trollboy "trollboy (3 commits)")[![eghojansu](https://avatars.githubusercontent.com/u/10484419?v=4)](https://github.com/eghojansu "eghojansu (2 commits)")[![lex111](https://avatars.githubusercontent.com/u/4408379?v=4)](https://github.com/lex111 "lex111 (1 commits)")[![muglug](https://avatars.githubusercontent.com/u/2292638?v=4)](https://github.com/muglug "muglug (1 commits)")[![petemcfarlane](https://avatars.githubusercontent.com/u/3472717?v=4)](https://github.com/petemcfarlane "petemcfarlane (1 commits)")[![quadrifolia](https://avatars.githubusercontent.com/u/630635?v=4)](https://github.com/quadrifolia "quadrifolia (1 commits)")[![SauliusUgintas](https://avatars.githubusercontent.com/u/37797480?v=4)](https://github.com/SauliusUgintas "SauliusUgintas (1 commits)")[![symm](https://avatars.githubusercontent.com/u/69390?v=4)](https://github.com/symm "symm (1 commits)")[![arysom](https://avatars.githubusercontent.com/u/1759253?v=4)](https://github.com/arysom "arysom (1 commits)")[![userlond](https://avatars.githubusercontent.com/u/7788670?v=4)](https://github.com/userlond "userlond (1 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (1 commits)")[![eaverdeja](https://avatars.githubusercontent.com/u/4304022?v=4)](https://github.com/eaverdeja "eaverdeja (1 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")

---

Tags

apiframeworkmicrorouterswoolefunctional

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/cmdlucas-siler-fork/health.svg)

```
[![Health](https://phpackages.com/badges/cmdlucas-siler-fork/health.svg)](https://phpackages.com/packages/cmdlucas-siler-fork)
```

###  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)

PHPackages © 2026

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