PHPackages                             graphene/graphene - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. graphene/graphene

ActiveLibrary[HTTP &amp; Networking](/categories/http)

graphene/graphene
=================

PHP rest framework

0.3.4(7y ago)0713[11 issues](https://github.com/marcomag89/Graphene/issues)[2 PRs](https://github.com/marcomag89/Graphene/pulls)MITPHPPHP &gt;=5.6.0

Since May 27Pushed 2y ago1 watchersCompare

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

READMEChangelog (8)Dependencies (1)Versions (6)Used By (0)

Graphene \[Barium\] beta
========================

[](#graphene-barium-beta)

This framework allows you to create Action Oriented REST services with less lines of code, like this:

```
class HelloWorld extends Action{
	public function run ()
	{
		$this->sendMessage('Hello world');
	}
}
```

Install Graphene with composer
------------------------------

[](#install-graphene-with-composer)

Graphene is can be installed using [composer](https://getcomposer.org/):

```
composer require graphene/graphene
```

after install you can bootstrap you application doing

```
cp ./vendor/graphene/graphene/_installation/* .
```

this command extracts from downloaded graphene library:

- **index.php** Contains simple graphene launcher
- **settings.php** Contains basic settings for logging and persistence
- **cli.php** Simple CLI adapter for graphene
- **.htaccess** Apache file with url rewriting and redirecting to `index.php`
- **web.config** same with `.htaccess`, for windows ISS

Graphene settings file
----------------------

[](#graphene-settings-file)

\[work in progress\]

Action approach
---------------

[](#action-approach)

Any http request to Graphene matches an "action". In graphene action mapping is quick and smart, ball actions are collected in separate modules.

### Defining module

[](#defining-module)

you can define your module creating folder in your moduleUrl, definded in [settings.json](#setting-up-graphene).

```
{
    "v" :  "0.1.1",
    "info": {
        "version"   : "0.0.0.1",
        "name"      : "com.profile",
        "namespace" : "profiles",
        "author"    : "Me [me@mail.com]",
        "support"   : "meMod.com"
    },
    "actions": []
}
```

in this case we have created a module named "com.profile", with "profiles" as namespace. this module does not have any action.

### Creating actions

[](#creating-actions)

now we can ceate a simple action "HELLO\_WORLD", mapping that on request *GET host/profiles/hello*you can add this action creating this entry in your module manifest:

```
{"name":"HELLO_WORLD", "query":"hello"}
```

and creating `profiles.HELLO_WORLD.php` file in `actions` folder like this:

```
namespace profiles;

class HelloWorld extends Action{
    public function run ()
    {
        $this->sendMessage('Hello world');
    }
}
```

### Model

[](#model)

Graphene supports model checking and storage *doc work in progress*

### Scaffolding

[](#scaffolding)

When you create a new module, we recomends this directory structure for your models and actions

```
_module namespace_
 +--manifest.json
 +--models
 |   |--ModelClassA.php
 |   |--ModelClassB.php
 |   |--Mod...
 +--actions
 |   |--namespace.ACTION_NAME_A.php
 |   |--namespace.ACTION_NAME_B.php
 |   |--namespace...

```

Wiki
----

[](#wiki)

we are very excited that you want to use Graphene therefore we are working so that you can use it to its full potential by writing up to date wiki. [Go to Graphene wiki](https://github.com/marcomag89/Graphene/wiki)

### HowTo

[](#howto)

**Hello world** [tutorial](https://github.com/marcomag89/Graphene/wiki/Hello-World-tutorial)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.2% 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 ~179 days

Total

4

Last Release

2736d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/30a5d8690885da8d700bd565b5b69716b4c4cba81497de99aaf904322f4a4212?d=identicon)[marcomag89](/maintainers/marcomag89)

---

Top Contributors

[![marcomag89](https://avatars.githubusercontent.com/u/8920568?v=4)](https://github.com/marcomag89 "marcomag89 (204 commits)")[![dynshon](https://avatars.githubusercontent.com/u/9192187?v=4)](https://github.com/dynshon "dynshon (8 commits)")

---

Tags

apirest

### Embed Badge

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

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

###  Alternatives

[xendit/xendit-php

Xendit PHP SDK

189730.6k6](/packages/xendit-xendit-php)[angelleye/paypal-php-library

PHP wrapper for PayPal APIs

243440.9k](/packages/angelleye-paypal-php-library)[infobip/infobip-api-php-client

PHP library for consuming Infobip's API

921.8M10](/packages/infobip-infobip-api-php-client)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[mediamonks/rest-api-bundle

MediaMonks Rest API Symfony Bundle

1656.2k1](/packages/mediamonks-rest-api-bundle)[phrest/api

REST API Package for Phalcon PHP

304.2k](/packages/phrest-api)

PHPackages © 2026

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