承接 binemmanuel/servemyphp 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

binemmanuel/servemyphp

最新稳定版本:v1.0.14

Composer 安装命令:

composer require binemmanuel/servemyphp

包简介

A light php library for building server-side applications (APIs)

README 文档

README

A light php library for building server-side applications (APIs)

Installation

To install use composer

composer require binemmanuel/servemyphp

Usage

# ./public_html/.htaccess

RewriteEngine On

<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
</IfModule>

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

<FilesMatch "\.(json|lock|md|env|txt|gitignore)">
    Order allow,deny
    Deny from all
</FilesMatch>

<FilesMatch "config.php">
    Order allow,deny
    Deny from all
</FilesMatch>

Options -Indexes
# .env

# Database Cridentials
DB_HOST = <host-name-here>
DB_USER = <database-username-here>
DB_PASSWORD = <database-password-here>
DB_NAME = <database-name-here>
DB_CHASET = 'utf8mb4'
# ./public_html/index.php

use Binemmanuel\ServeMyPhp\Router;
use Binemmanuel\ServeMyPhp\Request;
use Binemmanuel\ServeMyPhp\Response;
use Binemmanuel\ServeMyPhp\Database;

$database = (new Database($_ENV))->mysqli();
$app = new Router($database);

$app->get('/api/v1/get/message', function (Request $req, Response $res) use ($database) {
     $res::sendJson(["message" : "Hello, world"]);
});

$app->run();

Start Dev Server

php -S 0.0.0.0:8080 -t public_html

统计信息

  • 总下载量: 61
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-08-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固