定制 ahmedosama/php-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

ahmedosama/php-api

最新稳定版本:v1.1.0

Composer 安装命令:

composer create-project ahmedosama/php-api

包简介

Make an API for your application using PHP

README 文档

README

  • This is a simple php-api project to make an API for your application using PHP native.

REQUIRMENTS

  • PHP v8.0 or higher.
  • composer

Download and install

git clone https://github.com/ahmed-osama2022/php-api
cd php-api
composer install
  • Then serve the public folder
# if you're using php-cli 
php -S localhost:8000 -t public

example of .env file

  • You should put your .env file at the root folder in the project.
DB_HOST=
DB_NAME=
DB_PORT=
DB_USER=
DB_PASS=

Check if it is working fine

  • If you start serving the project you should see this welcome page at your serving link.

  • Welcome Page Welcome screen

  • Test route Test route

How to work with?

NOTE: This library uses MVC in the structure.

NOTE: This project uses psr-4 autoloader for the src and App folder.

  • Put all your credentials for the database in the .env file.

  • Define all your routes as explained in the src/Router.php file.

  • You will see an example in the files to tell you How to use it fine.

  • Start making the logic of your application as contrllers you defined in the App/controllers folder.

统计信息

  • 总下载量: 33
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-21