Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/raeen123/bamboo

Bamboo is a php api framework
https://github.com/raeen123/bamboo

api api-framework framework php php-api-framework php-framework phpframework

Last synced: about 2 months ago
JSON representation

Bamboo is a php api framework

Awesome Lists containing this project

README

        

Bamboo


Bamboo is a php api framework . Very easy , simple and light



Made by Raeen Ahani in 2021 in Gorgan, Iran




[![Latest Stable Version](https://poser.pugx.org/raeen/bamboo/v)](//packagist.org/packages/raeen/bamboo)[![Total Downloads](https://poser.pugx.org/raeen/bamboo/downloads)](//packagist.org/packages/raeen/bamboo)[![Latest Unstable Version](https://poser.pugx.org/raeen/bamboo/v/unstable)](//packagist.org/packages/raeen/bamboo)[![License](https://poser.pugx.org/raeen/bamboo/license)](//packagist.org/packages/raeen/bamboo)[![Monthly Downloads](https://poser.pugx.org/raeen/bamboo/d/monthly)](//packagist.org/packages/raeen/bamboo)[![Daily Downloads](https://poser.pugx.org/raeen/bamboo/d/daily)](//packagist.org/packages/raeen/bamboo)[![composer.lock](https://poser.pugx.org/raeen/bamboo/composerlock)](//packagist.org/packages/raeen/bamboo)[![.gitattributes](https://poser.pugx.org/raeen/bamboo/gitattributes)](//packagist.org/packages/raeen/bamboo)[![Dependents](https://poser.pugx.org/raeen/bamboo/dependents)](//packagist.org/packages/raeen/bamboo)[![Suggesters](https://poser.pugx.org/raeen/bamboo/suggesters)](//packagist.org/packages/raeen/bamboo)

****

Install


```shell
composer create-project raeen/bamboo
```

Documentation


Database

To connect to the mysql database, refer to the ``.env``



Router

We use bramus/router for the router, of course we customized it so that by default in the controller the function of the sent method is executed



Method

The method sent to the controllers is stored in the ``$method`` ( ``$this->method`` ) variable



Path

The page address is stored in the ``$path`` ( ``$this->path`` ) variable on the controllers



Data

The data sent to the api is stored in the controllers in the ``$data`` ( ``$this->data`` ) variable



File

The information of the files is stored in the ``$files`` ( ``$this->files`` ) variable in the controllers



The files are downloaded in the archive folder. To download, use the ``download(key of file , save File name = null)``function in the controllers.



Use the ``sendFile(file name)`` function on the controllers to send the file



Authenticate

For the http authorization header, use the ``auth(username, password)`` function in the controllers



Api Key

Use the ``apikey(length = 20)`` function in the controller to create the api key



Query

Use the ``DB::query(sql query, parameters ...)`` function for SQL query on controllers. This function uses pdo
, example :
```php
$query = DB::query("SELECT * FROM user WHERE name=?", $name);

$result = $query->fetch(PDO::FETCH_OBJ);
```


Render

Use ``render(int $code, array | object $data = null, $status = null, $message = null)`` on the controllers to send the result as jason. Messages and statuses are completed by code by default