ascetic-soft/rowcast-bundle 问题修复 & 功能扩展

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

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

ascetic-soft/rowcast-bundle

Composer 安装命令:

composer require ascetic-soft/rowcast-bundle

包简介

Symfony bundle integration for Rowcast and RowcastSchema

README 文档

README

Symfony bundle for integrating:

  • ascetic-soft/rowcast (Connection + DataMapper)
  • ascetic-soft/rowcast-schema (optional schema/migration services + console commands)

Requirements

  • PHP >=8.4
  • Symfony components:
    • symfony/config
    • symfony/dependency-injection
    • symfony/http-kernel
  • Optional:
    • ascetic-soft/rowcast-schema
    • symfony/console
    • ascetic-soft/rowcast-profiler (+ symfony/framework-bundle for the profiler panel)

Installation

composer require ascetic-soft/rowcast-bundle

Monorepo / contributing: if ascetic-soft/rowcast-profiler is not on Packagist yet, add a path repository in composer.json (see this repo’s RowcastBundle/composer.json) so ^1.0 resolves to the sibling RowcastProfiler directory. Remove the path repository after the profiler is published.

If Symfony Flex does not auto-register the bundle, add it manually to config/bundles.php:

<?php

return [
    AsceticSoft\RowcastBundle\RowcastBundle::class => ['all' => true],
];

Symfony Flex private recipe

For automatic creation of config/packages/rowcast.yaml and .env variables, use a private Symfony Flex recipe repository.

Prepared recipe files are located in:

  • ../RowcastBundleRecipes/index.json
  • ../RowcastBundleRecipes/ascetic-soft.rowcast-bundle.1.0.json

Current endpoint configured in composer.json:

"extra": {
    "symfony": {
        "bundle": "AsceticSoft\\RowcastBundle\\RowcastBundle",
        "endpoint": [
            "https://api.github.com/repos/ABorodulin/rowcast-bundle-recipes/contents/index.json",
            "flex://defaults"
        ]
    }
}

Before using in production, replace ABorodulin/rowcast-bundle-recipes with your real GitHub account/repository and ensure the recipe JSON files are published at that endpoint.

Configuration

Create config/packages/rowcast.yaml:

rowcast:
  connection:
    dsn: '%env(DATABASE_DSN)%'
    username: '%env(DATABASE_USER)%'
    password: '%env(DATABASE_PASSWORD)%'
    options: []
    nest_transactions: true

  schema:
    path: '%kernel.project_dir%/database/schema.php'
    migrations_path: '%kernel.project_dir%/database/migrations'
    migration_table: '_rowcast_migrations'
    ignore_tables: []

  profiler:
    enabled: false
    collect_params: true
    slow_query_threshold_ms: 50
    max_queries: 500

SQL profiler (optional)

Install the profiler package and enable it in config (e.g. only in dev):

composer require ascetic-soft/rowcast-profiler
# For the web debug toolbar / profiler UI:
composer require symfony/web-profiler-bundle --dev
# config/packages/dev/rowcast.yaml
rowcast:
    profiler:
        enabled: true

When profiler.enabled is true and the package is present, the bundle decorates AsceticSoft\Rowcast\Connection with ConnectionProfiler, resets the query store between requests (kernel.reset), and registers RowcastDataCollector if symfony/framework-bundle is installed (toolbar + profiler panel Rowcast).

Attributes schema support

rowcast.schema.path can point either to:

  • a schema file (.php, .yaml, .yml)
  • a directory with classes that contain Rowcast attributes

Parser selection is automatic:

  • if path is a directory and AttributeSchemaParser is available, bundle uses attribute parser
  • otherwise bundle uses file parser based on file extension

Example for attribute-based schema:

rowcast:
  schema:
    path: '%kernel.project_dir%/src/Entity'
    migrations_path: '%kernel.project_dir%/database/migrations'
    migration_table: '_rowcast_migrations'
    ignore_tables: []

Registered services

Core services (always):

  • AsceticSoft\Rowcast\Connection
  • alias AsceticSoft\Rowcast\ConnectionInterface -> AsceticSoft\Rowcast\Connection
  • AsceticSoft\Rowcast\DataMapper
  • rowcast.pdo (factory: Connection::getPdo())

Profiler services (only when profiler.enabled is true and ascetic-soft/rowcast-profiler is installed):

  • AsceticSoft\RowcastProfiler\InMemoryQueryProfileStore (tag kernel.reset)
  • AsceticSoft\RowcastProfiler\DefaultParameterSanitizer
  • AsceticSoft\RowcastProfiler\SqlClassifier
  • AsceticSoft\RowcastProfiler\RowcastProfiler
  • AsceticSoft\RowcastProfiler\ConnectionProfiler (decorates AsceticSoft\Rowcast\Connection)
  • AsceticSoft\RowcastBundle\DataCollector\RowcastDataCollector (when symfony/framework-bundle is available)

Schema services (only when ascetic-soft/rowcast-schema is installed):

  • AsceticSoft\RowcastSchema\Parser\SchemaParserInterface
  • AsceticSoft\RowcastSchema\Diff\SchemaDiffer
  • AsceticSoft\RowcastSchema\Migration\MigrationGenerator
  • AsceticSoft\RowcastSchema\Migration\MigrationLoader
  • AsceticSoft\RowcastSchema\Introspector\IntrospectorFactory
  • AsceticSoft\RowcastSchema\Platform\PlatformFactory
  • AsceticSoft\RowcastSchema\Platform\PlatformInterface
  • AsceticSoft\RowcastSchema\Cli\TableIgnoreMatcher
  • AsceticSoft\RowcastSchema\Migration\DatabaseMigrationRepository
  • alias AsceticSoft\RowcastSchema\Migration\MigrationRepositoryInterface -> DatabaseMigrationRepository
  • AsceticSoft\RowcastSchema\Migration\MigrationRunner

Console commands

When symfony/console is available:

  • bin/console rowcast:query "SELECT * FROM users"
  • bin/console rowcast:query "SELECT * FROM users WHERE id = :id" --param id=123

rowcast:query executes arbitrary SQL through the configured Rowcast PDO connection. Queries returning rows are printed as a table; other queries print the affected row count. Repeat --param / -p to pass multiple name=value parameters:

bin/console rowcast:query "SELECT * FROM users WHERE email = :email AND status = :status" \
  --param email=user@example.com \
  --param status=active

When both ascetic-soft/rowcast-schema and symfony/console are available:

  • bin/console rowcast:diff [--dry-run]
  • bin/console rowcast:make
  • bin/console rowcast:migrate
  • bin/console rowcast:rollback [--step=1]
  • bin/console rowcast:status

Usage example

<?php

use AsceticSoft\Rowcast\DataMapper;

final readonly class UserRepository
{
    public function __construct(private DataMapper $mapper)
    {
    }

    // ...
}

ascetic-soft/rowcast-bundle 适用场景与选型建议

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

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

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

围绕 ascetic-soft/rowcast-bundle 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-06