定制 ewq-zone-oy/spin-framework 二次开发

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

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

ewq-zone-oy/spin-framework

Composer 安装命令:

composer require ewq-zone-oy/spin-framework

包简介

A super lightweight PHP UI/REST Framework

README 文档

README

Latest Stable Version Total Downloads License PHP8 Ready

SPIN - A super lightweight PHP UI/REST framework

Latest Unstable Version Build Status

SPIN is a application framework for making Web UI's and REST API's quickly and effectively with PHP. It uses PSR standards for most things, and allows for plugging in almost any PSR compatible component, such as loggers, HTTP libraries etc.

    NOTE: This framework is in RC stage - Please contribute to make it complete

1. Features

  • PHP 8+
  • Platform agnostic. (Windows, *nix)
  • Routing engine, with route groups
  • Middleware
  • Containers
  • Composer driven in packages/extensions
  • PDO based DB connections (MySql,PostgreSql,Oracle,CockroachDb,Firebird,Sqlite ...)
  • DAO base classes for DB Entity representation
  • Extendable with other frameworks (ORM, Templates etc.)

1.1. PSR based integrations

  • Logger (PSR-3) Defaults to Monolog
  • HTTP Message (PSR-7). Defaults to Guzzle
  • Container (PSR-11). Defaults to The Leauge Container
  • SimpleCache (PSR-16). Defaults to APCu SimpleCache
  • HTTP Factories (PSR-17)

2. Installation

Installing spin-framework as standalone with composer:

composer require celarius/spin-framework

2.1. Using the spin-skeleton

To install and use the spin-framework it is highly recommended to start by cloning the spin-skeleton and running composer update -o in the folder. This will download all needed packages, and create a template skeleton project, containing example configs, routes, controllers and many other things.

2.2. Testing

On Windows based systems simply type

.\phpunit.cmd

At the command prompt and all tests will be executed.

3. Technical Details

3.1. Apache configuration

VHost for running the application under Apache with domain-name recognition.

If Port number based applications are desired the <VirtualHost:80> needs to change to the corresponding port, and the domain.name removed from the config.

<VirtualHost *:80>

    Define domain.name              mydomain.com
    Define alias.domain.name        www.mydomain.com
    Define path_to_root             C:/Path/Project
    Define environment              DEV

    ServerName ${domain.name}
    ServerAlias ${alias.domain.name}
    ServerAdmin webmaster@${domain.name}

    DocumentRoot "${path_to_root}\src\public"

    ErrorLog "logs/${domain.name}.error.log"
    CustomLog "logs/${domain.name}.access.log" common

    # Default caching headers for static content in /public
    <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
      Header set Cache-Control "public, max-age=604800, must-revalidate"
    </FilesMatch>

    <Directory "${path_to_root}\src\public">
        Options -Indexes +FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
        Require all granted

        # Set Variables
        SetEnv ENVIRONMENT ${environment}

        # Load files in this order on "/"
        DirectoryIndex bootstrap.php index.php index.html

        # Disable appending a "/" and 301 redirection when a directory
        # matches the requested URL
        DirectorySlash Off

        # Set Rewrite Engine ON to direct all requests to
        # the `bootstrap.php` file
        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^ bootstrap.php [QSA,L]
    </Directory>
</VirtualHost>

3.2. Nginx configuration

server {
    listen 80;
    server_name mydomain.com www.mydomain.com;

    root C:/Path/Project/src/public;  # Nginx on Windows still uses forward slashes
    index bootstrap.php index.php index.html;

    access_log logs/mydomain.com.access.log;
    error_log logs/mydomain.com.error.log;

    # Set environment variable for PHP-FPM
    fastcgi_param ENVIRONMENT DEV;

    # Default caching headers for static content
    location ~* \.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$ {
        add_header Cache-Control "public, max-age=604800, must-revalidate";
        try_files $uri =404;
    }

    # Deny directory listings
    location / {
        try_files $uri $uri/ /bootstrap.php?$query_string;
    }

    # PHP handling (adjust the socket/path to your PHP-FPM setup)
    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass 127.0.0.1:9000; # or unix:/var/run/php/php8.1-fpm.sock
        fastcgi_index bootstrap.php;
    }
}

ewq-zone-oy/spin-framework 适用场景与选型建议

ewq-zone-oy/spin-framework 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 11 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「framework」 「rest」 「api」 「Microservice」 「rest-api」 「PHP7」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 ewq-zone-oy/spin-framework 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ewq-zone-oy/spin-framework 我们能提供哪些服务?
定制开发 / 二次开发

基于 ewq-zone-oy/spin-framework 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-12