Skip to content

Latest commit

 

History

History
77 lines (57 loc) · 3.06 KB

Readme.md

File metadata and controls

77 lines (57 loc) · 3.06 KB

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