twitnic/slimer 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

twitnic/slimer

Composer 安装命令:

composer require twitnic/slimer

包简介

Artisan-style console tooling for Slim Framework 2 applications.

README 文档

README

twitnic/slimer is a standalone Composer package that gives Slim Framework 2 projects an Artisan-style command line experience.

It ships with:

  • a vendor/bin/slimer console entrypoint
  • Slim 2 bootstrap discovery via .slimer.php
  • route:list for inspecting registered routes
  • serve for running the built-in PHP web server
  • init, make:command, make:controller, make:middleware, and make:view
  • hooks for custom project commands

Installation

composer require twitnic/slimer

Quick start

Initialize the package inside an existing Slim 2 application:

vendor/bin/slimer init

That creates a .slimer.php file. Point the generated bootstrap callback to your Slim entry script if needed, then inspect the available commands:

vendor/bin/slimer list
vendor/bin/slimer about
vendor/bin/slimer route:list

Configuration

Slimer looks for configuration in this order:

  1. the path from SLIMER_CONFIG
  2. .slimer.php
  3. config/slimer.php
  4. app/config/slimer.php

Example configuration:

<?php

return array(
    'bootstrap' => 'app/bootstrap.php',

    'commands' => array(
        App\Console\Commands\CleanupCommand::class,
    ),

    'generators' => array(
        'commands_path' => 'app/Console/Commands',
        'command_namespace' => 'App\\Console\\Commands',
        'controllers_path' => 'app/controllers',
        'controller_namespace' => 'App\\Controllers',
        'middleware_path' => 'app/middleware',
        'middleware_namespace' => 'App\\Middleware',
        'views_path' => 'app/views',
    ),
);

Built-in commands

vendor/bin/slimer about
vendor/bin/slimer init
vendor/bin/slimer route:list
vendor/bin/slimer serve --host=127.0.0.1 --port=8080
vendor/bin/slimer make:command Cleanup
vendor/bin/slimer make:controller Admin/User
vendor/bin/slimer make:middleware ApiAuth
vendor/bin/slimer make:view admin/dashboard

Notes

  • route:list expects a bootstrapped Slim\Slim instance.
  • Prefer a dedicated bootstrap file that builds the application without immediately calling $app->run().
  • Custom commands can either be instantiated directly, returned from a callable, or referenced by class name.
  • Generated middleware classes extend \Slim\Middleware, which matches Slim 2.

twitnic/slimer 适用场景与选型建议

twitnic/slimer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 02 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 twitnic/slimer 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-02