定制 slothsoft/core 二次开发

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

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

slothsoft/core

Composer 安装命令:

composer require slothsoft/core

包简介

Core stuff.

README 文档

README

Packagist Version PHP Version Support Documentation Test Status license badge

Shared utility package for slothsoft PHP packages.

This is one of the oldest slothsoft packages. It contains actively used infrastructure, older but still supported utility APIs, and historical compatibility code. The package is kept installable for existing consumers, but not every namespace is recommended for new code.

Compatibility Policy

Semantic versioning is in effect. Public classes are public API, including public constructors, methods, constants, and properties. Public signatures must remain backward-compatible unless an API-breaking change is specifically requested for a major release.

All code in this package must remain syntactically valid on PHP 7.4 and behaviorally compatible with every PHP version covered by CI. Newer PHP runtimes may be used locally, but PHP 8-only syntax is not allowed.

Bug fixes are allowed in every area of the package, including deprecated and historical APIs. Deprecated APIs should not be used for new code, but they are still expected to keep working for existing consumers, including compatibility fixes for newer PHP versions.

Adding dependencies is acceptable when the dependency is justified by the change and remains compatible with this package's supported PHP versions.

Current / Supported Areas

These parts are suitable for use in new or maintained slothsoft code:

  • Slothsoft\Core\IO\Writable
    • Writer interfaces for string, file, DOM, stream, and chunk based data.
    • Adapter, decorator, delegate, and merger implementations.
  • Slothsoft\Core\IO\Psr7
    • PSR-7 stream helpers and stream implementations.
    • Lazy writer streams, generator streams, process streams, chunked streams, and zlib filtered streams.
  • Slothsoft\Core\StreamWrapper
    • Stream wrapper abstractions for files, resources, and PSR-7 streams.
  • Slothsoft\Core\StreamFilter
    • PHP stream filter abstractions and implementations for identity, chunked encoding, gzip, and deflate.
  • Slothsoft\Core\XSLT
    • XSLT input and adapter layer for PHP/libxml, CLI processors, Saxon, and Saxon/C.
  • Slothsoft\Core\IO\Sanitizer
    • Small sanitizers for strings, arrays, integers, tokens, and filenames.
  • Slothsoft\Core\MimeTypeDictionary
    • MIME type and extension lookup helpers.
  • Slothsoft\Core\CacheDirectoryStorage
    • File-system based ephemeral cache storage.

Supported Legacy Areas

These APIs are older and may be redesigned later, but they are still intended to be usable and supported:

  • Slothsoft\Core\DOMHelper
    • DOM parsing, XPath namespace registration, serialization, and XSLT helpers.
  • Slothsoft\Core\FileSystem
    • Large static file-system helper with old media/archive conventions.
  • Slothsoft\Core\ServerEnvironment
    • Static process-wide directory and host configuration.
  • Slothsoft\Core\Configuration
    • Mutable configuration fields used by older static APIs.
  • Slothsoft\Core\Calendar
    • Small date/time and duration helpers.
  • Slothsoft\Core\CLI
    • Process execution helper.
  • scripts/bootstrap.php
    • Global helper functions loaded through Composer.
  • Slothsoft\Core\DBMS
    • mysqli wrapper layer.

Historical / Deprecated / Out Of Support

These components are included for historical reasons only. Do not use them for new code. Prefer maintained libraries or package-local implementations instead.

  • Slothsoft\Core\Storage
    • Old cache and remote loading facade built around XMLHttpRequest, DBMS fallback, and static configuration.
  • Slothsoft\Core\XMLHttpRequest
    • Browser-style HTTP client abstraction over cURL.
  • Slothsoft\Core\CloudFlareScraper
    • Old Cloudflare challenge workaround.
  • Slothsoft\Core\WebCrawler
    • Small legacy crawler built on Storage.
  • Slothsoft\Core\Image and Slothsoft\Core\ImageHelper
    • Old image helpers depending on optional GD/Imagick behavior.
  • Slothsoft\Core\IO\HTTPFile and Slothsoft\Core\IO\HTTPStream
    • Legacy HTTP-backed file/stream helpers.
  • Slothsoft\Core\RCon
    • Legacy remote console helper.
  • Slothsoft\Core\Game
    • Dice, name, and prime helpers retained for old consumers.
  • Slothsoft\Core\InterExec
    • Legacy execution helper.

Development Notes

Some APIs use global or static process state, especially ServerEnvironment, Configuration, Storage, and file-system/cache helpers. Tests that exercise stateful behavior should isolate side effects with @runInSeparateProcess.

Tests may create temporary files through temp_file, temp_dir, or Slothsoft\Core\IO\FileInfoFactory::createTempFile; those helpers do not require manual cleanup. Files in test-files/ are canonical fixtures.

The local development environment should provide the Composer development extensions. If an optional extension or platform feature is unavailable, affected tests may be skipped or impossible to run locally. Skipped tests should be treated as intentionally skipped unless the task is specifically about test skipping.

Use .editorconfig for coding style. Additional formatter or static-analysis tooling may be added later, but none is required right now.

Installation

composer require slothsoft/core

Requirements

See composer.json for required PHP extensions and optional development extensions.

slothsoft/core 适用场景与选型建议

slothsoft/core 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 26.1k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 12 月 28 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-12-28