PHPackages                             joelalejandro/descanse - 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. joelalejandro/descanse

ActiveLibrary[Framework](/categories/framework)

joelalejandro/descanse
======================

Super-simple routing for PHP

21112PHP

Since Nov 22Pushed 12y ago4 watchersCompare

[ Source](https://github.com/joelalejandro/Descanse)[ Packagist](https://packagist.org/packages/joelalejandro/descanse)[ RSS](/packages/joelalejandro-descanse/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Descanse
========

[](#descanse)

A really really simple API framework for PHP.

The name
--------

[](#the-name)

"Descanse" is the Spanish translation for "rest".

Requirements
------------

[](#requirements)

PHP &gt;= 5.3.0

Usage
-----

[](#usage)

1. Add the .htaccess file included in this repository. This file redirects all incoming requests to a single dispatcher.
2. Create a dispatcher file (i.e. index.php) that includes the Descanse core.
3. Create a class that has the word "Service" as a suffix (UserService, SearchService, etc.).
4. Create a method in that class with a name starting with get, post, put or delete (i.e. getUser, postUser, putUser, deleteUser, etc.). The method must return a PHP type, object or array.
5. Include the Service class in the dispatcher (this is done automatically by default).
6. Tell Descanse to run!

A Service Class example
-----------------------

[](#a-service-class-example)

``

```
 "Joel", "last" => "Villarreal");
}
}
?>

```

The Dispatcher
--------------

[](#the-dispatcher)

``

```
```

Guidelines
----------

[](#guidelines)

- Descanse creates routes automatically. Thus, UserProfileService becomes /userprofile/, and UserProfileService::getUserData() becomes GET /userprofile/userdata.
- All methods within the Service class must be *static*.
- All methods within the Service class must contain a *$context* argument, which contains an array with two keys: *request* (contains $\_REQUEST data) and *args* (contains all of the slugs in the URL beyond the second slash, i.e. if the route is /userprofile/userdata/1/abc/3f, *args* will contain \[0\] =&gt; 1, \[1\] =&gt; abc, \[2\] =&gt; 3f).
- All methods must start with *get*, *post*, *put* or *delete*.
- If you wish to change the default settings of Descanse, you may do so using *Descanse::$settings* before *Descanse::go()*.
- The 'Accept' header defines the API method's output. If Accept is 'application/json', it'll automatically encode the data. **More encoders are underway!**

Settings
--------

[](#settings)

- *auto\_register*: true to search in all declared classes those whose name ends with "Service", false to allow manual registration. To do so, use the *Descanse::registerService($name)*\* method.

License
-------

[](#license)

Descanse is licensed under the MIT License.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/joelalejandro-descanse/health.svg)

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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