raeen/bamboo

Bamboo is a php api framework

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 0

Forks: 0

Open Issues: 0

Type:project

1.0.0 2021-03-25 13:30 UTC

This package is auto-updated.

Last update: 2024-04-26 16:02:48 UTC


README

icon.ico

Bamboo

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

Made by Raeen Ahani in 2021 in Gorgan, Iran

Latest Stable VersionTotal DownloadsLatest Unstable VersionLicenseMonthly DownloadsDaily Downloadscomposer.lock.gitattributesDependentsSuggesters


Install


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 :

$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