texxasrulez/force_elastic 问题修复 & 功能扩展

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

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

texxasrulez/force_elastic

Composer 安装命令:

composer require texxasrulez/force_elastic

包简介

Roundcube webmail plugin that forces the Elastic skin on phones and tablets at runtime (no user preference changes).

README 文档

README

Packagist Downloads Packagist Version Github License GitHub Stars GitHub Issues GitHub Contributors GitHub Forks Donate Paypal

Forces the Elastic skin for requests coming from mobile devices — without changing the user's saved skin preference or your system default. This keeps small screens functional even when users have selected legacy/non-responsive skins.

What it does

  • Detects mobile clients early in request flow (startup and authenticate hooks).
  • Sets the runtime skin to elastic and, when present, updates the Output object's skin.
  • Uses Roundcube's browser detector if available; otherwise falls back to a tight UA regex.
  • Never persists preferences. Desktop users keep their chosen skin.

Install via Composer (recommended)

This path installs straight from Packagist/Git and lets Roundcube's plugin-installer wire it up.

  1. From your Roundcube root directory:
composer require texxasrulez/force_elastic
  1. Enable the plugin in config/config.inc.php:
// Append to your existing list, do not duplicate other plugins
$config['plugins'] = array_merge($config['plugins'] ?? [], ['force_elastic']);
// or set explicitly:
// $config['plugins'] = ['force_elastic', /* other plugins... */];
  1. Clear Roundcube caches (good hygiene after plugin changes):
bin/cleandb.sh || true
bin/update.sh --skip-deps || true

Installing directly from Git (optional)

If you prefer to track the GitHub repo without Packagist:

cd /path/to/roundcube
composer config repositories.force_elastic git https://github.com/texxasrulez/force_elastic.git
composer require texxasrulez/force_elastic:dev-main

Manual install (no Composer)

  1. Copy the force_elastic plugin folder into Roundcube:
/path/to/roundcube/plugins/force_elastic
  1. Enable it in config/config.inc.php as shown above.

Configuration

An optional config file is provided. Copy plugins/force_elastic/config.inc.php.dist to plugins/force_elastic/config.inc.php and adjust as needed.

// Skin to force on mobile devices (keep 'elastic' unless you know what you're doing)
$config['force_elastic.skin'] = 'elastic';

// Optionally disable the fallback UA sniff; rely solely on Roundcube's browser detector
$config['force_elastic.use_ua_sniff'] = true;

No configuration is required for default behavior.

How detection works

  1. Prefer Roundcube's built-in browser detector (if available on your version/path).
  2. Fall back to a conservative User-Agent regex for common phones/tablets.
  3. Apply skin change at runtime only; no DB writes and no preference mutations.

Uninstall

  • Remove 'force_elastic' from $config['plugins'] in config/config.inc.php.
  • If installed via Composer: composer remove texxasrulez/force_elastic.
  • Delete plugins/force_elastic/ if manually installed.

Troubleshooting

  • Elastic isn’t applied on mobile: Check proxies/CDNs that might rewrite User-Agent. If so, rely on Roundcube's detector by disabling UA sniff in the plugin config.
  • Conflicts with other skin/branding plugins: Ensure force_elastic is loaded after any plugin that explicitly sets a skin for all requests.
  • Caching: Clear browser cache and Roundcube caches after first install.

texxasrulez/force_elastic 适用场景与选型建议

texxasrulez/force_elastic 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 21 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 08 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2025-08-23